ts-jsdk
Version:
TypeScript implementation of the Java platform
27 lines • 755 B
JavaScript
export class Locale {
constructor(_language, _country, _variant) {
this._language = _language;
this._country = _country;
this._variant = _variant;
}
static getDefault() {
const localeStr = Intl.DateTimeFormat().resolvedOptions().locale;
let localItes = localeStr.split("-");
let vv = localItes[1].split("_");
return new Locale(localItes[0], vv[0], vv[1]);
}
getCountry() {
return this._country;
}
getLanguage() {
return this._language;
}
getVariant() {
return this._variant;
}
}
export const FRENCH = new Locale("fr", "FR");
export const FRANCE = "FR";
export const UK = "UK";
export const US = "US";
//# sourceMappingURL=Locale.js.map