diff --git a/components/Admin/settings.js b/components/Admin/settings.js index 32add1a..10c0ca3 100644 --- a/components/Admin/settings.js +++ b/components/Admin/settings.js @@ -3,146 +3,151 @@ import "i18n/i18n"; import "tailwindcss/tailwind.css"; function debounce(callback, wait = 400) { - let timeout; - return (...args) => { - clearTimeout(timeout); - timeout = setTimeout(function () { - callback.apply(this, args); - }, wait); - }; + let timeout; + return (...args) => { + clearTimeout(timeout); + timeout = setTimeout(function () { + callback.apply(this, args); + }, wait); + }; } export function ThemeSwitcher(props) { - const availableThemes = { - default: { - bgcolor: "white", - fgcolor: "text-black", - title: "default", - }, - darkTheme: { - bgcolor: "#18181B", - fgcolor: "text-white", - title: "dark theme", - }, - slate: { - bgcolor: "#18181B", - fgcolor: "text-white", - title: "slate", - }, - educational: { - bgcolor: "#fffbf0", - fgcolor: "text-black", - title: "educational", - }, - }; - return ( -
- - -
- ); + const availableThemes = { + default: { + bgcolor: "white", + fgcolor: "text-black", + title: "default", + }, + darkTheme: { + bgcolor: "#18181B", + fgcolor: "text-white", + title: "dark theme", + }, + slate: { + bgcolor: "#18181B", + fgcolor: "text-white", + title: "slate", + }, + educational: { + bgcolor: "#fffbf0", + fgcolor: "text-black", + title: "educational", + }, + red: { + bgcolor: "#7B2C35", + fgcolor: "text-white", + title: "red", + }, + }; + return ( +
+ + +
+ ); } function FinalRoundTitleChanger(props) { - const { i18n, t } = useTranslation(); - return ( -
-

{t("Final Round Title")}:

- { - props.game.settings.final_round_title = e.target.value; - props.setGame((prv) => ({ ...prv })); - props.send({ action: "data", data: props.game }); - })} - defaultValue={props.game.settings.final_round_title} - placeholder={t("fast money")} - > -
- ); + const { i18n, t } = useTranslation(); + return ( +
+

{t("Final Round Title")}:

+ { + props.game.settings.final_round_title = e.target.value; + props.setGame((prv) => ({ ...prv })); + props.send({ action: "data", data: props.game }); + })} + defaultValue={props.game.settings.final_round_title} + placeholder={t("fast money")} + > +
+ ); } export default function AdminSettings(props) { - let game = props.game; - const { i18n, t } = useTranslation(); + let game = props.game; + const { i18n, t } = useTranslation(); + + function HideGameQuestions(props) { + return ( +
+
+
+

+ {t("Hide questions")}: +

+
+ { + game.settings.hide_questions = e.target.checked; + props.setGame((prv) => ({ ...prv })); + props.send({ action: "data", data: game }); + }} + type="checkbox" + > +
+
+

+ {t("hide questions on the game window and player buzzer screens")} +

+
+
+ ); + } - function HideGameQuestions(props) { return ( -
-
-
-

- {t("Hide questions")}: -

-
- { - game.settings.hide_questions = e.target.checked; - props.setGame((prv) => ({ ...prv })); - props.send({ action: "data", data: game }); - }} - type="checkbox" - > -
-
-

- {t("hide questions on the game window and player buzzer screens")} -

-
-
+ <> +
+ + + +
+ ); - } - - return ( - <> -
- - - -
- - ); } diff --git a/i18n/i18n.js b/i18n/i18n.js index be3c5b5..84416d2 100644 --- a/i18n/i18n.js +++ b/i18n/i18n.js @@ -6,32 +6,36 @@ import translationEN from "public/locales/en/translation.json"; import translationES from "public/locales/es/translation.json"; import translationID from "public/locales/id/translation.json"; import translationET from "public/locales/et/translation.json"; +import translationFR from "public/locales/fr/translation.json"; const resources = { - en: { - translation: translationEN, - }, - es: { - translation: translationES, - }, - id: { - translation: translationID, - }, - et: { - translation: translationET, - }, -}; -i18n - .use(LanguageDetector) - .use(initReactI18next) - .init({ - resources, - react: { - useSuspense: false, + en: { + translation: translationEN, + }, + es: { + translation: translationES, + }, + id: { + translation: translationID, }, - fallbackLng: "en", - interpolation: { - format, + et: { + translation: translationET, }, - whitelist: ["es", "en", "id", "et"], - }); + fr: { + translation: translationFR, + }, +}; +i18n + .use(LanguageDetector) + .use(initReactI18next) + .init({ + resources, + react: { + useSuspense: false, + }, + fallbackLng: "en", + interpolation: { + format, + }, + whitelist: ["es", "en", "id", "et", "fr"], + }); diff --git a/i18n/i18next-scanner.config.js b/i18n/i18next-scanner.config.js index e4d29dc..b1e96c0 100644 --- a/i18n/i18next-scanner.config.js +++ b/i18n/i18next-scanner.config.js @@ -14,7 +14,7 @@ module.exports = { }, trans: false, plural: false, - lngs: ["en", "es", "et", "id"], + lngs: ["en", "es", "et", "id","fr"], ns: ["translation"], defaultNs: "translation", defaultValue: "__STRING_NOT_TRANSLATED__",