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

package.dist.prod.locale.nextFallbackLocale.js.map Maven / Gradle / Ivy

{
  "version": 3,
  "sources": ["../../../src/locale/nextFallbackLocale.ts"],
  "sourcesContent": ["import { DEFAULT_LOCALE } from \"../generated/AssetParameters.js\";\n\n/**\n * Calculates the next fallback locale for the given locale.\n *\n * @param {string} locale Locale string in Java format (underscores) or null\n * @returns {string} Next fallback Locale or \"en\" if no fallbacks found.\n */\nconst nextFallbackLocale = (locale: string) => {\n\tif (!locale) {\n\t\treturn DEFAULT_LOCALE;\n\t}\n\n\tif (locale === \"zh_HK\") {\n\t\treturn \"zh_TW\";\n\t}\n\n\t// if there are multiple segments (separated by underscores), remove the last one\n\tconst p = locale.lastIndexOf(\"_\");\n\tif (p >= 0) {\n\t\treturn locale.slice(0, p);\n\t}\n\n\t// for any language but the default, fallback to the default first before falling back to the 'raw' language (empty string)\n\treturn locale !== DEFAULT_LOCALE ? DEFAULT_LOCALE : \"\";\n};\n\nexport default nextFallbackLocale;\n"],
  "mappings": "aAAA,OAAS,kBAAAA,MAAsB,kCAQ/B,MAAMC,EAAsBC,GAAmB,CAC9C,GAAI,CAACA,EACJ,OAAOF,EAGR,GAAIE,IAAW,QACd,MAAO,QAIR,MAAMC,EAAID,EAAO,YAAY,GAAG,EAChC,OAAIC,GAAK,EACDD,EAAO,MAAM,EAAGC,CAAC,EAIlBD,IAAWF,EAAiBA,EAAiB,EACrD,EAEA,eAAeC",
  "names": ["DEFAULT_LOCALE", "nextFallbackLocale", "locale", "p"]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy