summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale
diff options
context:
space:
mode:
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.js41
-rw-r--r--node_modules/@jet-app/app-store/tmp/src/foundation/dependencies/locale/locale.js3
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