diff options
| author | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
|---|---|---|
| committer | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
| commit | bce557cc2dc767628bed6aac87301a1be7c5431b (patch) | |
| tree | b51a051228d01fe3306cd7626d4a96768aadb944 /node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale | |
init commit
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale')
| -rw-r--r-- | node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js | 41 | ||||
| -rw-r--r-- | node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js | 3 |
2 files changed, 44 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js new file mode 100644 index 0000000..7790008 --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale-from-bag.js @@ -0,0 +1,41 @@ +export class LocaleFromBag { + constructor(objectGraph) { + this.objectGraph = objectGraph; + } + /** + * The current {@link NormalizedStorefront | storefront} for the client + * + * This reads directly from the `Bag`, as that is the source of truth + * for locale information in the "native" clients + */ + get activeStorefront() { + // The type-cast here reflects the implicit assumption that any values + // belonging to the `Bag` have already been normalized + return this.objectGraph.bag.mediaCountryCode; + } + /** + * The current {@link NormalizedLanguage | language} for the client + * + * This reads directly from the `Bag`, as that is the source of truth + * for locale information in the "native" clients + */ + get activeLanguage() { + // The type-cast here reflects the implicit assumption that any values + // belonging to the `Bag` have already been normalized + return this.objectGraph.bag.language; + } + setActiveLocale(_locale) { + // Intentional no-op; "native" clients that use the `Bag` as the source + // of "locale" information do not allow for mutation of the "locale" + } + normalize(_unnormalizedLocale) { + return { + storefront: this.activeStorefront, + language: this.activeLanguage, + }; + } + deriveLocaleForUrl(locale) { + return locale; + } +} +//# sourceMappingURL=locale-from-bag.js.map
\ No newline at end of file diff --git a/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js new file mode 100644 index 0000000..d00bacc --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js @@ -0,0 +1,3 @@ +import { makeMetatype } from "@jet/environment/util/metatype"; +export const LocaleMetaType = makeMetatype("app-store:locale"); +//# sourceMappingURL=locale.js.map
\ No newline at end of file |
