Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.prod.locale.Locale.js.map Maven / Gradle / Ivy
{
"version": 3,
"sources": ["../../../src/locale/Locale.ts"],
"sourcesContent": ["import { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\n\nconst rLocale = /^((?:[A-Z]{2,3}(?:-[A-Z]{3}){0,3})|[A-Z]{4}|[A-Z]{5,8})(?:-([A-Z]{4}))?(?:-([A-Z]{2}|[0-9]{3}))?((?:-[0-9A-Z]{5,8}|-[0-9][0-9A-Z]{3})*)((?:-[0-9A-WYZ](?:-[0-9A-Z]{2,8})+)*)(?:-(X(?:-[0-9A-Z]{1,8})+))?$/i;\n\nclass Locale {\n\tsLocaleId: string;\n\tsLanguage: string;\n\tsScript: string;\n\tsRegion: string;\n\tsVariant: string | null;\n\tsExtension: string | null;\n\tsPrivateUse: string | null;\n\n\tconstructor(sLocaleId: string) {\n\t\tconst aResult = rLocale.exec(sLocaleId.replace(/_/g, \"-\"));\n\t\tif (aResult === null) {\n\t\t\tthrow new Error(`The given language ${sLocaleId} does not adhere to BCP-47.`);\n\t\t}\n\t\tthis.sLocaleId = sLocaleId;\n\t\tthis.sLanguage = aResult[1] || DEFAULT_LANGUAGE;\n\t\tthis.sScript = aResult[2] || \"\";\n\t\tthis.sRegion = aResult[3] || \"\";\n\t\tthis.sVariant = (aResult[4] && aResult[4].slice(1)) || null;\n\t\tthis.sExtension = (aResult[5] && aResult[5].slice(1)) || null;\n\t\tthis.sPrivateUse = aResult[6] || null;\n\t\tif (this.sLanguage) {\n\t\t\tthis.sLanguage = this.sLanguage.toLowerCase();\n\t\t}\n\t\tif (this.sScript) {\n\t\t\tthis.sScript = this.sScript.toLowerCase().replace(/^[a-z]/, s => {\n\t\t\t\treturn s.toUpperCase();\n\t\t\t});\n\t\t}\n\t\tif (this.sRegion) {\n\t\t\tthis.sRegion = this.sRegion.toUpperCase();\n\t\t}\n\t}\n\n\tgetLanguage() {\n\t\treturn this.sLanguage;\n\t}\n\n\tgetScript() {\n\t\treturn this.sScript;\n\t}\n\n\tgetRegion() {\n\t\treturn this.sRegion;\n\t}\n\n\tgetVariant() {\n\t\treturn this.sVariant;\n\t}\n\n\tgetVariantSubtags() {\n\t\treturn this.sVariant ? this.sVariant.split(\"-\") : [];\n\t}\n\n\tgetExtension() {\n\t\treturn this.sExtension;\n\t}\n\n\tgetExtensionSubtags() {\n\t\treturn this.sExtension ? this.sExtension.slice(2).split(\"-\") : [];\n\t}\n\n\tgetPrivateUse() {\n\t\treturn this.sPrivateUse;\n\t}\n\n\tgetPrivateUseSubtags() {\n\t\treturn this.sPrivateUse ? this.sPrivateUse.slice(2).split(\"-\") : [];\n\t}\n\n\thasPrivateUseSubtag(sSubtag: string) {\n\t\treturn this.getPrivateUseSubtags().indexOf(sSubtag) >= 0;\n\t}\n\n\ttoString() {\n\t\tconst r = [this.sLanguage];\n\n\t\tif (this.sScript) {\n\t\t\tr.push(this.sScript);\n\t\t}\n\t\tif (this.sRegion) {\n\t\t\tr.push(this.sRegion);\n\t\t}\n\t\tif (this.sVariant) {\n\t\t\tr.push(this.sVariant);\n\t\t}\n\t\tif (this.sExtension) {\n\t\t\tr.push(this.sExtension);\n\t\t}\n\t\tif (this.sPrivateUse) {\n\t\t\tr.push(this.sPrivateUse);\n\t\t}\n\t\treturn r.join(\"-\");\n\t}\n}\n\nexport default Locale;\n"],
"mappings": "aAAA,OAAS,oBAAAA,MAAwB,kCAEjC,MAAMC,EAAU,6MAEhB,MAAMC,CAAO,CASZ,YAAYC,EAAmB,CAC9B,MAAMC,EAAUH,EAAQ,KAAKE,EAAU,QAAQ,KAAM,GAAG,CAAC,EACzD,GAAIC,IAAY,KACf,MAAM,IAAI,MAAM,sBAAsBD,CAAS,6BAA6B,EAE7E,KAAK,UAAYA,EACjB,KAAK,UAAYC,EAAQ,CAAC,GAAKJ,EAC/B,KAAK,QAAUI,E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