--
All checks were successful
Deploy / CreateImage (push) Successful in 4m53s
Deploy / DeployService (push) Successful in 27s

This commit is contained in:
Nastya 2025-07-01 11:23:40 +03:00
parent b09e587220
commit d5622a5a86
4 changed files with 78 additions and 2 deletions

@ -5,8 +5,9 @@ import { useTranslation } from "react-i18next";
type Props = Partial<FallbackProps>; type Props = Partial<FallbackProps>;
export const ApologyPage = ({ error }: Props) => { export const ApologyPage = ({ error }: Props) => {
let message = error.message || error.response?.data; let message = error?.message || error?.response?.data || "default message";
console.log("message"); console.log("message");
console.log(message);
console.log(message.toLowerCase()); console.log(message.toLowerCase());
const { t } = useTranslation(); const { t } = useTranslation();
console.log("t"); console.log("t");

@ -18,11 +18,77 @@ const getLanguageFromURL = (): string => {
return "ru"; // Жёсткий фолбэк return "ru"; // Жёсткий фолбэк
}; };
const r = {
ru: {
"quiz is inactive": "Квиз не активирован",
"no questions found": "Нет созданных вопросов",
"quiz is empty": "Квиз пуст",
"quiz already completed": "Вы уже прошли этот опрос",
"no quiz id": "Отсутствует id квиза",
"quiz data is null": "Не были переданы параметры квиза",
"invalid request data": "Такого квиза не существует",
"default message": "Что-то пошло не так",
"The request could not be sent": "Заявка не может быть отправлена",
"The number of points could not be sent": "Количество баллов не может быть отправлено",
"Your result": "Ваш результат",
"Your points": "Ваши баллы",
of: "из",
"View answers": "Посмотреть ответы",
"Find out more": "Узнать подробнее",
"Go to website": "Перейти на сайт",
"Question title": "Заголовок вопроса",
"Question without a title": "Вопрос без названия",
"Your answer": "Ваш ответ",
"Add image": "Добавить изображение",
"Accepts images": "Принимает изображения",
"Add video": "Добавить видео",
"Accepts .mp4 and .mov format - maximum 50mb": "Принимает .mp4 и .mov формат — максимум 50мб",
"Add audio file": "Добавить аудиофайл",
"Accepts audio files": "Принимает аудиофайлы",
"Add document": "Добавить документ",
"Accepts documents": "Принимает документы",
Next: "Далее",
Prev: "Назад",
From: "От",
До: "До",
"Enter your answer": "Введите свой ответ",
"Incorrect file type selected": "Выбран некорректный тип файла",
"File is too big. Maximum size is 50 MB": "Файл слишком большой. Максимальный размер 50 МБ",
"Acceptable file extensions": "Допустимые расширения файлов",
"You have uploaded": "Вы загрузили",
"The answer was not counted": "Ответ не был засчитан",
"Select an answer option below": "Выберите вариант ответа ниже",
"Select an answer option on the left": "Выберите вариант ответа слева",
"Fill out the form to receive your test results": "Заполните форму, чтобы получить результаты теста",
Enter: "Введите",
Name: "Имя",
"Phone number": "Номер телефона",
"Last name": "Фамилия",
Address: "Адрес",
"Incorrect email entered": "Введена некорректная почта",
"Please fill in the fields": "Пожалуйста, заполните поля",
"Please try again later": "повторите попытку позже",
"Regulation on the processing of personal data": "Положением об обработке персональных данных",
"Privacy Policy": "Политикой конфиденциальности",
familiarized: "ознакомлен",
and: "и",
"Get results": "Получить результаты",
"Data sent successfully": "Данные успешно отправлены",
Step: "Шаг",
"questions are not ready yet": "Вопросы для аудитории ещё не созданы. Пожалуйста, подождите",
"Add your image": "Добавьте своё изображение",
"select emoji": "выберите смайлик",
"file is too big": "Файл слишком большой",
"file type is not supported": "Тип файла не поддерживается",
},
};
// 2. Конфиг с полной отладкой // 2. Конфиг с полной отладкой
i18n i18n
.use(Backend) .use(Backend)
.use(initReactI18next) .use(initReactI18next)
.init({ .init({
resources: r,
lng: getLanguageFromURL(), // Принудительно из URL lng: getLanguageFromURL(), // Принудительно из URL
fallbackLng: "ru", fallbackLng: "ru",
supportedLngs: ["en", "ru", "uz"], supportedLngs: ["en", "ru", "uz"],

@ -2,6 +2,7 @@ import QuizAnswerer from "@/components/QuizAnswerer";
import { createRoot } from "react-dom/client"; import { createRoot } from "react-dom/client";
// eslint-disable-next-line react-refresh/only-export-components // eslint-disable-next-line react-refresh/only-export-components
export * from "./widgets"; export * from "./widgets";
import "./i18n/i18n";
// old widget // old widget
const widget = { const widget = {
@ -19,7 +20,13 @@ const widget = {
const root = createRoot(element); const root = createRoot(element);
root.render(<QuizAnswerer quizId={quizId} changeFaviconAndTitle={changeFaviconAndTitle} disableGlobalCss />); root.render(
<QuizAnswerer
quizId={quizId}
changeFaviconAndTitle={changeFaviconAndTitle}
disableGlobalCss
/>
);
}, },
}; };

@ -9,6 +9,8 @@ export default defineConfig({
alias, alias,
}, },
build: { build: {
minify: false, // Отключает минификацию
sourcemap: true, // Включает sourcemaps для отладки
copyPublicDir: false, copyPublicDir: false,
rollupOptions: { rollupOptions: {
input: "src/widget.tsx", input: "src/widget.tsx",