@maptimy/platform-formatters
Version:
Formatters for different plaforms e.g. Web, React Native and Android
20 lines • 718 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocale = getLocale;
const react_native_1 = require("react-native");
function getLocale() {
let currentLocale = "en";
if (react_native_1.Platform.OS === "ios") {
const settings = react_native_1.Settings.get("AppleLocale");
const locale = settings || (settings === null || settings === void 0 ? void 0 : settings[0]);
if (locale)
currentLocale = locale;
}
else {
const locale = react_native_1.I18nManager.getConstants().localeIdentifier;
if (locale)
currentLocale = locale;
}
return currentLocale;
}
//# sourceMappingURL=getLocale.native.js.map