All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.prod.config.Language.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/config/Language.ts"],
  "sourcesContent": ["import {\n\tgetLanguage as getConfiguredLanguage,\n\tgetFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,\n} from \"../InitialConfiguration.js\";\nimport { fireLanguageChange } from \"../locale/languageChange.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\nimport { isBooted } from \"../Boot.js\";\n\nlet curLanguage: string | undefined;\nlet fetchDefaultLanguage: boolean;\n\n/**\n * Returns the currently configured language, or the browser language as a fallback.\n * @public\n * @returns {string}\n */\nconst getLanguage = (): string | undefined => {\n\tif (curLanguage === undefined) {\n\t\tcurLanguage = getConfiguredLanguage();\n\t}\n\treturn curLanguage;\n};\n\n/**\n * Changes the current language, re-fetches all message bundles, updates all language-aware components\n * and returns a promise that resolves when all rendering is done.\n *\n * @param {string} language\n * @public\n * @returns {Promise}\n */\nconst setLanguage = async (language: string): Promise => {\n\tif (curLanguage === language) {\n\t\treturn;\n\t}\n\n\tcurLanguage = language;\n\n\tif (isBooted()) {\n\t\tawait fireLanguageChange(language);\n\t\tawait reRenderAllUI5Elements({ languageAware: true });\n\t}\n};\n\n/**\n * Returns the default languague.\n *\n * Note: Default language might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultLanguage = (): string => {\n\treturn DEFAULT_LANGUAGE;\n};\n\n/**\n * Defines if the default language, that is inlined, should be\n * fetched over the network instead of using the inlined one.\n * **Note:** By default the language will not be fetched.\n *\n * @public\n * @param {boolean} fetchDefaultLang\n */\nconst setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {\n\tfetchDefaultLanguage = fetchDefaultLang;\n};\n\n/**\n * Returns if the default language, that is inlined, should be fetched over the network.\n * @public\n * @returns {boolean}\n */\nconst getFetchDefaultLanguage = (): boolean => {\n\tif (fetchDefaultLanguage === undefined) {\n\t\tsetFetchDefaultLanguage(getConfiguredFetchDefaultLanguage());\n\t}\n\n\treturn fetchDefaultLanguage;\n};\n\nexport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n};\n"],
  "mappings": "aAAA,OACC,eAAeA,EACf,2BAA2BC,MACrB,6BACP,OAAS,sBAAAC,MAA0B,8BACnC,OAAS,0BAAAC,MAA8B,eACvC,OAAS,oBAAAC,MAAwB,kCACjC,OAAS,YAAAC,MAAgB,aAEzB,IAAIC,EACAC,EAOJ,MAAMC,EAAc,KACfF,IAAgB,SACnBA,EAAcN,EAAsB,GAE9BM,GAWFG,EAAc,MAAOC,GAAoC,CAC1DJ,IAAgBI,IAIpBJ,EAAcI,EAEVL,EAAS,IACZ,MAAMH,EAAmBQ,CAAQ,EACjC,MAAMP,EAAuB,CAAE,cAAe,EAAK,CAAC,GAEtD,EAUMQ,EAAqB,IACnBP,EAWFQ,EAA2BC,GAA8B,CAC9DN,EAAuBM,CACxB,EAOMC,EAA0B,KAC3BP,IAAyB,QAC5BK,EAAwBX,EAAkC,CAAC,EAGrDM,GAGR,OACCC,KAAA,YACAC,KAAA,YACAE,KAAA,mBACAC,KAAA,wBACAE,KAAA",
  "names": ["getConfiguredLanguage", "getConfiguredFetchDefaultLanguage", "fireLanguageChange", "reRenderAllUI5Elements", "DEFAULT_LANGUAGE", "isBooted", "curLanguage", "fetchDefaultLanguage", "getLanguage", "setLanguage", "language", "getDefaultLanguage", "setFetchDefaultLanguage", "fetchDefaultLang", "getFetchDefaultLanguage"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy