Add files via upload

Add German
This commit is contained in:
Frank
2025-11-03 14:18:08 +01:00
committed by GitHub
parent ef5156b613
commit e2a8ffa2d3
13 changed files with 957 additions and 5 deletions

View File

@@ -1,15 +1,21 @@
import { createIntl, createIntlCache } from "react-intl";
import langEn from "./lang/en.json";
import langDe from "./lang/de.json";
import langList from "./lang/lang-list.json";
// first item of each array should be the language code,
// not the country code
// Remember when adding to this list, also update check-locales.js script
const localeOptions = [["en", "en-US"]];
const localeOptions = [
["en", "en-US"],
["de", "de-DE"],
];
const loadMessages = (locale?: string): typeof langList & typeof langEn => {
const thisLocale = locale || "en";
switch (thisLocale.slice(0, 2)) {
case "de":
return Object.assign({}, langList, langEn, langDe);
default:
return Object.assign({}, langList, langEn);
}
@@ -17,6 +23,9 @@ const loadMessages = (locale?: string): typeof langList & typeof langEn => {
const getFlagCodeForLocale = (locale?: string) => {
switch (locale) {
case "de-DE":
case "de":
return "DE";
default:
return "EN";
}