locale fix
This commit is contained in:
+2
-1
@@ -4,7 +4,8 @@ WORKDIR /lk-results/
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
RUN npm audit fix --force
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
RUN npm install -g serve
|
RUN npm install -g serve
|
||||||
|
|
||||||
|
|||||||
Generated
+694
-536
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -30,6 +30,7 @@
|
|||||||
"sort-by": "^0.0.2"
|
"sort-by": "^0.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^22.14.1",
|
||||||
"@types/react": "^18.2.55",
|
"@types/react": "^18.2.55",
|
||||||
"@types/react-dom": "^18.2.19",
|
"@types/react-dom": "^18.2.19",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||||
@@ -42,6 +43,6 @@
|
|||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
"tailwindcss": "^3.4.4",
|
"tailwindcss": "^3.4.4",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vite": "^5.1.0"
|
"vite": "^6.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const Footer = () => {
|
const Footer = () => {
|
||||||
const { t, i18n } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="flex flex-col items-center justify-center py-6 px-4 mt-10 border-t border-gray-800 bg-transparent">
|
<footer className="flex flex-col items-center justify-center py-6 px-4 mt-10 border-t border-gray-800 bg-transparent">
|
||||||
|
|||||||
@@ -128,9 +128,9 @@ export default () => {
|
|||||||
<div className="hidden lg:flex lg:items-center ml-auto">
|
<div className="hidden lg:flex lg:items-center ml-auto">
|
||||||
<button
|
<button
|
||||||
className="text-white hover:text-gold-accent transition-colors duration-200"
|
className="text-white hover:text-gold-accent transition-colors duration-200"
|
||||||
onClick={() => changeLanguage(i18n.language === "en-GB" ? "pt-PT" : "en-GB")}
|
onClick={() => changeLanguage(i18n.language === "en" ? "pt" : "en")}
|
||||||
>
|
>
|
||||||
{i18n.language === "en-GB" ? "PT" : "EN"}
|
{i18n.language === "en" ? "PT" : "EN"}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -168,9 +168,9 @@ export default () => {
|
|||||||
</ul>
|
</ul>
|
||||||
<button
|
<button
|
||||||
className="absolute bottom-10 right-10 text-white hover:text-gold-accent transition-colors duration-200"
|
className="absolute bottom-10 right-10 text-white hover:text-gold-accent transition-colors duration-200"
|
||||||
onClick={() => changeLanguage(i18n.language === "en-GB" ? "pt-PT" : "en-GB")}
|
onClick={() => changeLanguage(i18n.language === "en" ? "pt" : "en")}
|
||||||
>
|
>
|
||||||
{i18n.language === "en-GB" ? "PT" : "EN"}
|
{i18n.language === "en" ? "PT" : "EN"}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+12
-3
@@ -17,10 +17,19 @@ i18n
|
|||||||
defaultNS: 'common',
|
defaultNS: 'common',
|
||||||
backend: {
|
backend: {
|
||||||
// translation file path
|
// translation file path
|
||||||
loadPath: (lng : string,) => `/public/locales/common/${lng}.json`,
|
loadPath: (lngs: string[], namespaces: string[]) => {
|
||||||
|
// i18next-http-backend passes arrays for lngs and namespaces
|
||||||
|
const lng = lngs[0];
|
||||||
|
const ns = namespaces[0];
|
||||||
|
return `/locales/${ns}/${lng}.json`;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
debug: true,
|
// 'process.env.NODE_ENV' is replaced at build time by most bundlers (Vite, CRA, Webpack) to control debug mode.
|
||||||
fallbackLng: "en-GB",
|
// TypeScript may show a warning about 'process' not being defined. You can safely ignore this if using a modern React toolchain.
|
||||||
|
// To silence the error in your editor, install Node types: npm install --save-dev @types/node
|
||||||
|
debug: process.env.NODE_ENV !== "production",
|
||||||
|
fallbackLng: { default: ["en"] },
|
||||||
|
supportedLngs: ["en", "pt"],
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false, // not needed for react as it escapes by default
|
escapeValue: false, // not needed for react as it escapes by default
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user