expo-localization 16.1.1 → 16.1.3

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 (52) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/android/build.gradle +2 -2
  3. package/build/ExpoLocalization.d.ts +2 -2
  4. package/build/ExpoLocalization.d.ts.map +1 -1
  5. package/build/ExpoLocalization.js +6 -2
  6. package/build/ExpoLocalization.js.map +1 -1
  7. package/build/ExpoLocalization.native.d.ts +2 -2
  8. package/build/ExpoLocalization.native.d.ts.map +1 -1
  9. package/build/ExpoLocalization.native.js +6 -2
  10. package/build/ExpoLocalization.native.js.map +1 -1
  11. package/expo-module.config.json +1 -1
  12. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.aar +0 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.aar.md5 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.aar.sha1 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.aar.sha256 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.aar.sha512 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1.module → 16.1.3/expo.modules.localization-16.1.3.module} +17 -17
  18. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.module.md5 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.module.sha1 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.module.sha256 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.module.sha512 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1.pom → 16.1.3/expo.modules.localization-16.1.3.pom} +1 -1
  23. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.pom.md5 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.pom.sha1 +1 -0
  25. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.pom.sha256 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.3/expo.modules.localization-16.1.3.pom.sha512 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.localization/maven-metadata.xml +4 -4
  28. package/local-maven-repo/host/exp/exponent/expo.modules.localization/maven-metadata.xml.md5 +1 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.localization/maven-metadata.xml.sha1 +1 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.localization/maven-metadata.xml.sha256 +1 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.localization/maven-metadata.xml.sha512 +1 -1
  32. package/package.json +4 -3
  33. package/src/ExpoLocalization.native.ts +8 -2
  34. package/src/ExpoLocalization.ts +17 -5
  35. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.aar +0 -0
  36. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.aar.md5 +0 -1
  37. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.aar.sha1 +0 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.aar.sha256 +0 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.aar.sha512 +0 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.module.md5 +0 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.module.sha1 +0 -1
  42. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.module.sha256 +0 -1
  43. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.module.sha512 +0 -1
  44. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.pom.md5 +0 -1
  45. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.pom.sha1 +0 -1
  46. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.pom.sha256 +0 -1
  47. package/local-maven-repo/host/exp/exponent/expo.modules.localization/16.1.1/expo.modules.localization-16.1.1.pom.sha512 +0 -1
  48. /package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1-sources.jar → 16.1.3/expo.modules.localization-16.1.3-sources.jar} +0 -0
  49. /package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1-sources.jar.md5 → 16.1.3/expo.modules.localization-16.1.3-sources.jar.md5} +0 -0
  50. /package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1-sources.jar.sha1 → 16.1.3/expo.modules.localization-16.1.3-sources.jar.sha1} +0 -0
  51. /package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1-sources.jar.sha256 → 16.1.3/expo.modules.localization-16.1.3-sources.jar.sha256} +0 -0
  52. /package/local-maven-repo/host/exp/exponent/expo.modules.localization/{16.1.1/expo.modules.localization-16.1.1-sources.jar.sha512 → 16.1.3/expo.modules.localization-16.1.3-sources.jar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 16.1.3 — 2025-04-25
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 16.1.2 — 2025-04-14
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 16.1.1 — 2025-04-09
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '16.1.1'
7
+ version = '16.1.3'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.localization"
11
11
  defaultConfig {
12
12
  versionCode 22
13
- versionName "16.1.1"
13
+ versionName "16.1.3"
14
14
  }
15
15
  }
16
16
 
@@ -1,7 +1,7 @@
1
1
  import { type EventSubscription } from 'expo-modules-core';
2
2
  import { Localization, Calendar, Locale } from './Localization.types';
3
- export declare function addLocaleListener(listener: (event: any) => void): EventSubscription;
4
- export declare function addCalendarListener(listener: (event: any) => void): EventSubscription;
3
+ export declare function addLocaleListener(listener: (event?: unknown) => void): EventSubscription;
4
+ export declare function addCalendarListener(listener: (event?: unknown) => void): EventSubscription;
5
5
  export declare function removeSubscription(subscription: EventSubscription): void;
6
6
  declare const _default: {
7
7
  readonly currency: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoLocalization.d.ts","sourceRoot":"","sources":["../src/ExpoLocalization.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAsB,MAAM,sBAAsB,CAAC;AAoC1F,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,GAAG,iBAAiB,CAK9E;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,GAAG,iBAAiB,CAKhF;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,QAEjE;;uBAGiB,MAAM,GAAG,IAAI;+BAIL,MAAM;qCAGA,MAAM;oBAIvB,OAAO;uBAGJ,OAAO;qBAUT,MAAM;sBAYL,MAAM,EAAE;uBAOP,MAAM;+BAOE,MAAM,EAAE;qBAIlB,MAAM,GAAG,IAAI;kBAab,MAAM,EAAE;oBAoDN,QAAQ,EAAE;4BAcI,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC;;AAtI1F,wBAgKE"}
1
+ {"version":3,"file":"ExpoLocalization.d.ts","sourceRoot":"","sources":["../src/ExpoLocalization.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAsB,MAAM,sBAAsB,CAAC;AAoC1F,wBAAgB,iBAAiB,CAE/B,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,GAClC,iBAAiB,CAKnB;AAED,wBAAgB,mBAAmB,CAEjC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,GAClC,iBAAiB,CAKnB;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,QAEjE;;uBASiB,MAAM,GAAG,IAAI;+BAIL,MAAM;qCAGA,MAAM;oBAIvB,OAAO;uBAGJ,OAAO;qBAUT,MAAM;sBAYL,MAAM,EAAE;uBAOP,MAAM;+BAOE,MAAM,EAAE;qBAIlB,MAAM,GAAG,IAAI;kBAab,MAAM,EAAE;oBAoDN,QAAQ,EAAE;4BAcI,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,CAAC,CAAC;;AAtI1F,wBAgKE"}
@@ -22,13 +22,17 @@ const USES_FAHRENHEIT = [
22
22
  'PW',
23
23
  'KY',
24
24
  ];
25
- export function addLocaleListener(listener) {
25
+ export function addLocaleListener(
26
+ // NOTE(@kitten): We never use the event's data
27
+ listener) {
26
28
  addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);
27
29
  return {
28
30
  remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),
29
31
  };
30
32
  }
31
- export function addCalendarListener(listener) {
33
+ export function addCalendarListener(
34
+ // NOTE(@kitten): We never use the event's data
35
+ listener) {
32
36
  addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);
33
37
  return {
34
38
  remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoLocalization.js","sourceRoot":"","sources":["../src/ExpoLocalization.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,EAAE,QAAQ,EAA0B,MAAM,mBAAmB,CAAC;AACrE,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAIxC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IAC/B,OAAO,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACpF,CAAC,CAAC;AAaF,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AACnD,wEAAwE;AACxE,MAAM,eAAe,GAAG;IACtB,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,QAAyB;IACzD,gBAAgB,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;IACtD,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,yBAAyB,EAAE,QAAQ,CAAC;KACvE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAyB;IAC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YACR,KAAK;YACL,MAAM;YACN,OAAO;YACP,MAAM;YACN,QAAQ;SACT,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,SAAS,uBAAuB,CAAC,MAAc;IAC7C,OAAO,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC;AACrE,CAAC","sourcesContent":["/* eslint-env browser */\nimport { Platform, type EventSubscription } from 'expo-modules-core';\nimport * as rtlDetect from 'rtl-detect';\n\nimport { Localization, Calendar, Locale, CalendarIdentifier } from './Localization.types';\n\nconst getNavigatorLocales = () => {\n return Platform.isDOMAvailable ? navigator.languages || [navigator.language] : [];\n};\n\ntype ExtendedLocale = Intl.Locale &\n // typescript definitions for navigator language don't include some modern Intl properties\n Partial<{\n textInfo: { direction: 'ltr' | 'rtl' };\n timeZones: string[];\n weekInfo: { firstDay: number };\n hourCycles: string[];\n timeZone: string;\n calendars: string[];\n }>;\n\nconst WEB_LANGUAGE_CHANGE_EVENT = 'languagechange';\n// https://wisevoter.com/country-rankings/countries-that-use-fahrenheit/\nconst USES_FAHRENHEIT = [\n 'AG',\n 'BZ',\n 'VG',\n 'FM',\n 'MH',\n 'MS',\n 'KN',\n 'BS',\n 'CY',\n 'TC',\n 'US',\n 'LR',\n 'PW',\n 'KY',\n];\n\nexport function addLocaleListener(listener: (event) => void): EventSubscription {\n addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);\n return {\n remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),\n };\n}\n\nexport function addCalendarListener(listener: (event) => void): EventSubscription {\n addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);\n return {\n remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),\n };\n}\n\nexport function removeSubscription(subscription: EventSubscription) {\n subscription.remove();\n}\n\nexport default {\n get currency(): string | null {\n // TODO: Add support\n return null;\n },\n get decimalSeparator(): string {\n return (1.1).toLocaleString().substring(1, 2);\n },\n get digitGroupingSeparator(): string {\n const value = (1000).toLocaleString();\n return value.length === 5 ? value.substring(1, 2) : '';\n },\n get isRTL(): boolean {\n return rtlDetect.isRtlLang(this.locale) ?? false;\n },\n get isMetric(): boolean {\n const { region } = this;\n switch (region) {\n case 'US': // USA\n case 'LR': // Liberia\n case 'MM': // Myanmar\n return false;\n }\n return true;\n },\n get locale(): string {\n if (!Platform.isDOMAvailable) {\n return '';\n }\n const locale =\n navigator.language ||\n navigator['systemLanguage'] ||\n navigator['browserLanguage'] ||\n navigator['userLanguage'] ||\n this.locales[0];\n return locale;\n },\n get locales(): string[] {\n if (!Platform.isDOMAvailable) {\n return [];\n }\n const { languages = [] } = navigator;\n return Array.from(languages);\n },\n get timezone(): string {\n const defaultTimeZone = 'Etc/UTC';\n if (typeof Intl === 'undefined') {\n return defaultTimeZone;\n }\n return Intl.DateTimeFormat().resolvedOptions().timeZone || defaultTimeZone;\n },\n get isoCurrencyCodes(): string[] {\n // TODO(Bacon): Add this - very low priority\n return [];\n },\n get region(): string | null {\n // There is no way to obtain the current region, as is possible on native.\n // Instead, use the country-code from the locale when possible (e.g. \"en-US\").\n const { locale } = this;\n const [, ...suffixes] = typeof locale === 'string' ? locale.split('-') : [];\n for (const suffix of suffixes) {\n if (suffix.length === 2) {\n return suffix.toUpperCase();\n }\n }\n return null;\n },\n\n getLocales(): Locale[] {\n const locales = getNavigatorLocales();\n return locales?.map((languageTag) => {\n // TextInfo is an experimental API that is not available in all browsers.\n // We might want to consider using a locale lookup table instead.\n\n let locale = {} as ExtendedLocale;\n\n // Properties added only for compatibility with native, use `toLocaleString` instead.\n let digitGroupingSeparator: string | null = null;\n let decimalSeparator: string | null = null;\n let temperatureUnit: 'fahrenheit' | 'celsius' | null = null;\n\n // Gracefully handle language codes like `en-GB-oed` which is unsupported\n // but is otherwise a valid language tag (grandfathered)\n try {\n digitGroupingSeparator =\n Array.from((10000).toLocaleString(languageTag)).filter((c) => c > '9' || c < '0')[0] ||\n null; // using 1e5 instead of 1e4 since for some locales (like pl-PL) 1e4 does not use digit grouping\n\n decimalSeparator = (1.1).toLocaleString(languageTag).substring(1, 2);\n\n if (typeof Intl !== 'undefined') {\n locale = new Intl.Locale(languageTag) as unknown as ExtendedLocale;\n }\n } catch {}\n\n const { region, textInfo, language, script } = locale;\n\n if (region) {\n temperatureUnit = regionToTemperatureUnit(region);\n }\n\n return {\n languageTag,\n languageCode: language || languageTag.split('-')[0] || 'en',\n languageScriptCode: script || null,\n textDirection: (textInfo?.direction as 'ltr' | 'rtl') || null,\n digitGroupingSeparator,\n decimalSeparator,\n measurementSystem: null,\n currencyCode: null,\n currencySymbol: null,\n languageCurrencyCode: null,\n languageCurrencySymbol: null,\n // On web, we don't have a way to get the region code, except from the language tag. `regionCode` and `languageRegionCode` are the same.\n regionCode: region || null,\n languageRegionCode: region || null,\n temperatureUnit,\n };\n });\n },\n getCalendars(): Calendar[] {\n const locale = ((typeof Intl !== 'undefined'\n ? Intl.DateTimeFormat().resolvedOptions()\n : null) ?? null) as unknown as null | ExtendedLocale;\n return [\n {\n calendar: ((locale?.calendar || locale?.calendars?.[0]) as CalendarIdentifier) || null,\n timeZone: locale?.timeZone || locale?.timeZones?.[0] || null,\n uses24hourClock: (locale?.hourCycle || locale?.hourCycles?.[0])?.startsWith('h2') ?? null, //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle\n firstWeekday: locale?.weekInfo?.firstDay || null,\n },\n ];\n },\n\n async getLocalizationAsync(): Promise<Omit<Localization, 'getCalendars' | 'getLocales'>> {\n const {\n currency,\n decimalSeparator,\n digitGroupingSeparator,\n isoCurrencyCodes,\n isMetric,\n isRTL,\n locale,\n locales,\n region,\n timezone,\n } = this;\n return {\n currency,\n decimalSeparator,\n digitGroupingSeparator,\n isoCurrencyCodes,\n isMetric,\n isRTL,\n locale,\n locales,\n region,\n timezone,\n };\n },\n};\n\nfunction regionToTemperatureUnit(region: string) {\n return USES_FA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ser */\nimport { Platform, type EventSubscription } from 'expo-modules-core';\nimport * as rtlDetect from 'rtl-detect';\n\nimport { Localization, Calendar, Locale, CalendarIdentifier } from './Localization.types';\n\nconst getNavigatorLocales = () => {\n return Platform.isDOMAvailable ? navigator.languages || [navigator.language] : [];\n};\n\ntype ExtendedLocale = Intl.Locale &\n // typescript definitions for navigator language don't include some modern Intl properties\n Partial<{\n textInfo: { direction: 'ltr' | 'rtl' };\n timeZones: string[];\n weekInfo: { firstDay: number };\n hourCycles: string[];\n timeZone: string;\n calendars: string[];\n }>;\n\nconst WEB_LANGUAGE_CHANGE_EVENT = 'languagechange';\n// https://wisevoter.com/country-rankings/countries-that-use-fahrenheit/\nconst USES_FAHRENHEIT = [\n 'AG',\n 'BZ',\n 'VG',\n 'FM',\n 'MH',\n 'MS',\n 'KN',\n 'BS',\n 'CY',\n 'TC',\n 'US',\n 'LR',\n 'PW',\n 'KY',\n];\n\nexport function addLocaleListener(\n // NOTE(@kitten): We never use the event's data\n listener: (event?: unknown) => void\n): EventSubscription {\n addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);\n return {\n remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),\n };\n}\n\nexport function addCalendarListener(\n // NOTE(@kitten): We never use the event's data\n listener: (event?: unknown) => void\n): EventSubscription {\n addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);\n return {\n remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),\n };\n}\n\nexport function removeSubscription(subscription: EventSubscription) {\n subscription.remove();\n}\n\ninterface NavigatorLocaleProperties {\n systemLanguage?: string;\n browserLanguage?: string;\n userLanguage?: string;\n}\n\nexport default {\n get currency(): string | null {\n // TODO: Add support\n return null;\n },\n get decimalSeparator(): string {\n return (1.1).toLocaleString().substring(1, 2);\n },\n get digitGroupingSeparator(): string {\n const value = (1000).toLocaleString();\n return value.length === 5 ? value.substring(1, 2) : '';\n },\n get isRTL(): boolean {\n return rtlDetect.isRtlLang(this.locale) ?? false;\n },\n get isMetric(): boolean {\n const { region } = this;\n switch (region) {\n case 'US': // USA\n case 'LR': // Liberia\n case 'MM': // Myanmar\n return false;\n }\n return true;\n },\n get locale(): string {\n if (!Platform.isDOMAvailable) {\n return '';\n }\n const locale =\n navigator.language ||\n (navigator as NavigatorLocaleProperties)['systemLanguage'] ||\n (navigator as NavigatorLocaleProperties)['browserLanguage'] ||\n (navigator as NavigatorLocaleProperties)['userLanguage'] ||\n this.locales[0];\n return locale;\n },\n get locales(): string[] {\n if (!Platform.isDOMAvailable) {\n return [];\n }\n const { languages = [] } = navigator;\n return Array.from(languages);\n },\n get timezone(): string {\n const defaultTimeZone = 'Etc/UTC';\n if (typeof Intl === 'undefined') {\n return defaultTimeZone;\n }\n return Intl.DateTimeFormat().resolvedOptions().timeZone || defaultTimeZone;\n },\n get isoCurrencyCodes(): string[] {\n // TODO(Bacon): Add this - very low priority\n return [];\n },\n get region(): string | null {\n // There is no way to obtain the current region, as is possible on native.\n // Instead, use the country-code from the locale when possible (e.g. \"en-US\").\n const { locale } = this;\n const [, ...suffixes] = typeof locale === 'string' ? locale.split('-') : [];\n for (const suffix of suffixes) {\n if (suffix.length === 2) {\n return suffix.toUpperCase();\n }\n }\n return null;\n },\n\n getLocales(): Locale[] {\n const locales = getNavigatorLocales();\n return locales?.map((languageTag) => {\n // TextInfo is an experimental API that is not available in all browsers.\n // We might want to consider using a locale lookup table instead.\n\n let locale = {} as ExtendedLocale;\n\n // Properties added only for compatibility with native, use `toLocaleString` instead.\n let digitGroupingSeparator: string | null = null;\n let decimalSeparator: string | null = null;\n let temperatureUnit: 'fahrenheit' | 'celsius' | null = null;\n\n // Gracefully handle language codes like `en-GB-oed` which is unsupported\n // but is otherwise a valid language tag (grandfathered)\n try {\n digitGroupingSeparator =\n Array.from((10000).toLocaleString(languageTag)).filter((c) => c > '9' || c < '0')[0] ||\n null; // using 1e5 instead of 1e4 since for some locales (like pl-PL) 1e4 does not use digit grouping\n\n decimalSeparator = (1.1).toLocaleString(languageTag).substring(1, 2);\n\n if (typeof Intl !== 'undefined') {\n locale = new Intl.Locale(languageTag) as unknown as ExtendedLocale;\n }\n } catch {}\n\n const { region, textInfo, language, script } = locale;\n\n if (region) {\n temperatureUnit = regionToTemperatureUnit(region);\n }\n\n return {\n languageTag,\n languageCode: language || languageTag.split('-')[0] || 'en',\n languageScriptCode: script || null,\n textDirection: (textInfo?.direction as 'ltr' | 'rtl') || null,\n digitGroupingSeparator,\n decimalSeparator,\n measurementSystem: null,\n currencyCode: null,\n currencySymbol: null,\n languageCurrencyCode: null,\n languageCurrencySymbol: null,\n // On web, we don't have a way to get the region code, except from the language tag. `regionCode` and `languageRegionCode` are the same.\n regionCode: region || null,\n languageRegionCode: region || null,\n temperatureUnit,\n };\n });\n },\n getCalendars(): Calendar[] {\n const locale = ((typeof Intl !== 'undefined'\n ? Intl.DateTimeFormat().resolvedOptions()\n : null) ?? null) as unknown as null | ExtendedLocale;\n return [\n {\n calendar: ((locale?.calendar || locale?.calendars?.[0]) as CalendarIdentifier) || null,\n timeZone: locale?.timeZone || locale?.timeZones?.[0] || null,\n uses24hourClock: (locale?.hourCycle || locale?.hourCycles?.[0])?.startsWith('h2') ?? null, //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle\n firstWeekday: locale?.weekInfo?.firstDay || null,\n },\n ];\n },\n\n async getLocalizationAsync(): Promise<Omit<Localization, 'getCalendars' | 'getLocales'>> {\n const {\n currency,\n decimalSeparator,\n digitGroupingSeparator,\n isoCurrencyCodes,\n isMetric,\n isRTL,\n locale,\n locales,\n region,\n timezone,\n } = this;\n return {\n currency,\n decimalSeparator,\n digitGroupingSeparator,\n isoCurrencyCodes,\n isMetric,\n isRTL,\n locale,\n locales,\n region,\n timezone,\n };\n },\n};\n\nfunction regionToTemperatureUnit(region: string) {\n return USES_FAHRENHEIT.includes(region) ? 'fahrenheit' : 'celsius';\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { type EventSubscription } from 'expo-modules-core';
2
2
  declare const ExpoLocalizationModule: any;
3
- export declare function addLocaleListener(listener: (event: any) => void): EventSubscription;
4
- export declare function addCalendarListener(listener: (event: any) => void): EventSubscription;
3
+ export declare function addLocaleListener(listener: (event?: unknown) => void): EventSubscription;
4
+ export declare function addCalendarListener(listener: (event?: unknown) => void): EventSubscription;
5
5
  export declare function removeSubscription(subscription: EventSubscription): void;
6
6
  export default ExpoLocalizationModule;
7
7
  //# sourceMappingURL=ExpoLocalization.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoLocalization.native.d.ts","sourceRoot":"","sources":["../src/ExpoLocalization.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,mBAAmB,CAAC;AAEhF,QAAA,MAAM,sBAAsB,KAA0C,CAAC;AAEvE,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,GAAG,iBAAiB,CAE9E;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,GAAG,iBAAiB,CAEhF;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,QAEjE;AAED,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"ExpoLocalization.native.d.ts","sourceRoot":"","sources":["../src/ExpoLocalization.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,mBAAmB,CAAC;AAEhF,QAAA,MAAM,sBAAsB,KAA0C,CAAC;AAEvE,wBAAgB,iBAAiB,CAE/B,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,GAClC,iBAAiB,CAEnB;AAED,wBAAgB,mBAAmB,CAEjC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,IAAI,GAClC,iBAAiB,CAEnB;AAED,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,QAEjE;AAED,eAAe,sBAAsB,CAAC"}
@@ -1,9 +1,13 @@
1
1
  import { requireNativeModule } from 'expo-modules-core';
2
2
  const ExpoLocalizationModule = requireNativeModule('ExpoLocalization');
3
- export function addLocaleListener(listener) {
3
+ export function addLocaleListener(
4
+ // NOTE(@kitten): We never use the event's data
5
+ listener) {
4
6
  return ExpoLocalizationModule.addListener('onLocaleSettingsChanged', listener);
5
7
  }
6
- export function addCalendarListener(listener) {
8
+ export function addCalendarListener(
9
+ // NOTE(@kitten): We never use the event's data
10
+ listener) {
7
11
  return ExpoLocalizationModule.addListener('onCalendarSettingsChanged', listener);
8
12
  }
9
13
  export function removeSubscription(subscription) {
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoLocalization.native.js","sourceRoot":"","sources":["../src/ExpoLocalization.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;AAEvE,MAAM,UAAU,iBAAiB,CAAC,QAAyB;IACzD,OAAO,sBAAsB,CAAC,WAAW,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAAyB;IAC3D,OAAO,sBAAsB,CAAC,WAAW,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,YAA+B;IAChE,YAAY,CAAC,MAAM,EAAE,CAAC;AACxB,CAAC;AAED,eAAe,sBAAsB,CAAC","sourcesContent":["import { type EventSubscription, requireNativeModule } from 'expo-modules-core';\n\nconst ExpoLocalizationModule = requireNativeModule('ExpoLocalization');\n\nexport function addLocaleListener(listener: (event) => void): EventSubscription {\n return ExpoLocalizationModule.addListener('onLocaleSettingsChanged', listener);\n}\n\nexport function addCalendarListener(listener: (event) => void): EventSubscription {\n return ExpoLocalizationModule.addListener('onCalendarSettingsChanged', listener);\n}\n\nexport function removeSubscription(subscription: EventSubscription) {\n subscription.remove();\n}\n\nexport default ExpoLocalizationModule;\n"]}
1
+ {"version":3,"file":"ExpoLocalization.native.js","sourceRoot":"","sources":["../src/ExpoLocalization.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEhF,MAAM,sBAAsB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;AAEvE,MAAM,UAAU,iBAAiB;AAC/B,+CAA+C;AAC/C,QAAmC;IAEnC,OAAO,sBAAsB,CAAC,WAAW,CAAC,yBAAyB,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,mBAAmB;AACjC,+CAA+C;AAC/C,QAAmC;IAEnC,OAAO,sBAAsB,CAAC,WAAW,CAAC,2BAA2B,EAAE,QAAQ,CAAC,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,YAA+B;IAChE,YAAY,CAAC,MAAM,EAAE,CAAC;AACxB,CAAC;AAED,eAAe,sBAAsB,CAAC","sourcesContent":["import { type EventSubscription, requireNativeModule } from 'expo-modules-core';\n\nconst ExpoLocalizationModule = requireNativeModule('ExpoLocalization');\n\nexport function addLocaleListener(\n // NOTE(@kitten): We never use the event's data\n listener: (event?: unknown) => void\n): EventSubscription {\n return ExpoLocalizationModule.addListener('onLocaleSettingsChanged', listener);\n}\n\nexport function addCalendarListener(\n // NOTE(@kitten): We never use the event's data\n listener: (event?: unknown) => void\n): EventSubscription {\n return ExpoLocalizationModule.addListener('onCalendarSettingsChanged', listener);\n}\n\nexport function removeSubscription(subscription: EventSubscription) {\n subscription.remove();\n}\n\nexport default ExpoLocalizationModule;\n"]}
@@ -8,7 +8,7 @@
8
8
  "publication": {
9
9
  "groupId": "host.exp.exponent",
10
10
  "artifactId": "expo.modules.localization",
11
- "version": "16.1.1",
11
+ "version": "16.1.3",
12
12
  "repository": "local-maven-repo"
13
13
  }
14
14
  }
@@ -0,0 +1 @@
1
+ ab3681d35ca6e2ea0a8f395556d5b4cd515ec95bbe837854e4cc7ae0f1f1ce93
@@ -0,0 +1 @@
1
+ 82f92c2444d1895d800c67c402eddd4852cd69f28dc3d9796238b843bca9e23e53abcb0cfaa343161f33a2aa720ec66846376cac82158191cd44a4221666bed0
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.localization",
6
- "version": "16.1.1",
6
+ "version": "16.1.3",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.localization-16.1.1.aar",
28
- "url": "expo.modules.localization-16.1.1.aar",
29
- "size": 25253,
30
- "sha512": "741f621b9fc3a8043f6d1e9e5bd730cfd4189b150a6389d36493cb56886a979201fee80a9c9c2d27259f26fa65ac01cddbcf36d7737b4d5f7bb52dab5e82fca0",
31
- "sha256": "46bab6827836cdba5f2fc2f1c1861e236bffe5e6e96a8b0a17da04d2c5c326ec",
32
- "sha1": "3078cd5cd0090715c8823df8e707827ece9438e0",
33
- "md5": "9a1a4ca4258d29215eb156c726ffca63"
27
+ "name": "expo.modules.localization-16.1.3.aar",
28
+ "url": "expo.modules.localization-16.1.3.aar",
29
+ "size": 25300,
30
+ "sha512": "82f92c2444d1895d800c67c402eddd4852cd69f28dc3d9796238b843bca9e23e53abcb0cfaa343161f33a2aa720ec66846376cac82158191cd44a4221666bed0",
31
+ "sha256": "ab3681d35ca6e2ea0a8f395556d5b4cd515ec95bbe837854e4cc7ae0f1f1ce93",
32
+ "sha1": "c57d226eb675b96d5a9b94e89624099c47c0292c",
33
+ "md5": "549ee71486955b2c57298750853b1c97"
34
34
  }
35
35
  ]
36
36
  },
@@ -60,13 +60,13 @@
60
60
  ],
61
61
  "files": [
62
62
  {
63
- "name": "expo.modules.localization-16.1.1.aar",
64
- "url": "expo.modules.localization-16.1.1.aar",
65
- "size": 25253,
66
- "sha512": "741f621b9fc3a8043f6d1e9e5bd730cfd4189b150a6389d36493cb56886a979201fee80a9c9c2d27259f26fa65ac01cddbcf36d7737b4d5f7bb52dab5e82fca0",
67
- "sha256": "46bab6827836cdba5f2fc2f1c1861e236bffe5e6e96a8b0a17da04d2c5c326ec",
68
- "sha1": "3078cd5cd0090715c8823df8e707827ece9438e0",
69
- "md5": "9a1a4ca4258d29215eb156c726ffca63"
63
+ "name": "expo.modules.localization-16.1.3.aar",
64
+ "url": "expo.modules.localization-16.1.3.aar",
65
+ "size": 25300,
66
+ "sha512": "82f92c2444d1895d800c67c402eddd4852cd69f28dc3d9796238b843bca9e23e53abcb0cfaa343161f33a2aa720ec66846376cac82158191cd44a4221666bed0",
67
+ "sha256": "ab3681d35ca6e2ea0a8f395556d5b4cd515ec95bbe837854e4cc7ae0f1f1ce93",
68
+ "sha1": "c57d226eb675b96d5a9b94e89624099c47c0292c",
69
+ "md5": "549ee71486955b2c57298750853b1c97"
70
70
  }
71
71
  ]
72
72
  },
@@ -80,8 +80,8 @@
80
80
  },
81
81
  "files": [
82
82
  {
83
- "name": "expo.modules.localization-16.1.1-sources.jar",
84
- "url": "expo.modules.localization-16.1.1-sources.jar",
83
+ "name": "expo.modules.localization-16.1.3-sources.jar",
84
+ "url": "expo.modules.localization-16.1.3-sources.jar",
85
85
  "size": 5250,
86
86
  "sha512": "8f2b6289066bce2fe89d94df93054d05a367ec26949527a94015810d7198ece93b061994875bd4d107339cd12e478fc8cc1382fb4d7cd1d8552f96c6d7e151bd",
87
87
  "sha256": "e916e6d7b6dc15511ef9d198ac2f8b0bb157db06a47d6deb520a9992d26b24f4",
@@ -0,0 +1 @@
1
+ 00d2e6caa01fe3f54fab8ac2bc80843541b100dec732fd9c0c0f646025e1667c
@@ -0,0 +1 @@
1
+ e2cd030d9fec6a723fceacfada308ff3b7a8c706dacd93674c10a61bd002a28ab840bd697040c938db1b436a212cde614d372cd491ea3c9d33abe580d4bd7847
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.localization</artifactId>
12
- <version>16.1.1</version>
12
+ <version>16.1.3</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.localization</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ 8ab2141de7a1c05988eb3afb62f921674297e00aefce09db728bf9ba5fb14991
@@ -0,0 +1 @@
1
+ e4dd722ec2365fe53d708a3e92fe1e89dd2ac85a2bd5f0b62947cadad74a911e00f356520d93e1f19429fc4480790377d7a6b9ba6de5e5df78b382782953a08a
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.localization</artifactId>
5
5
  <versioning>
6
- <latest>16.1.1</latest>
7
- <release>16.1.1</release>
6
+ <latest>16.1.3</latest>
7
+ <release>16.1.3</release>
8
8
  <versions>
9
- <version>16.1.1</version>
9
+ <version>16.1.3</version>
10
10
  </versions>
11
- <lastUpdated>20250409202805</lastUpdated>
11
+ <lastUpdated>20250425210749</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 4ef2e9a5e5b3b02aaf0a105d51c1678b
1
+ 67d7ef2331a6392609075d615c860a2b
@@ -1 +1 @@
1
- 970d82af8ad422e211c9a670ff4516084a7b9914
1
+ c48b572e754f451d3b000ae8f3e6936c605a1c5c
@@ -1 +1 @@
1
- 206722eeef7ac32b6c6bbfaf43b1959cf07698352a0d2a9fc4a030c9b73db079
1
+ a6d6e3d40f642bb0f5200b604a4541db820c98039bb02fdec25548535a3ecd0c
@@ -1 +1 @@
1
- 43073cdfa1de9bc46eaf21874ba28f4e706306aba9e1484b35f1a8e0ee21f8d54ac71a0c2fd7f9d7e1f64ce14d1c47bf4fc834d07ca46e74f56c06b8e54b5d0a
1
+ 9c1c5d84b84140f90c9f4b49e825a0ab2f798de1350cf564b706a0f707892ffc9db60f9c0a603ba177149baf22a068ba32ee11437ecb188964dbdeeda52cbcd8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-localization",
3
- "version": "16.1.1",
3
+ "version": "16.1.3",
4
4
  "description": "Provides an interface for native user localization information.",
5
5
  "main": "build/Localization.js",
6
6
  "types": "build/Localization.d.ts",
@@ -42,11 +42,12 @@
42
42
  "rtl-detect": "^1.0.2"
43
43
  },
44
44
  "devDependencies": {
45
- "expo-module-scripts": "^4.1.1"
45
+ "@types/rtl-detect": "^1.0.3",
46
+ "expo-module-scripts": "^4.1.5"
46
47
  },
47
48
  "peerDependencies": {
48
49
  "expo": "*",
49
50
  "react": "*"
50
51
  },
51
- "gitHead": "1914bb35d23af23078da37e70988261844436505"
52
+ "gitHead": "3cd208465df78e385ca9380531bbbfe33ca68e81"
52
53
  }
@@ -2,11 +2,17 @@ import { type EventSubscription, requireNativeModule } from 'expo-modules-core';
2
2
 
3
3
  const ExpoLocalizationModule = requireNativeModule('ExpoLocalization');
4
4
 
5
- export function addLocaleListener(listener: (event) => void): EventSubscription {
5
+ export function addLocaleListener(
6
+ // NOTE(@kitten): We never use the event's data
7
+ listener: (event?: unknown) => void
8
+ ): EventSubscription {
6
9
  return ExpoLocalizationModule.addListener('onLocaleSettingsChanged', listener);
7
10
  }
8
11
 
9
- export function addCalendarListener(listener: (event) => void): EventSubscription {
12
+ export function addCalendarListener(
13
+ // NOTE(@kitten): We never use the event's data
14
+ listener: (event?: unknown) => void
15
+ ): EventSubscription {
10
16
  return ExpoLocalizationModule.addListener('onCalendarSettingsChanged', listener);
11
17
  }
12
18
 
@@ -38,14 +38,20 @@ const USES_FAHRENHEIT = [
38
38
  'KY',
39
39
  ];
40
40
 
41
- export function addLocaleListener(listener: (event) => void): EventSubscription {
41
+ export function addLocaleListener(
42
+ // NOTE(@kitten): We never use the event's data
43
+ listener: (event?: unknown) => void
44
+ ): EventSubscription {
42
45
  addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);
43
46
  return {
44
47
  remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),
45
48
  };
46
49
  }
47
50
 
48
- export function addCalendarListener(listener: (event) => void): EventSubscription {
51
+ export function addCalendarListener(
52
+ // NOTE(@kitten): We never use the event's data
53
+ listener: (event?: unknown) => void
54
+ ): EventSubscription {
49
55
  addEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener);
50
56
  return {
51
57
  remove: () => removeEventListener(WEB_LANGUAGE_CHANGE_EVENT, listener),
@@ -56,6 +62,12 @@ export function removeSubscription(subscription: EventSubscription) {
56
62
  subscription.remove();
57
63
  }
58
64
 
65
+ interface NavigatorLocaleProperties {
66
+ systemLanguage?: string;
67
+ browserLanguage?: string;
68
+ userLanguage?: string;
69
+ }
70
+
59
71
  export default {
60
72
  get currency(): string | null {
61
73
  // TODO: Add support
@@ -87,9 +99,9 @@ export default {
87
99
  }
88
100
  const locale =
89
101
  navigator.language ||
90
- navigator['systemLanguage'] ||
91
- navigator['browserLanguage'] ||
92
- navigator['userLanguage'] ||
102
+ (navigator as NavigatorLocaleProperties)['systemLanguage'] ||
103
+ (navigator as NavigatorLocaleProperties)['browserLanguage'] ||
104
+ (navigator as NavigatorLocaleProperties)['userLanguage'] ||
93
105
  this.locales[0];
94
106
  return locale;
95
107
  },
@@ -1 +0,0 @@
1
- 46bab6827836cdba5f2fc2f1c1861e236bffe5e6e96a8b0a17da04d2c5c326ec
@@ -1 +0,0 @@
1
- 741f621b9fc3a8043f6d1e9e5bd730cfd4189b150a6389d36493cb56886a979201fee80a9c9c2d27259f26fa65ac01cddbcf36d7737b4d5f7bb52dab5e82fca0
@@ -1 +0,0 @@
1
- 01d6ba54cfaf7d67c5ef2289a1dbd72f039e96c894d669158454f9cff919250d
@@ -1 +0,0 @@
1
- 3786362b13cfb08a29d752c7e7792cdbcee363b4556595cf7c56a849965976752b1c021f2c1f01d5d4ea20a3d64b68bc6c9e55140de6ada16e072a5b788ae157
@@ -1 +0,0 @@
1
- 07aae83ff893dc74cffa7d4c00982cab31bb082a34d42751a5d887c754316685
@@ -1 +0,0 @@
1
- a6b22a4872cb574b2bf436752daf511d1b54c189ba4335d6e2ff2a761e8b4e58a5bd339b72dacd15c89d1226a16573517fe64068d3e9e9a269c928f824306ac7