locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
20 lines (19 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.i18n_loc_get_default = i18n_loc_get_default;
const _phpRuntimeState_ts_1 = require("../_helpers/_phpRuntimeState.js");
function i18n_loc_get_default() {
// discuss at: https://locutus.io/php/i18n_loc_get_default/
// original by: Brett Zamir (https://brett-zamir.me)
// note 1: Renamed in PHP6 from locale_get_default(). Not listed yet at php.net.
// note 1: List of locales at <https://demo.icu-project.org/icu-bin/locexp>
// note 1: To be usable with sort() if it is passed the `SORT_LOCALE_STRING`
// note 1: sorting flag: https://php.net/manual/en/function.sort.php
// example 1: i18n_loc_get_default()
// returns 1: 'en_US_POSIX'
// example 2: i18n_loc_set_default('pt_PT')
// example 2: i18n_loc_get_default()
// returns 2: 'pt_PT'
const runtime = (0, _phpRuntimeState_ts_1.ensurePhpRuntimeState)();
return runtime.locale_default ?? 'en_US_POSIX';
}