@amazon-devices/expo-localization 2.0.1758683737

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.eslintrc.js +2 -0
  2. package/CHANGELOG.md +198 -0
  3. package/CMakeLists.txt +50 -0
  4. package/LICENSE +7 -0
  5. package/README.kepler.md +109 -0
  6. package/README.md +41 -0
  7. package/THIRD_PARTY_NOTICES.txt +24 -0
  8. package/android/build.gradle +109 -0
  9. package/android/src/main/AndroidManifest.xml +3 -0
  10. package/android/src/main/java/expo/modules/localization/LocalizationModule.kt +207 -0
  11. package/android/src/main/java/expo/modules/localization/LocalizationPackage.kt +35 -0
  12. package/android/src/main/java/expo/modules/localization/LocalizationUtils.kt +49 -0
  13. package/android/src/main/res/values/strings.xml +4 -0
  14. package/app.plugin.js +1 -0
  15. package/build/ExpoLocalization.d.ts +22 -0
  16. package/build/ExpoLocalization.d.ts.map +1 -0
  17. package/build/ExpoLocalization.js +166 -0
  18. package/build/ExpoLocalization.js.map +1 -0
  19. package/build/ExpoLocalization.kepler.d.ts +12 -0
  20. package/build/ExpoLocalization.kepler.d.ts.map +1 -0
  21. package/build/ExpoLocalization.kepler.js +26 -0
  22. package/build/ExpoLocalization.kepler.js.map +1 -0
  23. package/build/ExpoLocalization.native.d.ts +7 -0
  24. package/build/ExpoLocalization.native.d.ts.map +1 -0
  25. package/build/ExpoLocalization.native.js +14 -0
  26. package/build/ExpoLocalization.native.js.map +1 -0
  27. package/build/Localization.d.ts +163 -0
  28. package/build/Localization.d.ts.map +1 -0
  29. package/build/Localization.js +197 -0
  30. package/build/Localization.js.map +1 -0
  31. package/build/Localization.types.d.ts +202 -0
  32. package/build/Localization.types.d.ts.map +1 -0
  33. package/build/Localization.types.js +59 -0
  34. package/build/Localization.types.js.map +1 -0
  35. package/expo-module.config.json +10 -0
  36. package/ios/ExpoLocalization.podspec +32 -0
  37. package/ios/LocalizationModule.swift +212 -0
  38. package/kepler/ExpoLocalization.cpp +128 -0
  39. package/kepler/ExpoLocalization.h +22 -0
  40. package/kepler/KeplerInit.cpp +26 -0
  41. package/kepler/test/ExpoLocalization.cpp +78 -0
  42. package/package.json +1 -0
  43. package/plugin/build/withExpoLocalization.d.ts +7 -0
  44. package/plugin/build/withExpoLocalization.js +46 -0
  45. package/plugin/src/withExpoLocalization.ts +62 -0
  46. package/plugin/tsconfig.json +9 -0
  47. package/plugin/tsconfig.tsbuildinfo +1 -0
  48. package/react-native.config.js +21 -0
  49. package/src/ExpoLocalization.kepler.ts +40 -0
  50. package/src/ExpoLocalization.native.ts +18 -0
  51. package/src/ExpoLocalization.ts +203 -0
  52. package/src/Localization.ts +217 -0
  53. package/src/Localization.types.ts +207 -0
  54. package/tsconfig.json +9 -0
@@ -0,0 +1,163 @@
1
+ import { Localization } from './Localization.types';
2
+ export * from './Localization.types';
3
+ /**
4
+ * @deprecated Use Localization.getLocales() instead.
5
+ * Three-character ISO 4217 currency code. Returns `null` on web.
6
+ *
7
+ * @example `'USD'`, `'EUR'`, `'CNY'`, `null`
8
+ */
9
+ export declare const currency: string | null;
10
+ /**
11
+ * @deprecated Use Localization.getLocales() instead.
12
+ * Decimal separator used for formatting numbers.
13
+ *
14
+ * @example `','`, `'.'`
15
+ */
16
+ export declare const decimalSeparator: string;
17
+ /**
18
+ * @deprecated Use Localization.getLocales() instead.
19
+ * Digit grouping separator used when formatting numbers larger than 1000.
20
+ *
21
+ * @example `'.'`, `''`, `','`
22
+ */
23
+ export declare const digitGroupingSeparator: string;
24
+ /**
25
+ * @deprecated Use Localization.getLocales() instead.
26
+ * A list of all the supported language ISO codes.
27
+ */
28
+ export declare const isoCurrencyCodes: string[];
29
+ /**
30
+ * @deprecated Use Localization.getLocales() instead.
31
+ * Boolean value that indicates whether the system uses the metric system.
32
+ * On Android and web, this is inferred from the current region.
33
+ */
34
+ export declare const isMetric: boolean;
35
+ /**
36
+ * @deprecated Use Localization.getLocales() instead.
37
+ * Returns if the system's language is written from Right-to-Left.
38
+ * This can be used to build features like [bidirectional icons](https://material.io/design/usability/bidirectionality.html).
39
+ *
40
+ * Returns `false` in Server Side Rendering (SSR) environments.
41
+ */
42
+ export declare const isRTL: boolean;
43
+ /**
44
+ * Consider using Localization.getLocales() for a list of user preferred locales instead.
45
+ * An [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag),
46
+ * consisting of a two-character language code and optional script, region and variant codes.
47
+ *
48
+ * @example `'en'`, `'en-US'`, `'zh-Hans'`, `'zh-Hans-CN'`, `'en-emodeng'`
49
+ */
50
+ export declare const locale: string;
51
+ /**
52
+ * @deprecated Use Localization.getLocales() instead.
53
+ * List of all the native languages provided by the user settings.
54
+ * These are returned in the order the user defines in their device settings.
55
+ *
56
+ * @example `['en', 'en-US', 'zh-Hans', 'zh-Hans-CN', 'en-emodeng']`
57
+ */
58
+ export declare const locales: string[];
59
+ /**
60
+ * @deprecated Use Localization.getCalendars() instead.
61
+ * The current time zone in display format.
62
+ * On Web time zone is calculated with Intl.DateTimeFormat().resolvedOptions().timeZone. For a
63
+ * better estimation you could use the moment-timezone package but it will add significant bloat to
64
+ * your website's bundle size.
65
+ *
66
+ * @example `'America/Los_Angeles'`
67
+ */
68
+ export declare const timezone: string;
69
+ /**
70
+ * @deprecated Use Localization.getLocales() instead.
71
+ * The region code for your device that comes from the Region setting under Language & Region on iOS.
72
+ * This value is always available on iOS, but might return `null` on Android or web.
73
+ *
74
+ * @example `'US'`, `'NZ'`, `null`
75
+ */
76
+ export declare const region: string | null;
77
+ /**
78
+ * List of user's locales, returned as an array of objects of type `Locale`.
79
+ * Guaranteed to contain at least 1 element.
80
+ * These are returned in the order the user defines in their device settings.
81
+ * On the web currency and measurements systems are not provided, instead returned as null.
82
+ * If needed, you can infer them from the current region using a lookup table.
83
+ * @example `[{
84
+ "languageTag": "pl-PL",
85
+ "languageCode": "pl",
86
+ "textDirection": "ltr",
87
+ "digitGroupingSeparator": " ",
88
+ "decimalSeparator": ",",
89
+ "measurementSystem": "metric",
90
+ "currencyCode": "PLN",
91
+ "currencySymbol": "zł",
92
+ "regionCode": "PL",
93
+ "temperatureUnit": "celsius"
94
+ }]`
95
+ */
96
+ export declare const getLocales: () => import("./Localization.types").Locale[];
97
+ /**
98
+ * List of user's preferred calendars, returned as an array of objects of type `Calendar`.
99
+ * Guaranteed to contain at least 1 element.
100
+ * For now always returns a single element, but it's likely to return a user preference list on some platforms in the future.
101
+ * @example `[
102
+ {
103
+ "calendar": "gregory",
104
+ "timeZone": "Europe/Warsaw",
105
+ "uses24hourClock": true,
106
+ "firstWeekday": 1
107
+ }
108
+ ]`
109
+ */
110
+ export declare const getCalendars: () => import("./Localization.types").Calendar[];
111
+ /**
112
+ * A hook providing a list of user's locales, returned as an array of objects of type `Locale`.
113
+ * Guaranteed to contain at least 1 element.
114
+ * These are returned in the order the user defines in their device settings.
115
+ * On the web currency and measurements systems are not provided, instead returned as null.
116
+ * If needed, you can infer them from the current region using a lookup table.
117
+ * If the OS settings change, the hook will rerender with a new list of locales.
118
+ * @example `[{
119
+ "languageTag": "pl-PL",
120
+ "languageCode": "pl",
121
+ "textDirection": "ltr",
122
+ "digitGroupingSeparator": " ",
123
+ "decimalSeparator": ",",
124
+ "measurementSystem": "metric",
125
+ "currencyCode": "PLN",
126
+ "currencySymbol": "zł",
127
+ "regionCode": "PL",
128
+ "temperatureUnit": "celsius"
129
+ }]`
130
+ */
131
+ export declare function useLocales(): import("./Localization.types").Locale[];
132
+ /**
133
+ * A hook providing a list of user's preferred calendars, returned as an array of objects of type `Calendar`.
134
+ * Guaranteed to contain at least 1 element.
135
+ * For now always returns a single element, but it's likely to return a user preference list on some platforms in the future.
136
+ * If the OS settings change, the hook will rerender with a new list of calendars.
137
+ * @example `[
138
+ {
139
+ "calendar": "gregory",
140
+ "timeZone": "Europe/Warsaw",
141
+ "uses24hourClock": true,
142
+ "firstWeekday": 1
143
+ }
144
+ ]`
145
+ */
146
+ export declare function useCalendars(): import("./Localization.types").Calendar[];
147
+ /**
148
+ * Get the latest native values from the device. Locale can be changed on some Android devices
149
+ * without resetting the app.
150
+ * > On iOS, changing the locale will cause the device to reset meaning the constants will always be
151
+ * correct.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * // When the app returns from the background on Android...
156
+ *
157
+ * const { locale } = await Localization.getLocalizationAsync();
158
+ * ```
159
+ * @deprecated
160
+ * Use Localization.getLocales() or Localization.getCalendars() instead.
161
+ */
162
+ export declare function getLocalizationAsync(): Promise<Localization>;
163
+ //# sourceMappingURL=Localization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Localization.d.ts","sourceRoot":"","sources":["../src/Localization.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,cAAc,sBAAsB,CAAC;AAGrC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,eAA4B,CAAC;AAGlD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,QAAoC,CAAC;AAGlE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,QAA0C,CAAC;AAG9E;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAoC,CAAC;AAGlE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAA4B,CAAC;AAGlD;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,SAAyB,CAAC;AAG5C;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,QAA0B,CAAC;AAG9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,UAA2B,CAAC;AAGhD;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,QAA4B,CAAC;AAGlD;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,eAA0B,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,UAAU,+CAA8B,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY,iDAAgC,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,4CAUzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,8CAU3B;AAGD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,YAAY,CAAC,CAElE"}
@@ -0,0 +1,197 @@
1
+ import { useEffect, useReducer, useMemo } from 'react';
2
+ import ExpoLocalization, { addCalendarListener, addLocaleListener, removeSubscription, } from './ExpoLocalization';
3
+ export * from './Localization.types';
4
+ // @needsAudit
5
+ /**
6
+ * @deprecated Use Localization.getLocales() instead.
7
+ * Three-character ISO 4217 currency code. Returns `null` on web.
8
+ *
9
+ * @example `'USD'`, `'EUR'`, `'CNY'`, `null`
10
+ */
11
+ export const currency = ExpoLocalization.currency;
12
+ // @needsAudit
13
+ /**
14
+ * @deprecated Use Localization.getLocales() instead.
15
+ * Decimal separator used for formatting numbers.
16
+ *
17
+ * @example `','`, `'.'`
18
+ */
19
+ export const decimalSeparator = ExpoLocalization.decimalSeparator;
20
+ // @needsAudit
21
+ /**
22
+ * @deprecated Use Localization.getLocales() instead.
23
+ * Digit grouping separator used when formatting numbers larger than 1000.
24
+ *
25
+ * @example `'.'`, `''`, `','`
26
+ */
27
+ export const digitGroupingSeparator = ExpoLocalization.digitGroupingSeparator;
28
+ // @needsAudit
29
+ /**
30
+ * @deprecated Use Localization.getLocales() instead.
31
+ * A list of all the supported language ISO codes.
32
+ */
33
+ export const isoCurrencyCodes = ExpoLocalization.isoCurrencyCodes;
34
+ // @needsAudit
35
+ /**
36
+ * @deprecated Use Localization.getLocales() instead.
37
+ * Boolean value that indicates whether the system uses the metric system.
38
+ * On Android and web, this is inferred from the current region.
39
+ */
40
+ export const isMetric = ExpoLocalization.isMetric;
41
+ // @needsAudit
42
+ /**
43
+ * @deprecated Use Localization.getLocales() instead.
44
+ * Returns if the system's language is written from Right-to-Left.
45
+ * This can be used to build features like [bidirectional icons](https://material.io/design/usability/bidirectionality.html).
46
+ *
47
+ * Returns `false` in Server Side Rendering (SSR) environments.
48
+ */
49
+ export const isRTL = ExpoLocalization.isRTL;
50
+ // @needsAudit
51
+ /**
52
+ * Consider using Localization.getLocales() for a list of user preferred locales instead.
53
+ * An [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag),
54
+ * consisting of a two-character language code and optional script, region and variant codes.
55
+ *
56
+ * @example `'en'`, `'en-US'`, `'zh-Hans'`, `'zh-Hans-CN'`, `'en-emodeng'`
57
+ */
58
+ export const locale = ExpoLocalization.locale;
59
+ // @needsAudit
60
+ /**
61
+ * @deprecated Use Localization.getLocales() instead.
62
+ * List of all the native languages provided by the user settings.
63
+ * These are returned in the order the user defines in their device settings.
64
+ *
65
+ * @example `['en', 'en-US', 'zh-Hans', 'zh-Hans-CN', 'en-emodeng']`
66
+ */
67
+ export const locales = ExpoLocalization.locales;
68
+ // @needsAudit
69
+ /**
70
+ * @deprecated Use Localization.getCalendars() instead.
71
+ * The current time zone in display format.
72
+ * On Web time zone is calculated with Intl.DateTimeFormat().resolvedOptions().timeZone. For a
73
+ * better estimation you could use the moment-timezone package but it will add significant bloat to
74
+ * your website's bundle size.
75
+ *
76
+ * @example `'America/Los_Angeles'`
77
+ */
78
+ export const timezone = ExpoLocalization.timezone;
79
+ // @needsAudit
80
+ /**
81
+ * @deprecated Use Localization.getLocales() instead.
82
+ * The region code for your device that comes from the Region setting under Language & Region on iOS.
83
+ * This value is always available on iOS, but might return `null` on Android or web.
84
+ *
85
+ * @example `'US'`, `'NZ'`, `null`
86
+ */
87
+ export const region = ExpoLocalization.region;
88
+ /**
89
+ * List of user's locales, returned as an array of objects of type `Locale`.
90
+ * Guaranteed to contain at least 1 element.
91
+ * These are returned in the order the user defines in their device settings.
92
+ * On the web currency and measurements systems are not provided, instead returned as null.
93
+ * If needed, you can infer them from the current region using a lookup table.
94
+ * @example `[{
95
+ "languageTag": "pl-PL",
96
+ "languageCode": "pl",
97
+ "textDirection": "ltr",
98
+ "digitGroupingSeparator": " ",
99
+ "decimalSeparator": ",",
100
+ "measurementSystem": "metric",
101
+ "currencyCode": "PLN",
102
+ "currencySymbol": "zł",
103
+ "regionCode": "PL",
104
+ "temperatureUnit": "celsius"
105
+ }]`
106
+ */
107
+ export const getLocales = ExpoLocalization.getLocales;
108
+ /**
109
+ * List of user's preferred calendars, returned as an array of objects of type `Calendar`.
110
+ * Guaranteed to contain at least 1 element.
111
+ * For now always returns a single element, but it's likely to return a user preference list on some platforms in the future.
112
+ * @example `[
113
+ {
114
+ "calendar": "gregory",
115
+ "timeZone": "Europe/Warsaw",
116
+ "uses24hourClock": true,
117
+ "firstWeekday": 1
118
+ }
119
+ ]`
120
+ */
121
+ export const getCalendars = ExpoLocalization.getCalendars;
122
+ /**
123
+ * A hook providing a list of user's locales, returned as an array of objects of type `Locale`.
124
+ * Guaranteed to contain at least 1 element.
125
+ * These are returned in the order the user defines in their device settings.
126
+ * On the web currency and measurements systems are not provided, instead returned as null.
127
+ * If needed, you can infer them from the current region using a lookup table.
128
+ * If the OS settings change, the hook will rerender with a new list of locales.
129
+ * @example `[{
130
+ "languageTag": "pl-PL",
131
+ "languageCode": "pl",
132
+ "textDirection": "ltr",
133
+ "digitGroupingSeparator": " ",
134
+ "decimalSeparator": ",",
135
+ "measurementSystem": "metric",
136
+ "currencyCode": "PLN",
137
+ "currencySymbol": "zł",
138
+ "regionCode": "PL",
139
+ "temperatureUnit": "celsius"
140
+ }]`
141
+ */
142
+ export function useLocales() {
143
+ const [key, invalidate] = useReducer((k) => k + 1, 0);
144
+ const locales = useMemo(() => getLocales(), [key]);
145
+ useEffect(() => {
146
+ const subscription = addLocaleListener(invalidate);
147
+ return () => {
148
+ removeSubscription(subscription);
149
+ };
150
+ }, []);
151
+ return locales;
152
+ }
153
+ /**
154
+ * A hook providing a list of user's preferred calendars, returned as an array of objects of type `Calendar`.
155
+ * Guaranteed to contain at least 1 element.
156
+ * For now always returns a single element, but it's likely to return a user preference list on some platforms in the future.
157
+ * If the OS settings change, the hook will rerender with a new list of calendars.
158
+ * @example `[
159
+ {
160
+ "calendar": "gregory",
161
+ "timeZone": "Europe/Warsaw",
162
+ "uses24hourClock": true,
163
+ "firstWeekday": 1
164
+ }
165
+ ]`
166
+ */
167
+ export function useCalendars() {
168
+ const [key, invalidate] = useReducer((k) => k + 1, 0);
169
+ const calendars = useMemo(() => getCalendars(), [key]);
170
+ useEffect(() => {
171
+ const subscription = addCalendarListener(invalidate);
172
+ return () => {
173
+ removeSubscription(subscription);
174
+ };
175
+ }, []);
176
+ return calendars;
177
+ }
178
+ // @needsAudit
179
+ /**
180
+ * Get the latest native values from the device. Locale can be changed on some Android devices
181
+ * without resetting the app.
182
+ * > On iOS, changing the locale will cause the device to reset meaning the constants will always be
183
+ * correct.
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * // When the app returns from the background on Android...
188
+ *
189
+ * const { locale } = await Localization.getLocalizationAsync();
190
+ * ```
191
+ * @deprecated
192
+ * Use Localization.getLocales() or Localization.getCalendars() instead.
193
+ */
194
+ export async function getLocalizationAsync() {
195
+ return await ExpoLocalization.getLocalizationAsync();
196
+ }
197
+ //# sourceMappingURL=Localization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Localization.js","sourceRoot":"","sources":["../src/Localization.ts"],"names":[],"mappings":"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","sourcesContent":["import { useEffect, useReducer, useMemo } from 'react';\n\nimport ExpoLocalization, {\n addCalendarListener,\n addLocaleListener,\n removeSubscription,\n} from './ExpoLocalization';\nimport { Localization } from './Localization.types';\nexport * from './Localization.types';\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * Three-character ISO 4217 currency code. Returns `null` on web.\n *\n * @example `'USD'`, `'EUR'`, `'CNY'`, `null`\n */\nexport const currency = ExpoLocalization.currency;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * Decimal separator used for formatting numbers.\n *\n * @example `','`, `'.'`\n */\nexport const decimalSeparator = ExpoLocalization.decimalSeparator;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * Digit grouping separator used when formatting numbers larger than 1000.\n *\n * @example `'.'`, `''`, `','`\n */\nexport const digitGroupingSeparator = ExpoLocalization.digitGroupingSeparator;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * A list of all the supported language ISO codes.\n */\nexport const isoCurrencyCodes = ExpoLocalization.isoCurrencyCodes;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * Boolean value that indicates whether the system uses the metric system.\n * On Android and web, this is inferred from the current region.\n */\nexport const isMetric = ExpoLocalization.isMetric;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * Returns if the system's language is written from Right-to-Left.\n * This can be used to build features like [bidirectional icons](https://material.io/design/usability/bidirectionality.html).\n *\n * Returns `false` in Server Side Rendering (SSR) environments.\n */\nexport const isRTL = ExpoLocalization.isRTL;\n\n// @needsAudit\n/**\n * Consider using Localization.getLocales() for a list of user preferred locales instead.\n * An [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag),\n * consisting of a two-character language code and optional script, region and variant codes.\n *\n * @example `'en'`, `'en-US'`, `'zh-Hans'`, `'zh-Hans-CN'`, `'en-emodeng'`\n */\nexport const locale = ExpoLocalization.locale;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * List of all the native languages provided by the user settings.\n * These are returned in the order the user defines in their device settings.\n *\n * @example `['en', 'en-US', 'zh-Hans', 'zh-Hans-CN', 'en-emodeng']`\n */\nexport const locales = ExpoLocalization.locales;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getCalendars() instead.\n * The current time zone in display format.\n * On Web time zone is calculated with Intl.DateTimeFormat().resolvedOptions().timeZone. For a\n * better estimation you could use the moment-timezone package but it will add significant bloat to\n * your website's bundle size.\n *\n * @example `'America/Los_Angeles'`\n */\nexport const timezone = ExpoLocalization.timezone;\n\n// @needsAudit\n/**\n * @deprecated Use Localization.getLocales() instead.\n * The region code for your device that comes from the Region setting under Language & Region on iOS.\n * This value is always available on iOS, but might return `null` on Android or web.\n *\n * @example `'US'`, `'NZ'`, `null`\n */\nexport const region = ExpoLocalization.region;\n\n/**\n * List of user's locales, returned as an array of objects of type `Locale`.\n * Guaranteed to contain at least 1 element.\n * These are returned in the order the user defines in their device settings.\n * On the web currency and measurements systems are not provided, instead returned as null.\n * If needed, you can infer them from the current region using a lookup table.\n * @example `[{\n \"languageTag\": \"pl-PL\",\n \"languageCode\": \"pl\",\n \"textDirection\": \"ltr\",\n \"digitGroupingSeparator\": \" \",\n \"decimalSeparator\": \",\",\n \"measurementSystem\": \"metric\",\n \"currencyCode\": \"PLN\",\n \"currencySymbol\": \"zł\",\n \"regionCode\": \"PL\",\n \"temperatureUnit\": \"celsius\"\n }]`\n */\nexport const getLocales = ExpoLocalization.getLocales;\n\n/**\n * List of user's preferred calendars, returned as an array of objects of type `Calendar`.\n * Guaranteed to contain at least 1 element.\n * For now always returns a single element, but it's likely to return a user preference list on some platforms in the future.\n * @example `[\n {\n \"calendar\": \"gregory\",\n \"timeZone\": \"Europe/Warsaw\",\n \"uses24hourClock\": true,\n \"firstWeekday\": 1\n }\n ]`\n */\nexport const getCalendars = ExpoLocalization.getCalendars;\n\n/**\n * A hook providing a list of user's locales, returned as an array of objects of type `Locale`.\n * Guaranteed to contain at least 1 element.\n * These are returned in the order the user defines in their device settings.\n * On the web currency and measurements systems are not provided, instead returned as null.\n * If needed, you can infer them from the current region using a lookup table.\n * If the OS settings change, the hook will rerender with a new list of locales.\n * @example `[{\n \"languageTag\": \"pl-PL\",\n \"languageCode\": \"pl\",\n \"textDirection\": \"ltr\",\n \"digitGroupingSeparator\": \" \",\n \"decimalSeparator\": \",\",\n \"measurementSystem\": \"metric\",\n \"currencyCode\": \"PLN\",\n \"currencySymbol\": \"zł\",\n \"regionCode\": \"PL\",\n \"temperatureUnit\": \"celsius\"\n }]`\n */\nexport function useLocales() {\n const [key, invalidate] = useReducer((k) => k + 1, 0);\n const locales = useMemo(() => getLocales(), [key]);\n useEffect(() => {\n const subscription = addLocaleListener(invalidate);\n return () => {\n removeSubscription(subscription);\n };\n }, []);\n return locales;\n}\n\n/**\n * A hook providing a list of user's preferred calendars, returned as an array of objects of type `Calendar`.\n * Guaranteed to contain at least 1 element.\n * For now always returns a single element, but it's likely to return a user preference list on some platforms in the future.\n * If the OS settings change, the hook will rerender with a new list of calendars.\n * @example `[\n {\n \"calendar\": \"gregory\",\n \"timeZone\": \"Europe/Warsaw\",\n \"uses24hourClock\": true,\n \"firstWeekday\": 1\n }\n ]`\n */\nexport function useCalendars() {\n const [key, invalidate] = useReducer((k) => k + 1, 0);\n const calendars = useMemo(() => getCalendars(), [key]);\n useEffect(() => {\n const subscription = addCalendarListener(invalidate);\n return () => {\n removeSubscription(subscription);\n };\n }, []);\n return calendars;\n}\n\n// @needsAudit\n/**\n * Get the latest native values from the device. Locale can be changed on some Android devices\n * without resetting the app.\n * > On iOS, changing the locale will cause the device to reset meaning the constants will always be\n * correct.\n *\n * @example\n * ```ts\n * // When the app returns from the background on Android...\n *\n * const { locale } = await Localization.getLocalizationAsync();\n * ```\n * @deprecated\n * Use Localization.getLocales() or Localization.getCalendars() instead.\n */\nexport async function getLocalizationAsync(): Promise<Localization> {\n return await ExpoLocalization.getLocalizationAsync();\n}\n"]}
@@ -0,0 +1,202 @@
1
+ export type Localization = {
2
+ /**
3
+ * Three-character ISO 4217 currency code. Returns `null` on web.
4
+ *
5
+ * @example `'USD'`, `'EUR'`, `'CNY'`, `null`
6
+ */
7
+ currency: string | null;
8
+ /**
9
+ * Decimal separator used for formatting numbers.
10
+ *
11
+ * @example `','`, `'.'`
12
+ */
13
+ decimalSeparator: string;
14
+ /**
15
+ * Digit grouping separator used when formatting numbers larger than 1000.
16
+ *
17
+ * @example `'.'`, `''`, `','`
18
+ */
19
+ digitGroupingSeparator: string;
20
+ /**
21
+ * A list of all the supported language ISO codes.
22
+ */
23
+ isoCurrencyCodes: string[];
24
+ /**
25
+ * Boolean value that indicates whether the system uses the metric system.
26
+ * On Android and web, this is inferred from the current region.
27
+ */
28
+ isMetric: boolean;
29
+ /**
30
+ * Returns if the system's language is written from Right-to-Left.
31
+ * This can be used to build features like [bidirectional icons](https://material.io/design/usability/bidirectionality.html).
32
+ *
33
+ * Returns `false` in Server Side Rendering (SSR) environments.
34
+ */
35
+ isRTL: boolean;
36
+ /**
37
+ * An [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag),
38
+ * consisting of a two-character language code and optional script, region and variant codes.
39
+ *
40
+ * @example `'en'`, `'en-US'`, `'zh-Hans'`, `'zh-Hans-CN'`, `'en-emodeng'`
41
+ */
42
+ locale: string;
43
+ /**
44
+ * List of all the native languages provided by the user settings.
45
+ * These are returned in the order that the user defined in the device settings.
46
+ *
47
+ * @example `['en', 'en-US', 'zh-Hans', 'zh-Hans-CN', 'en-emodeng']`
48
+ */
49
+ locales: string[];
50
+ /**
51
+ * The region code for your device that comes from the Region setting under Language & Region on iOS.
52
+ * This value is always available on iOS, but might return `null` on Android or web.
53
+ *
54
+ * @example `'US'`, `'NZ'`, `null`
55
+ */
56
+ region: string | null;
57
+ /**
58
+ * The current time zone in display format.
59
+ * On Web time zone is calculated with Intl.DateTimeFormat().resolvedOptions().timeZone. For a
60
+ * better estimation you could use the moment-timezone package but it will add significant bloat to
61
+ * your website's bundle size.
62
+ *
63
+ * @example `'America/Los_Angeles'`
64
+ */
65
+ timezone: string;
66
+ };
67
+ export type Locale = {
68
+ /**
69
+ * An [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) with a region code.
70
+ * @example `'en-US'`, `'es-419'`, `'pl-PL'`.
71
+ */
72
+ languageTag: string;
73
+ /**
74
+ * An [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) without the region code.
75
+ * @example `'en'`, `'es'`, `'pl'`.
76
+ */
77
+ languageCode: string;
78
+ /**
79
+ * The region code for your device that comes from the Region setting under Language & Region on iOS, Region settings on Android and is parsed from locale on Web (can be `null` on Web).
80
+ */
81
+ regionCode: string | null;
82
+ /**
83
+ * Currency code for the locale.
84
+ * Is `null` on Web, use a table lookup based on region instead.
85
+ * @example `'USD'`, `'EUR'`, `'PLN'`.
86
+ */
87
+ currencyCode: string | null;
88
+ /**
89
+ * Currency symbol for the locale.
90
+ * Is `null` on Web, use a table lookup based on region (if available) instead.
91
+ * @example `'$'`, `'€'`, `'zł'`.
92
+ */
93
+ currencySymbol: string | null;
94
+ /**
95
+ * Decimal separator used for formatting numbers with fractional parts.
96
+ * @example `'.'`, `','`.
97
+ */
98
+ decimalSeparator: string | null;
99
+ /**
100
+ * Digit grouping separator used for formatting large numbers.
101
+ * @example `'.'`, `','`.
102
+ */
103
+ digitGroupingSeparator: string | null;
104
+ /**
105
+ * Text direction for the locale. One of: `'ltr'`, `'rtl'`, but can also be `null` on some browsers without support for the [textInfo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/textInfo) property in [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) API.
106
+ */
107
+ textDirection: 'ltr' | 'rtl' | null;
108
+ /**
109
+ * The measurement system used in the locale.
110
+ * Is `null` on Web, as user chosen measurement system is not exposed on the web and using locale to determine measurement systems is unreliable.
111
+ * Ask for user preferences if possible.
112
+ */
113
+ measurementSystem: `metric` | `us` | `uk` | null;
114
+ /**
115
+ * The temperature unit used in the locale.
116
+ * Returns `null` if the region code is unknown.
117
+ */
118
+ temperatureUnit: 'celsius' | 'fahrenheit' | null;
119
+ };
120
+ /**
121
+ * An enum mapping days of the week in Gregorian calendar to their index as returned by the `firstWeekday` property.
122
+ */
123
+ export declare enum Weekday {
124
+ SUNDAY = 1,
125
+ MONDAY = 2,
126
+ TUESDAY = 3,
127
+ WEDNESDAY = 4,
128
+ THURSDAY = 5,
129
+ FRIDAY = 6,
130
+ SATURDAY = 7
131
+ }
132
+ /**
133
+ * The calendar identifier, one of [Unicode calendar types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar).
134
+ * Gregorian calendar is aliased and can be referred to as both `CalendarIdentifier.GREGORIAN` and `CalendarIdentifier.GREGORY`.
135
+ */
136
+ export declare enum CalendarIdentifier {
137
+ /** Thai Buddhist calendar */
138
+ BUDDHIST = "buddhist",
139
+ /** Traditional Chinese calendar */
140
+ CHINESE = "chinese",
141
+ /** Coptic calendar */
142
+ COPTIC = "coptic",
143
+ /** Traditional Korean calendar */
144
+ DANGI = "dangi",
145
+ /** Ethiopic calendar, Amete Alem (epoch approx. 5493 B.C.E) */
146
+ ETHIOAA = "ethioaa",
147
+ /** Ethiopic calendar, Amete Mihret (epoch approx, 8 C.E.) */
148
+ ETHIOPIC = "ethiopic",
149
+ /** Gregorian calendar */
150
+ GREGORY = "gregory",
151
+ /** Gregorian calendar (alias) */
152
+ GREGORIAN = "gregory",
153
+ /** Traditional Hebrew calendar */
154
+ HEBREW = "hebrew",
155
+ /** Indian calendar */
156
+ INDIAN = "indian",
157
+ /** Islamic calendar */
158
+ ISLAMIC = "islamic",
159
+ /** Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - civil epoch) */
160
+ ISLAMIC_CIVIL = "islamic-civil",
161
+ /** Islamic calendar, Saudi Arabia sighting */
162
+ ISLAMIC_RGSA = "islamic-rgsa",
163
+ /**Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch) */
164
+ ISLAMIC_TBLA = "islamic-tbla",
165
+ /** Islamic calendar, Umm al-Qura */
166
+ ISLAMIC_UMALQURA = "islamic-umalqura",
167
+ /** ISO calendar (Gregorian calendar using the ISO 8601 calendar week rules) */
168
+ ISO8601 = "iso8601",
169
+ /** Japanese imperial calendar */
170
+ JAPANESE = "japanese",
171
+ /** Persian calendar */
172
+ PERSIAN = "persian",
173
+ /** Civil (algorithmic) Arabic calendar */
174
+ ROC = "roc"
175
+ }
176
+ export type Calendar = {
177
+ /**
178
+ * The calendar identifier, one of [Unicode calendar types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar).
179
+ *
180
+ * On Android is limited to one of device's [available calendar types](https://developer.android.com/reference/java/util/Calendar#getAvailableCalendarTypes()).
181
+ *
182
+ * On iOS uses [calendar identifiers](https://developer.apple.com/documentation/foundation/calendar/identifier), but maps them to the corresponding Unicode types, will also never contain `'dangi'` or `'islamic-rgsa'` due to it not being implemented on iOS.
183
+ */
184
+ calendar: CalendarIdentifier | null;
185
+ /**
186
+ * True when current device settings use 24 hour time format.
187
+ * Can be null on some browsers that don't support the [hourCycle](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) property in [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) API.
188
+ */
189
+ uses24hourClock: boolean | null;
190
+ /**
191
+ * The first day of the week. For most calendars Sunday is numbered `1`, with Saturday being number `7`.
192
+ * Can be null on some browsers that don't support the [weekInfo](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/weekInfo) property in [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) API.
193
+ * @example `1`, `7`.
194
+ */
195
+ firstWeekday: Weekday | null;
196
+ /**
197
+ * Time zone for the calendar. Can be `null` on Web.
198
+ * @example `'America/Los_Angeles'`, `'Europe/Warsaw'`, `'GMT+1'`.
199
+ */
200
+ timeZone: string | null;
201
+ };
202
+ //# sourceMappingURL=Localization.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Localization.types.d.ts","sourceRoot":"","sources":["../src/Localization.types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;;OAIG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC;;;OAGG;IACH,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC;;OAEG;IACH,aAAa,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,iBAAiB,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAEjD;;;OAGG;IACH,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,IAAI,CAAC;CAClD,CAAC;AAEF;;GAEG;AACH,oBAAY,OAAO;IACjB,MAAM,IAAI;IACV,MAAM,IAAI;IACV,OAAO,IAAI;IACX,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,MAAM,IAAI;IACV,QAAQ,IAAI;CACb;AAED;;;GAGG;AACH,oBAAY,kBAAkB;IAC5B,6BAA6B;IAC7B,QAAQ,aAAa;IACrB,mCAAmC;IACnC,OAAO,YAAY;IACnB,sBAAsB;IACtB,MAAM,WAAW;IACjB,kCAAkC;IAClC,KAAK,UAAU;IACf,+DAA+D;IAC/D,OAAO,YAAY;IACnB,6DAA6D;IAC7D,QAAQ,aAAa;IACrB,yBAAyB;IACzB,OAAO,YAAY;IACnB,iCAAiC;IACjC,SAAS,YAAY;IACrB,kCAAkC;IAClC,MAAM,WAAW;IACjB,sBAAsB;IACtB,MAAM,WAAW;IACjB,uBAAuB;IACvB,OAAO,YAAY;IACnB,kGAAkG;IAClG,aAAa,kBAAkB;IAC/B,8CAA8C;IAC9C,YAAY,iBAAiB;IAC7B,wGAAwG;IACxG,YAAY,iBAAiB;IAC7B,oCAAoC;IACpC,gBAAgB,qBAAqB;IACrC,+EAA+E;IAC/E,OAAO,YAAY;IACnB,iCAAiC;IACjC,QAAQ,aAAa;IACrB,uBAAuB;IACvB,OAAO,YAAY;IACnB,0CAA0C;IAC1C,GAAG,QAAQ;CACZ;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB;;;;;;OAMG;IACH,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,eAAe,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC;;;;OAIG;IACH,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * An enum mapping days of the week in Gregorian calendar to their index as returned by the `firstWeekday` property.
3
+ */
4
+ export var Weekday;
5
+ (function (Weekday) {
6
+ Weekday[Weekday["SUNDAY"] = 1] = "SUNDAY";
7
+ Weekday[Weekday["MONDAY"] = 2] = "MONDAY";
8
+ Weekday[Weekday["TUESDAY"] = 3] = "TUESDAY";
9
+ Weekday[Weekday["WEDNESDAY"] = 4] = "WEDNESDAY";
10
+ Weekday[Weekday["THURSDAY"] = 5] = "THURSDAY";
11
+ Weekday[Weekday["FRIDAY"] = 6] = "FRIDAY";
12
+ Weekday[Weekday["SATURDAY"] = 7] = "SATURDAY";
13
+ })(Weekday || (Weekday = {}));
14
+ /**
15
+ * The calendar identifier, one of [Unicode calendar types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/calendar).
16
+ * Gregorian calendar is aliased and can be referred to as both `CalendarIdentifier.GREGORIAN` and `CalendarIdentifier.GREGORY`.
17
+ */
18
+ export var CalendarIdentifier;
19
+ (function (CalendarIdentifier) {
20
+ /** Thai Buddhist calendar */
21
+ CalendarIdentifier["BUDDHIST"] = "buddhist";
22
+ /** Traditional Chinese calendar */
23
+ CalendarIdentifier["CHINESE"] = "chinese";
24
+ /** Coptic calendar */
25
+ CalendarIdentifier["COPTIC"] = "coptic";
26
+ /** Traditional Korean calendar */
27
+ CalendarIdentifier["DANGI"] = "dangi";
28
+ /** Ethiopic calendar, Amete Alem (epoch approx. 5493 B.C.E) */
29
+ CalendarIdentifier["ETHIOAA"] = "ethioaa";
30
+ /** Ethiopic calendar, Amete Mihret (epoch approx, 8 C.E.) */
31
+ CalendarIdentifier["ETHIOPIC"] = "ethiopic";
32
+ /** Gregorian calendar */
33
+ CalendarIdentifier["GREGORY"] = "gregory";
34
+ /** Gregorian calendar (alias) */
35
+ CalendarIdentifier["GREGORIAN"] = "gregory";
36
+ /** Traditional Hebrew calendar */
37
+ CalendarIdentifier["HEBREW"] = "hebrew";
38
+ /** Indian calendar */
39
+ CalendarIdentifier["INDIAN"] = "indian";
40
+ /** Islamic calendar */
41
+ CalendarIdentifier["ISLAMIC"] = "islamic";
42
+ /** Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - civil epoch) */
43
+ CalendarIdentifier["ISLAMIC_CIVIL"] = "islamic-civil";
44
+ /** Islamic calendar, Saudi Arabia sighting */
45
+ CalendarIdentifier["ISLAMIC_RGSA"] = "islamic-rgsa";
46
+ /**Islamic calendar, tabular (intercalary years [2,5,7,10,13,16,18,21,24,26,29] - astronomical epoch) */
47
+ CalendarIdentifier["ISLAMIC_TBLA"] = "islamic-tbla";
48
+ /** Islamic calendar, Umm al-Qura */
49
+ CalendarIdentifier["ISLAMIC_UMALQURA"] = "islamic-umalqura";
50
+ /** ISO calendar (Gregorian calendar using the ISO 8601 calendar week rules) */
51
+ CalendarIdentifier["ISO8601"] = "iso8601";
52
+ /** Japanese imperial calendar */
53
+ CalendarIdentifier["JAPANESE"] = "japanese";
54
+ /** Persian calendar */
55
+ CalendarIdentifier["PERSIAN"] = "persian";
56
+ /** Civil (algorithmic) Arabic calendar */
57
+ CalendarIdentifier["ROC"] = "roc";
58
+ })(CalendarIdentifier || (CalendarIdentifier = {}));
59
+ //# sourceMappingURL=Localization.types.js.map