You've already forked nginx-proxy-manager
mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-11-14 11:42:26 +03:00
28 lines
694 B
TypeScript
28 lines
694 B
TypeScript
// import * as de from "./de/index";
|
|
// import * as fa from "./fa/index";
|
|
import * as en from "./en/index";
|
|
import * as de from "./de/index";
|
|
|
|
const items: any = { en, de };
|
|
|
|
const fallbackLang = "en";
|
|
|
|
export const getHelpFile = (lang: string, section: string): string => {
|
|
if (
|
|
typeof items[lang] !== "undefined" &&
|
|
typeof items[lang][section] !== "undefined"
|
|
) {
|
|
return items[lang][section].default;
|
|
}
|
|
// Fallback to English
|
|
if (
|
|
typeof items[fallbackLang] !== "undefined" &&
|
|
typeof items[fallbackLang][section] !== "undefined"
|
|
) {
|
|
return items[fallbackLang][section].default;
|
|
}
|
|
throw new Error(`Cannot load help doc for ${lang}-${section}`);
|
|
};
|
|
|
|
export default items;
|