From af4ca76c5bf9e3c15503ffe423acdfcbaaeaa314 Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Sun, 10 Dec 2023 22:52:30 -0500 Subject: [PATCH 1/2] docs: clarify location.state refers to ISO 3166-2 --- src/modules/location/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index e7bde32e1a6..2e80b15a9e6 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -372,6 +372,7 @@ export class LocationModule extends ModuleBase { /** * Returns a random localized state, or other equivalent first-level administrative entity for the locale's country such as a province or region. + * Generally, these are the ISO 3166-2 subdivisions for a country. However, not all locales have a country attached to them (e.g. en, ar, es). * * @param options An options object. * @param options.abbreviated If true this will return abbreviated first-level administrative entity names. From 7d11c615371ce8223a846747772e8d52de3b8c5b Mon Sep 17 00:00:00 2001 From: Eric Cheng Date: Mon, 11 Dec 2023 10:42:50 -0500 Subject: [PATCH 2/2] chore: apply review suggestions --- src/modules/location/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/location/index.ts b/src/modules/location/index.ts index 2e80b15a9e6..6d15741dc7e 100644 --- a/src/modules/location/index.ts +++ b/src/modules/location/index.ts @@ -372,7 +372,9 @@ export class LocationModule extends ModuleBase { /** * Returns a random localized state, or other equivalent first-level administrative entity for the locale's country such as a province or region. - * Generally, these are the ISO 3166-2 subdivisions for a country. However, not all locales have a country attached to them (e.g. en, ar, es). + * Generally, these are the ISO 3166-2 subdivisions for a country. + * If a locale doesn't correspond to one specific country, the method may return ISO 3166-2 subdivisions from one or more countries that uses that language. For example, the `ar` locale includes subdivisions from Arabic-speaking countries, such as Tunisia, Algeria, Syria, Lebanon, etc. + * For historical compatibility reasons, the default `en` locale only includes states in the United States (identical to `en_US`). However, you can use other English locales, such as `en_IN`, `en_GB`, and `en_AU`, if needed. * * @param options An options object. * @param options.abbreviated If true this will return abbreviated first-level administrative entity names.