@acorex/core 17.1.0 → 17.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
+ import { AXEventService, AXEventTypes } from '@acorex/core/events';
1
2
  import { Injectable, inject } from '@angular/core';
3
+ import { get as lodashGet, set as lodashSet } from 'lodash-es';
2
4
  import { BehaviorSubject, catchError, finalize, firstValueFrom, forkJoin, lastValueFrom, map, of, shareReplay, startWith, switchMap, take, tap, } from 'rxjs';
3
- import { AX_TRANSLATION_LOADER } from './translation.loader';
4
- import { set as lodashSet, get as lodashGet } from 'lodash-es';
5
5
  import { AX_TRANSLATION_CONFIG } from './translation.config';
6
- import { AXEventService, AXEventTypes } from '@acorex/core/events';
6
+ import { AX_TRANSLATION_LOADER } from './translation.loader';
7
7
  import * as i0 from "@angular/core";
8
8
  let service;
9
9
  export function translateSync(key, options) {
@@ -42,9 +42,7 @@ export class AXTranslationService {
42
42
  return this.ongoingRequests.get(requestKey);
43
43
  }
44
44
  // Load translations if not in cache or ongoing requests
45
- const translationObservable = this.loader
46
- .getTranslation({ lang, scope })
47
- .pipe(tap((translations) => this.cacheTranslations(lang, scope, translations)), catchError((error) => {
45
+ const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(tap((translations) => this.cacheTranslations(lang, scope, translations)), catchError((error) => {
48
46
  console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);
49
47
  return of(null);
50
48
  }), finalize(() => {
@@ -115,7 +113,12 @@ export class AXTranslationService {
115
113
  if (params) {
116
114
  Object.keys(params).forEach((paramKey) => {
117
115
  const paramValue = params[paramKey];
118
- translation = translation.replace(new RegExp(`{{\\s*${paramKey}\\s*}}`, 'g'), paramValue);
116
+ if (typeof translation !== 'string') {
117
+ console.error(`${key} is not string`, { key, lang, scope, params, translation });
118
+ }
119
+ else {
120
+ translation = translation.replace(new RegExp(`{{\\s*${paramKey}\\s*}}`, 'g'), paramValue);
121
+ }
119
122
  });
120
123
  }
121
124
  // Replace translations like {{ t('key') }}
@@ -155,7 +158,7 @@ export class AXTranslationService {
155
158
  const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
156
159
  // Check if the translation for the active language is available
157
160
  let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
158
- //
161
+ //
159
162
  const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));
160
163
  // If not available, check lastActiveLang
161
164
  if (!translation && this.lastActiveLang) {
@@ -177,4 +180,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImpor
177
180
  type: Injectable,
178
181
  args: [{ providedIn: 'root' }]
179
182
  }], ctorParameters: () => [] });
180
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS90cmFuc2xhdGlvbi9zcmMvbGliL3RyYW5zbGF0aW9uLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUNMLGVBQWUsRUFFZixVQUFVLEVBQ1YsUUFBUSxFQUVSLGNBQWMsRUFDZCxRQUFRLEVBQ1IsYUFBYSxFQUNiLEdBQUcsRUFDSCxFQUFFLEVBQ0YsV0FBVyxFQUNYLFNBQVMsRUFDVCxTQUFTLEVBQ1QsSUFBSSxFQUNKLEdBQUcsR0FDSixNQUFNLE1BQU0sQ0FBQztBQU1kLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzdELE9BQU8sRUFBRSxHQUFHLElBQUksU0FBUyxFQUFFLEdBQUcsSUFBSSxTQUFTLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDL0QsT0FBTyxFQUFFLHFCQUFxQix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Glvbikge1xuICAgICAgbG9hZExhbmcoKTtcbiAgICAgIHRyYW5zbGF0aW9uID0gbG9kYXNoR2V0KHRoaXMudHJhbnNsYXRpb25DYWNoZSwgYCR7dGhpcy5nZXREZWZhdWx0TGFuZygpfS4ke3Njb3BlfS4ke2tleX1gKTtcbiAgICB9XG5cbiAgICAvLyBQZXJmb3JtIHBhcmFtZXRlciByZXBsYWNlbWVudFxuICAgIHJldHVybiB0aGlzLmdldFRyYW5zbGF0aW9uKCh0cmFuc2xhdGlvbiB8fCBrZXkpIGFzIGFueSwgbGFuZywgc2NvcGUsIG9wdGlvbnM/LnBhcmFtcyk7XG4gIH1cbn1cbiJdfQ==
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, Injectable, Pipe, Directive, APP_INITIALIZER, NgModule } from '@angular/core';
3
3
  import { of, BehaviorSubject, forkJoin, tap, catchError, finalize, shareReplay, map, switchMap, startWith, firstValueFrom, take, lastValueFrom } from 'rxjs';
4
- import { set, get } from 'lodash-es';
5
4
  import { AXEventService, AXEventTypes } from '@acorex/core/events';
5
+ import { set, get } from 'lodash-es';
6
6
 
7
7
  const AX_TRANSLATION_CONFIG = new InjectionToken('AX_TRANSLATION_CONFIG', {
8
8
  providedIn: 'root',
@@ -72,9 +72,7 @@ class AXTranslationService {
72
72
  return this.ongoingRequests.get(requestKey);
73
73
  }
74
74
  // Load translations if not in cache or ongoing requests
75
- const translationObservable = this.loader
76
- .getTranslation({ lang, scope })
77
- .pipe(tap((translations) => this.cacheTranslations(lang, scope, translations)), catchError((error) => {
75
+ const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(tap((translations) => this.cacheTranslations(lang, scope, translations)), catchError((error) => {
78
76
  console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);
79
77
  return of(null);
80
78
  }), finalize(() => {
@@ -145,7 +143,12 @@ class AXTranslationService {
145
143
  if (params) {
146
144
  Object.keys(params).forEach((paramKey) => {
147
145
  const paramValue = params[paramKey];
148
- translation = translation.replace(new RegExp(`{{\\s*${paramKey}\\s*}}`, 'g'), paramValue);
146
+ if (typeof translation !== 'string') {
147
+ console.error(`${key} is not string`, { key, lang, scope, params, translation });
148
+ }
149
+ else {
150
+ translation = translation.replace(new RegExp(`{{\\s*${paramKey}\\s*}}`, 'g'), paramValue);
151
+ }
149
152
  });
150
153
  }
151
154
  // Replace translations like {{ t('key') }}
@@ -185,7 +188,7 @@ class AXTranslationService {
185
188
  const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
186
189
  // Check if the translation for the active language is available
187
190
  let translation = get(this.translationCache, `${lang}.${scope}.${key}`);
188
- //
191
+ //
189
192
  const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));
190
193
  // If not available, check lastActiveLang
191
194
  if (!translation && this.lastActiveLang) {
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>(\n 'AX_TRANSLATION_CONFIG',\n {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n }\n);\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(\n config: AXPartialTranslationConfig = {}\n): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport {\n AXTranslateLang,\n AXTranslateScope,\n AXTranslation,\n} from './translation.types';\nimport { Observable, of } from 'rxjs';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(\n options: AXTranslationLoaderOptions\n ): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(\n options: AXTranslationLoaderOptions\n ): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>(\n 'AX_TRANSLATION_LOADER',\n {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n }\n);\n","import { Injectable, inject } from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n finalize,\n first,\n firstValueFrom,\n forkJoin,\n lastValueFrom,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport {\n AXTranslateHashMap,\n AXTranslateOptions,\n AXTranslateParams,\n} from './translation.types';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport { set as lodashSet, get as lodashGet } from 'lodash-es';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXEventService, AXEventTypes } from '@acorex/core/events';\n\nlet service: AXTranslationService;\n\nexport function translateSync(\n key: string,\n options?: AXTranslateOptions\n): string {\n return service.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(\n this.getDefaultLang()\n );\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private lastActiveLang: string | null = null;\n\n /**\n * @ignore\n */\n constructor() {\n service = this;\n }\n\n public loadLanguagesAndScopes(\n languages: string[],\n scopes: string[]\n ): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(lang, scope);\n })\n );\n\n return forkJoin(requests);\n }\n\n private getOrLoadTranslations(\n lang: string,\n scope: string\n ): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader\n .getTranslation({ lang, scope })\n .pipe(\n tap((translations) =>\n this.cacheTranslations(lang, scope, translations)\n ),\n catchError((error) => {\n console.error(\n `Error loading translations for lang: ${lang}, scope: ${scope}`,\n error\n );\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1)\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n private cacheTranslations(\n lang: string,\n scope: string,\n translations: AXTranslateHashMap<string>\n ): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.lastActiveLang = this.getActiveLang(); // Update last active language\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n private load(\n key: string,\n options: AXTranslateOptions = {}\n ): Observable<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;\n\n // Function to fetch translation\n const fetchTranslation = (language: string): Observable<string> => {\n // Check if translations are available in the cache\n if (this.translationCache[language]?.[scope]) {\n return of(this.getTranslation(key, language, scope, options.params));\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(language, scope).pipe(\n map(() => {\n const translation =\n this.translationCache[language]?.[scope]?.[key] || key;\n return this.getTranslation(\n translation,\n language,\n scope,\n options.params\n );\n }),\n switchMap((translatedText) => {\n if (translatedText === key && language !== this.getDefaultLang()) {\n // If the translation is not found and the language is not default,\n // try fetching from the default language\n return fetchTranslation(this.getDefaultLang());\n }\n return of(translatedText);\n })\n );\n };\n\n // First, try to fetch the translation for the requested language\n const translationForRequestedLang = fetchTranslation(lang);\n\n // If lastActiveLang is available and different from the requested language, use it as a fallback\n if (this.lastActiveLang && this.lastActiveLang !== lang) {\n const translationForLastActiveLang = this.getTranslation(\n key,\n this.lastActiveLang,\n scope,\n options.params\n );\n return translationForRequestedLang.pipe(\n startWith(translationForLastActiveLang)\n );\n }\n\n return translationForRequestedLang;\n }\n\n private getTranslation(\n key: string,\n lang: string,\n scope: string,\n params?: AXTranslateParams\n ): string {\n let translation: string = (lodashGet(\n this.translationCache,\n `${lang}.${scope}.${key}`\n ) || key) as string;\n\n // Replace params like {{ name }}\n if (params) {\n Object.keys(params).forEach((paramKey) => {\n const paramValue = params[paramKey] as string;\n translation = translation.replace(\n new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'),\n paramValue\n );\n });\n }\n\n // Replace translations like {{ t('key') }}\n const translationPattern = /{{\\s*t\\('([^']+)'\\)\\s*}}/g;\n translation = translation.replace(translationPattern, (match, innerKey) => {\n return this.getTranslation(innerKey, lang, scope, params);\n });\n return translation;\n }\n\n public translate(\n key: string,\n options?: AXTranslateOptions\n ): Observable<string> {\n if (options?.lang) {\n return this.load(key, options);\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.load(key, { ...options, lang: lang });\n })\n );\n }\n\n public async translateAsync(\n key: string,\n options?: AXTranslateOptions\n ): Promise<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } =\n options || {};\n let translation = lodashGet(\n this.translationCache,\n `${lang}.${scope}.${key}`\n );\n\n if (!translation) {\n // If the translation is not in the cache, load it\n await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));\n translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n }\n\n // If still not available, try the last active language or default language\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(\n this.translationCache,\n `${this.lastActiveLang}.${scope}.${key}`\n );\n }\n if (!translation) {\n translation = lodashGet(\n this.translationCache,\n `${this.getDefaultLang()}.${scope}.${key}`\n );\n }\n\n // Perform parameter replacement\n return this.getTranslation(\n (translation || key) as any,\n lang,\n scope,\n options?.params\n );\n }\n\n public translateSync(key: string, options?: AXTranslateOptions): string {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } =\n options || {};\n\n // Check if the translation for the active language is available\n let translation = lodashGet(\n this.translationCache,\n `${lang}.${scope}.${key}`\n );\n\n // \n const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));\n // If not available, check lastActiveLang\n if (!translation && this.lastActiveLang) {\n loadLang();\n translation = lodashGet(\n this.translationCache,\n `${this.lastActiveLang}.${scope}.${key}`\n );\n }\n\n // If still not available, use the default language\n if (!translation) {\n loadLang();\n translation = lodashGet(\n this.translationCache,\n `${this.getDefaultLang()}.${scope}.${key}`\n );\n }\n\n // Perform parameter replacement\n return this.getTranslation(\n (translation || key) as any,\n lang,\n scope,\n options?.params\n );\n }\n\n\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({ name: 'translate', pure: true }) // The pipe can now be pure\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) {\n return of(''); // Return an empty observable if the key is not provided\n }\n return this.service.translate(key, options);\n }\n}\n","import {\n Directive,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate(key, options);\n },\n });\n }\n}\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { AXTranslatorPipe } from './translator.pipe';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslationService } from './translation.service';\nimport { Observable } from 'rxjs';\nimport {\n AXTranslationConfig,\n AX_TRANSLATION_CONFIG,\n} from './translation.config';\n\nfunction initializeApp(\n translatorService: AXTranslationService,\n config: AXTranslationConfig\n) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope]\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeApp,\n deps: [AXTranslationService, AX_TRANSLATION_CONFIG],\n multi: true,\n },\n ],\n})\nexport class AXTranslationModule {}\n","import { inject } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes(\n [translatorService.getActiveLang()],\n scopes\n );\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;;MAYa,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB,EACvB;AACE,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,OAAO,0BAA0B,CAAC;KACnC;AACF,CAAA,EACD;AAEW,MAAA,0BAA0B,GAAwB;AAC7D,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,gBAAgB,EAAE,OAAO;EACzB;AAIc,SAAA,iBAAiB,CAC/B,MAAA,GAAqC,EAAE,EAAA;AAEvC,IAAA,MAAM,MAAM,GAAG;AACb,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACV,CAAC;AACF,IAAA,OAAO,MAAM,CAAC;AAChB;;MCnBa,0BAA0B,CAAA;AACrC,IAAA,cAAc,CACZ,OAAmC,EAAA;AAEnC,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;KACf;AACF,CAAA;MAEY,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB,EACvB;AACE,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;QACZ,OAAO,IAAI,0BAA0B,EAAE,CAAC;KACzC;AACF,CAAA;;ACNH,IAAI,OAA6B,CAAC;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,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACvD,IAAA,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC,UAAU,CAAC,CAAC;AACrE,IAAA,OAAO,iBAAiB,CAAC,sBAAsB,CAC7C,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC,EACnC,MAAM,CACP,CAAC;AACJ;;ACdA;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>(\n 'AX_TRANSLATION_CONFIG',\n {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n }\n);\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(\n config: AXPartialTranslationConfig = {}\n): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport {\n AXTranslateLang,\n AXTranslateScope,\n AXTranslation,\n} from './translation.types';\nimport { Observable, of } from 'rxjs';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(\n options: AXTranslationLoaderOptions\n ): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(\n options: AXTranslationLoaderOptions\n ): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>(\n 'AX_TRANSLATION_LOADER',\n {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n }\n);\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n finalize,\n firstValueFrom,\n forkJoin,\n lastValueFrom,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport { AXTranslateHashMap, AXTranslateOptions, AXTranslateParams } from './translation.types';\n\nlet service: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return service.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private lastActiveLang: string | null = null;\n\n /**\n * @ignore\n */\n constructor() {\n service = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private getOrLoadTranslations(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.cacheTranslations(lang, scope, translations)),\n catchError((error) => {\n console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n private cacheTranslations(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.lastActiveLang = this.getActiveLang(); // Update last active language\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n private load(key: string, options: AXTranslateOptions = {}): Observable<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;\n\n // Function to fetch translation\n const fetchTranslation = (language: string): Observable<string> => {\n // Check if translations are available in the cache\n if (this.translationCache[language]?.[scope]) {\n return of(this.getTranslation(key, language, scope, options.params));\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(language, scope).pipe(\n map(() => {\n const translation = this.translationCache[language]?.[scope]?.[key] || key;\n return this.getTranslation(translation, language, scope, options.params);\n }),\n switchMap((translatedText) => {\n if (translatedText === key && language !== this.getDefaultLang()) {\n // If the translation is not found and the language is not default,\n // try fetching from the default language\n return fetchTranslation(this.getDefaultLang());\n }\n return of(translatedText);\n }),\n );\n };\n\n // First, try to fetch the translation for the requested language\n const translationForRequestedLang = fetchTranslation(lang);\n\n // If lastActiveLang is available and different from the requested language, use it as a fallback\n if (this.lastActiveLang && this.lastActiveLang !== lang) {\n const translationForLastActiveLang = this.getTranslation(key, this.lastActiveLang, scope, options.params);\n return translationForRequestedLang.pipe(startWith(translationForLastActiveLang));\n }\n\n return translationForRequestedLang;\n }\n\n private getTranslation(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n let translation: string = (lodashGet(this.translationCache, `${lang}.${scope}.${key}`) || key) as string;\n\n // Replace params like {{ name }}\n if (params) {\n Object.keys(params).forEach((paramKey) => {\n const paramValue = params[paramKey] as string;\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n translation = translation.replace(new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'), paramValue);\n }\n });\n }\n\n // Replace translations like {{ t('key') }}\n const translationPattern = /{{\\s*t\\('([^']+)'\\)\\s*}}/g;\n translation = translation.replace(translationPattern, (match, innerKey) => {\n return this.getTranslation(innerKey, lang, scope, params);\n });\n return translation;\n }\n\n public translate(key: string, options?: AXTranslateOptions): Observable<string> {\n if (options?.lang) {\n return this.load(key, options);\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.load(key, { ...options, lang: lang });\n }),\n );\n }\n\n public async translateAsync(key: string, options?: AXTranslateOptions): Promise<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n if (!translation) {\n // If the translation is not in the cache, load it\n await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));\n translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n }\n\n // If still not available, try the last active language or default language\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n if (!translation) {\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n\n public translateSync(key: string, options?: AXTranslateOptions): string {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n\n // Check if the translation for the active language is available\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n //\n const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));\n // If not available, check lastActiveLang\n if (!translation && this.lastActiveLang) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n\n // If still not available, use the default language\n if (!translation) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({ name: 'translate', pure: true }) // The pipe can now be pure\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) {\n return of(''); // Return an empty observable if the key is not provided\n }\n return this.service.translate(key, options);\n }\n}\n","import {\n Directive,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate(key, options);\n },\n });\n }\n}\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { AXTranslatorPipe } from './translator.pipe';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslationService } from './translation.service';\nimport { Observable } from 'rxjs';\nimport {\n AXTranslationConfig,\n AX_TRANSLATION_CONFIG,\n} from './translation.config';\n\nfunction initializeApp(\n translatorService: AXTranslationService,\n config: AXTranslationConfig\n) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope]\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeApp,\n deps: [AXTranslationService, AX_TRANSLATION_CONFIG],\n multi: true,\n },\n ],\n})\nexport class AXTranslationModule {}\n","import { inject } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes(\n [translatorService.getActiveLang()],\n scopes\n );\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTran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CAC7C,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAC,EACnC,MAAM,CACP,CAAC;AACJ;;ACdA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/core",
3
- "version": "17.1.0",
3
+ "version": "17.1.2",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.2",
6
6
  "@angular/core": "^17.3.2",