mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-13 13:55:14 +00:00
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user