UNPKG

react-native-localize

Version:

A toolbox for your React Native app localization.

39 lines (38 loc) 1.49 kB
"use strict"; import NativeModule from "./specs/NativeRNLocalize"; import { getFindBestLanguageTag } from "./utils"; export const getCalendar = () => NativeModule.getCalendar(); export const getCountry = () => NativeModule.getCountry(); export const getCurrencies = () => NativeModule.getCurrencies(); export const getLocales = () => NativeModule.getLocales(); export const getNumberFormatSettings = () => NativeModule.getNumberFormatSettings(); export const getTemperatureUnit = () => NativeModule.getTemperatureUnit(); export const getTimeZone = () => NativeModule.getTimeZone(); export const uses24HourClock = () => NativeModule.uses24HourClock(); export const usesMetricSystem = () => NativeModule.usesMetricSystem(); export const usesAutoDateAndTime = () => NativeModule.usesAutoDateAndTime() ?? undefined; export const usesAutoTimeZone = () => NativeModule.usesAutoTimeZone() ?? undefined; export const findBestLanguageTag = getFindBestLanguageTag(getLocales()); export const openAppLanguageSettings = async () => { await NativeModule.openAppLanguageSettings(); }; export const ServerLanguagesProvider = ({ children }) => children; const api = { getCalendar, getCountry, getCurrencies, getLocales, getNumberFormatSettings, getTemperatureUnit, getTimeZone, uses24HourClock, usesMetricSystem, usesAutoDateAndTime, usesAutoTimeZone, findBestLanguageTag, openAppLanguageSettings }; export const useLocalize = () => api; //# sourceMappingURL=module.native.js.map