diff --git a/ui/element/src/mixins/direction.ts b/ui/element/src/mixins/direction.ts index 82c9cf9e4..1c9baf6e8 100644 --- a/ui/element/src/mixins/direction.ts +++ b/ui/element/src/mixins/direction.ts @@ -1,4 +1,4 @@ -import {localeConsumer} from '@alwatr/i18n'; +import {localeContextConsumer} from '@alwatr/i18n'; import type {LoggerMixinInterface} from './logging.js'; import type {Constructor} from '@alwatr/type'; @@ -19,7 +19,7 @@ export function DirectionMixin>( override connectedCallback(): void { super.connectedCallback(); - this._signalListenerList.push(localeConsumer.subscribe(this._localeChanged.bind(this))); + this._signalListenerList.push(localeContextConsumer.subscribe(this._localeChanged.bind(this))); } /** @@ -27,7 +27,7 @@ export function DirectionMixin>( */ protected _updateDir(): void { this._logger.logMethod('_updateDir'); - const dir = this._dirParent?.dir || localeConsumer.getValue()?.direction || document.documentElement.dir; + const dir = this._dirParent?.dir || localeContextConsumer.getValue()?.direction || document.documentElement.dir; this.setAttribute('dir', dir === 'rtl' ? dir : 'ltr'); } diff --git a/ui/element/src/mixins/localize.ts b/ui/element/src/mixins/localize.ts index 680ce9fb5..70201d344 100644 --- a/ui/element/src/mixins/localize.ts +++ b/ui/element/src/mixins/localize.ts @@ -1,4 +1,4 @@ -import {l10nResourceConsumer} from '@alwatr/i18n'; +import {l18eContextConsumer} from '@alwatr/i18n'; import type {LoggerMixinInterface} from './logging.js'; import type {ListenerSpec} from '@alwatr/signal'; @@ -16,14 +16,14 @@ export function LocalizeMixin>( override connectedCallback(): void { super.connectedCallback(); - this.__l10nResourceListener = l10nResourceConsumer.subscribe(() => { + this.__l10nResourceListener = l18eContextConsumer.subscribe(() => { this._l10nResourceChanged(); }); } override disconnectedCallback(): void { if (this.__l10nResourceListener != null) { - l10nResourceConsumer.unsubscribe(this.__l10nResourceListener); + l18eContextConsumer.unsubscribe(this.__l10nResourceListener); } super.disconnectedCallback(); } diff --git a/ui/element/src/pwa-element.ts b/ui/element/src/pwa-element.ts index a55970b1d..7bf171eca 100644 --- a/ui/element/src/pwa-element.ts +++ b/ui/element/src/pwa-element.ts @@ -1,4 +1,4 @@ -import {localeConsumer, setLocale} from '@alwatr/i18n'; +import {localeContextConsumer, setLocale} from '@alwatr/i18n'; import {routerOutlet, type RoutesConfig} from '@alwatr/router'; import {html, css, type CSSResultGroup, type PropertyValues} from 'lit'; import {cache} from 'lit/directives/cache.js'; @@ -43,7 +43,7 @@ export class AlwatrPwaElement extends AlwatrSmartElement { constructor() { super(); this._initLocale(); - localeConsumer.subscribe(this._routeChanged.bind(this)); + localeContextConsumer.subscribe(this._routeChanged.bind(this)); } protected _initLocale(): void { diff --git a/ui/ui-kit/src/chat/chat-footer.ts b/ui/ui-kit/src/chat/chat-footer.ts index a678cb0c2..c6ffcc507 100644 --- a/ui/ui-kit/src/chat/chat-footer.ts +++ b/ui/ui-kit/src/chat/chat-footer.ts @@ -1,7 +1,7 @@ import {AlwatrDummyElement, css, customElement, html} from '@alwatr/element'; import './chat-text-input.js'; import '../button/icon-button.js'; -import {setLocale, localeConsumer} from '@alwatr/i18n'; +import {setLocale, localeContextConsumer} from '@alwatr/i18n'; declare global { interface HTMLElementTagNameMap { @@ -40,6 +40,6 @@ export class AlwatrChatFooter extends AlwatrDummyElement { } protected _changeLocale(): void { - setLocale(localeConsumer.getValue()?.language !== 'fa' ? 'fa' : 'en'); + setLocale(localeContextConsumer.getValue()?.language !== 'fa' ? 'fa' : 'en'); } } diff --git a/uniquely/flight-finder-pwa/src/component/job-add-form.ts b/uniquely/flight-finder-pwa/src/component/job-add-form.ts index 7a30a0225..bd531d2ef 100644 --- a/uniquely/flight-finder-pwa/src/component/job-add-form.ts +++ b/uniquely/flight-finder-pwa/src/component/job-add-form.ts @@ -1,5 +1,5 @@ import {AlwatrSmartElement, customElement, css, html} from '@alwatr/element'; -import {message, localeConsumer, number} from '@alwatr/i18n'; +import {message, localeContextConsumer, number} from '@alwatr/i18n'; import {eventTrigger} from '@alwatr/signal'; import {cityList} from '../city-list.js'; @@ -180,7 +180,7 @@ export class JobAddForm extends AlwatrSmartElement { event, }); - const currentYear = new Date().toLocaleDateString(localeConsumer.getValue()?.code, { + const currentYear = new Date().toLocaleDateString(localeContextConsumer.getValue()?.code, { numberingSystem: 'latn', year: 'numeric', });