feat: add 10 new langs
This commit is contained in:
152
.github/workflows/translate.yml
vendored
152
.github/workflows/translate.yml
vendored
@@ -204,8 +204,148 @@ jobs:
|
|||||||
path: src/locales/he.json
|
path: src/locales/he.json
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-ar:
|
||||||
|
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 ar
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-ar
|
||||||
|
path: src/locales/ar.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-pl:
|
||||||
|
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 pl
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-pl
|
||||||
|
path: src/locales/pl.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-nl:
|
||||||
|
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 nl
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-nl
|
||||||
|
path: src/locales/nl.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-sv:
|
||||||
|
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 sv
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-sv
|
||||||
|
path: src/locales/sv.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-id:
|
||||||
|
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 id
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-id
|
||||||
|
path: src/locales/id.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-th:
|
||||||
|
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 th
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-th
|
||||||
|
path: src/locales/th.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-uk:
|
||||||
|
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 uk
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-uk
|
||||||
|
path: src/locales/uk.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-cs:
|
||||||
|
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 cs
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-cs
|
||||||
|
path: src/locales/cs.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-ro:
|
||||||
|
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 ro
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-ro
|
||||||
|
path: src/locales/ro.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
translate-el:
|
||||||
|
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 el
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: translations-el
|
||||||
|
path: src/locales/el.json
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
create-pr:
|
create-pr:
|
||||||
needs: [translate-zh, translate-ru, translate-pt, translate-fr, translate-es, translate-de, translate-hi, translate-bn, translate-ja, translate-vi, translate-tr, translate-ko, translate-it, translate-he]
|
needs: [translate-zh, translate-ru, translate-pt, translate-fr, translate-es, translate-de, translate-hi, translate-bn, translate-ja, translate-vi, translate-tr, translate-ko, translate-it, translate-he, translate-ar, translate-pl, translate-nl, translate-sv, translate-id, translate-th, translate-uk, translate-cs, translate-ro, translate-el]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -233,6 +373,16 @@ jobs:
|
|||||||
cp translations-temp/translations-ko/ko.json src/locales/ 2>/dev/null || true
|
cp translations-temp/translations-ko/ko.json src/locales/ 2>/dev/null || true
|
||||||
cp translations-temp/translations-it/it.json src/locales/ 2>/dev/null || true
|
cp translations-temp/translations-it/it.json src/locales/ 2>/dev/null || true
|
||||||
cp translations-temp/translations-he/he.json src/locales/ 2>/dev/null || true
|
cp translations-temp/translations-he/he.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-ar/ar.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-pl/pl.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-nl/nl.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-sv/sv.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-id/id.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-th/th.json src/locales/ 2>/dev/null || true
|
||||||
|
cp translations-temp/translations-uk/uk.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-el/el.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
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ import jaTranslation from "../locales/ja.json";
|
|||||||
import viTranslation from "../locales/vi.json";
|
import viTranslation from "../locales/vi.json";
|
||||||
import trTranslation from "../locales/tr.json";
|
import trTranslation from "../locales/tr.json";
|
||||||
import heTranslation from "../locales/he.json";
|
import heTranslation from "../locales/he.json";
|
||||||
|
import arTranslation from "../locales/ar.json";
|
||||||
|
import plTranslation from "../locales/pl.json";
|
||||||
|
import nlTranslation from "../locales/nl.json";
|
||||||
|
import svTranslation from "../locales/sv.json";
|
||||||
|
import idTranslation from "../locales/id.json";
|
||||||
|
import thTranslation from "../locales/th.json";
|
||||||
|
import ukTranslation from "../locales/uk.json";
|
||||||
|
import csTranslation from "../locales/cs.json";
|
||||||
|
import roTranslation from "../locales/ro.json";
|
||||||
|
import elTranslation from "../locales/el.json";
|
||||||
|
|
||||||
i18n
|
i18n
|
||||||
.use(LanguageDetector)
|
.use(LanguageDetector)
|
||||||
@@ -38,6 +48,16 @@ i18n
|
|||||||
"vi",
|
"vi",
|
||||||
"tr",
|
"tr",
|
||||||
"he",
|
"he",
|
||||||
|
"ar",
|
||||||
|
"pl",
|
||||||
|
"nl",
|
||||||
|
"sv",
|
||||||
|
"id",
|
||||||
|
"th",
|
||||||
|
"uk",
|
||||||
|
"cs",
|
||||||
|
"ro",
|
||||||
|
"el",
|
||||||
],
|
],
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
debug: false,
|
debug: false,
|
||||||
@@ -96,6 +116,36 @@ i18n
|
|||||||
he: {
|
he: {
|
||||||
translation: heTranslation,
|
translation: heTranslation,
|
||||||
},
|
},
|
||||||
|
ar: {
|
||||||
|
translation: arTranslation,
|
||||||
|
},
|
||||||
|
pl: {
|
||||||
|
translation: plTranslation,
|
||||||
|
},
|
||||||
|
nl: {
|
||||||
|
translation: nlTranslation,
|
||||||
|
},
|
||||||
|
sv: {
|
||||||
|
translation: svTranslation,
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
translation: idTranslation,
|
||||||
|
},
|
||||||
|
th: {
|
||||||
|
translation: thTranslation,
|
||||||
|
},
|
||||||
|
uk: {
|
||||||
|
translation: ukTranslation,
|
||||||
|
},
|
||||||
|
cs: {
|
||||||
|
translation: csTranslation,
|
||||||
|
},
|
||||||
|
ro: {
|
||||||
|
translation: roTranslation,
|
||||||
|
},
|
||||||
|
el: {
|
||||||
|
translation: elTranslation,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
interpolation: {
|
interpolation: {
|
||||||
|
|||||||
@@ -11,24 +11,34 @@ import { Globe } from "lucide-react";
|
|||||||
|
|
||||||
const languages = [
|
const languages = [
|
||||||
{ code: "en", name: "English", nativeName: "English" },
|
{ code: "en", name: "English", nativeName: "English" },
|
||||||
|
{ code: "ar", name: "Arabic", nativeName: "العربية" },
|
||||||
|
{ code: "bn", name: "Bengali", nativeName: "বাংলা" },
|
||||||
{ code: "zh", name: "Chinese", nativeName: "中文" },
|
{ code: "zh", name: "Chinese", nativeName: "中文" },
|
||||||
|
{ code: "cs", name: "Czech", nativeName: "Čeština" },
|
||||||
|
{ code: "nl", name: "Dutch", nativeName: "Nederlands" },
|
||||||
|
{ code: "fr", name: "French", nativeName: "Français" },
|
||||||
{ code: "de", name: "German", nativeName: "Deutsch" },
|
{ code: "de", name: "German", nativeName: "Deutsch" },
|
||||||
|
{ code: "el", name: "Greek", nativeName: "Ελληνικά" },
|
||||||
|
{ code: "he", name: "Hebrew", nativeName: "עברית" },
|
||||||
|
{ code: "hi", name: "Hindi", nativeName: "हिन्दी" },
|
||||||
|
{ code: "id", name: "Indonesian", nativeName: "Bahasa Indonesia" },
|
||||||
|
{ code: "it", name: "Italian", nativeName: "Italiano" },
|
||||||
|
{ code: "ja", name: "Japanese", nativeName: "日本語" },
|
||||||
|
{ code: "ko", name: "Korean", nativeName: "한국어" },
|
||||||
|
{ code: "pl", name: "Polish", nativeName: "Polski" },
|
||||||
{
|
{
|
||||||
code: "pt",
|
code: "pt",
|
||||||
name: "Portuguese",
|
name: "Portuguese",
|
||||||
nativeName: "Português",
|
nativeName: "Português",
|
||||||
},
|
},
|
||||||
|
{ code: "ro", name: "Romanian", nativeName: "Română" },
|
||||||
{ code: "ru", name: "Russian", nativeName: "Русский" },
|
{ code: "ru", name: "Russian", nativeName: "Русский" },
|
||||||
{ code: "fr", name: "French", nativeName: "Français" },
|
|
||||||
{ code: "it", name: "Italian", nativeName: "Italiano" },
|
|
||||||
{ code: "ko", name: "Korean", nativeName: "한국어" },
|
|
||||||
{ code: "es", name: "Spanish", nativeName: "Español" },
|
{ code: "es", name: "Spanish", nativeName: "Español" },
|
||||||
{ code: "hi", name: "Hindi", nativeName: "हिन्दी" },
|
{ code: "sv", name: "Swedish", nativeName: "Svenska" },
|
||||||
{ code: "bn", name: "Bengali", nativeName: "বাংলা" },
|
{ code: "th", name: "Thai", nativeName: "ไทย" },
|
||||||
{ code: "ja", name: "Japanese", nativeName: "日本語" },
|
|
||||||
{ code: "vi", name: "Vietnamese", nativeName: "Tiếng Việt" },
|
|
||||||
{ code: "tr", name: "Turkish", nativeName: "Türkçe" },
|
{ code: "tr", name: "Turkish", nativeName: "Türkçe" },
|
||||||
{ code: "he", name: "Hebrew", nativeName: "עברית" },
|
{ code: "uk", name: "Ukrainian", nativeName: "Українська" },
|
||||||
|
{ code: "vi", name: "Vietnamese", nativeName: "Tiếng Việt" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function LanguageSwitcher() {
|
export function LanguageSwitcher() {
|
||||||
|
|||||||
Reference in New Issue
Block a user