diff --git a/lib/components/ViewPublicationPage/ApologyPage.tsx b/lib/components/ViewPublicationPage/ApologyPage.tsx index a6afa60..46ae131 100644 --- a/lib/components/ViewPublicationPage/ApologyPage.tsx +++ b/lib/components/ViewPublicationPage/ApologyPage.tsx @@ -7,6 +7,7 @@ type Props = Partial; export const ApologyPage = ({ error }: Props) => { let message = error.message || error.response?.data; console.log("message"); + console.log(message); console.log(message.toLowerCase()); const { t } = useTranslation(); console.log("t"); diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index e4f8067..eaf467e 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -18,11 +18,75 @@ const getLanguageFromURL = (): string => { 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": "выберите смайлик", + }, +}; + // 2. Конфиг с полной отладкой i18n .use(Backend) .use(initReactI18next) .init({ + resources: r, lng: getLanguageFromURL(), // Принудительно из URL fallbackLng: "ru", supportedLngs: ["en", "ru", "uz"], diff --git a/src/widget.tsx b/src/widget.tsx index 653e35b..b79abc1 100644 --- a/src/widget.tsx +++ b/src/widget.tsx @@ -2,6 +2,7 @@ import QuizAnswerer from "@/components/QuizAnswerer"; import { createRoot } from "react-dom/client"; // eslint-disable-next-line react-refresh/only-export-components export * from "./widgets"; +import "./i18n/i18n"; // old widget const widget = { @@ -19,7 +20,13 @@ const widget = { const root = createRoot(element); - root.render(); + root.render( + + ); }, }; diff --git a/vite.config.widget.ts b/vite.config.widget.ts index a5dddc6..007ba28 100644 --- a/vite.config.widget.ts +++ b/vite.config.widget.ts @@ -9,6 +9,8 @@ export default defineConfig({ alias, }, build: { + minify: false, // Отключает минификацию + sourcemap: true, // Включает sourcemaps для отладки copyPublicDir: false, rollupOptions: { input: "src/widget.tsx",