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

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

{"version":3,"file":"Language.js","sourceRoot":"","sources":["../../src/config/Language.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,IAAI,qBAAqB,EACpC,uBAAuB,IAAI,iCAAiC,GAC5D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,IAAI,WAA+B,CAAC;AACpC,IAAI,oBAA6B,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,WAAW,KAAK,SAAS,EAAE;QAC9B,WAAW,GAAG,qBAAqB,EAAE,CAAC;KACtC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,QAAgB,EAAiB,EAAE;IAC7D,IAAI,WAAW,KAAK,QAAQ,EAAE;QAC7B,OAAO;KACP;IAED,WAAW,GAAG,QAAQ,CAAC;IAEvB,IAAI,QAAQ,EAAE,EAAE;QACf,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,sBAAsB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;KACtD;AACF,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,GAAW,EAAE;IACvC,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAG,CAAC,gBAAyB,EAAE,EAAE;IAC7D,oBAAoB,GAAG,gBAAgB,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,GAAY,EAAE;IAC7C,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACvC,uBAAuB,CAAC,iCAAiC,EAAE,CAAC,CAAC;KAC7D;IAED,OAAO,oBAAoB,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACvB,CAAC","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"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy