feat: add norwegian

This commit is contained in:
LukeGus
2025-12-29 02:50:44 -06:00
parent dcbc9454ab
commit ccadcb87eb
3 changed files with 22 additions and 0 deletions

View File

@@ -344,6 +344,20 @@ jobs:
path: src/locales/el.json path: src/locales/el.json
continue-on-error: true continue-on-error: true
translate-nb:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npx i18n-auto-translation -k ${{ secrets.GOOGLE_TRANSLATE_API_KEY }} -d "src/locales" -f en -t nb
- uses: actions/upload-artifact@v4
with:
name: translations-nb
path: src/locales/nb.json
continue-on-error: true
create-pr: create-pr:
needs: needs:
[ [
@@ -371,6 +385,7 @@ jobs:
translate-cs, translate-cs,
translate-ro, translate-ro,
translate-el, translate-el,
translate-nb,
] ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -409,6 +424,7 @@ jobs:
cp translations-temp/translations-cs/cs.json src/locales/ 2>/dev/null || true cp translations-temp/translations-cs/cs.json src/locales/ 2>/dev/null || true
cp translations-temp/translations-ro/ro.json src/locales/ 2>/dev/null || true cp translations-temp/translations-ro/ro.json src/locales/ 2>/dev/null || true
cp translations-temp/translations-el/el.json src/locales/ 2>/dev/null || true cp translations-temp/translations-el/el.json src/locales/ 2>/dev/null || true
cp translations-temp/translations-nb/nb.json src/locales/ 2>/dev/null || true
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v6 uses: peter-evans/create-pull-request@v6

View File

@@ -27,6 +27,7 @@ import ukTranslation from "../locales/uk.json";
import csTranslation from "../locales/cs.json"; import csTranslation from "../locales/cs.json";
import roTranslation from "../locales/ro.json"; import roTranslation from "../locales/ro.json";
import elTranslation from "../locales/el.json"; import elTranslation from "../locales/el.json";
import nbTranslation from "../locales/nb.json";
i18n i18n
.use(LanguageDetector) .use(LanguageDetector)
@@ -58,6 +59,7 @@ i18n
"cs", "cs",
"ro", "ro",
"el", "el",
"nb",
], ],
fallbackLng: "en", fallbackLng: "en",
debug: false, debug: false,
@@ -146,6 +148,9 @@ i18n
el: { el: {
translation: elTranslation, translation: elTranslation,
}, },
nb: {
translation: nbTranslation,
},
}, },
interpolation: { interpolation: {

View File

@@ -39,6 +39,7 @@ const languages = [
{ code: "tr", name: "Turkish", nativeName: "Türkçe" }, { code: "tr", name: "Turkish", nativeName: "Türkçe" },
{ code: "uk", name: "Ukrainian", nativeName: "Українська" }, { code: "uk", name: "Ukrainian", nativeName: "Українська" },
{ code: "vi", name: "Vietnamese", nativeName: "Tiếng Việt" }, { code: "vi", name: "Vietnamese", nativeName: "Tiếng Việt" },
{ code: "nb", name: "Norwegian", nativeName: "Norsk" },
]; ];
export function LanguageSwitcher() { export function LanguageSwitcher() {