@intlayer/ngx-translate 9.7.0 → 9.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/esbuild/index.mjs +1 -2
- package/dist/esm/handlers.mjs +1 -2
- package/dist/esm/handlers.mjs.map +1 -1
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/plugin/index.mjs +1 -2
- package/dist/esm/providers.mjs +2 -3
- package/dist/esm/registryLookup.mjs +1 -2
- package/dist/esm/standalone.mjs +1 -2
- package/dist/esm/translateBlockDirective.mjs +1 -2
- package/dist/esm/translateDirective.mjs +2 -3
- package/dist/esm/translatePipe.mjs +2 -3
- package/dist/esm/translateService.mjs +3 -4
- package/dist/esm/translateStore.mjs +1 -2
- package/dist/esm/util.mjs +1 -2
- package/dist/types/esbuild/index.d.ts +0 -2
- package/dist/types/esbuild/index.d.ts.map +1 -1
- package/dist/types/handlers.d.ts +0 -2
- package/dist/types/handlers.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/partialDeclarations.d.ts +1 -2
- package/dist/types/partialDeclarations.d.ts.map +1 -1
- package/dist/types/plugin/index.d.ts +0 -2
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/providers.d.ts +2 -3
- package/dist/types/providers.d.ts.map +1 -1
- package/dist/types/registryLookup.d.ts +0 -2
- package/dist/types/registryLookup.d.ts.map +1 -1
- package/dist/types/standalone.d.ts +0 -2
- package/dist/types/standalone.d.ts.map +1 -1
- package/dist/types/translateBlockDirective.d.ts +0 -2
- package/dist/types/translateBlockDirective.d.ts.map +1 -1
- package/dist/types/translateDirective.d.ts +0 -2
- package/dist/types/translateDirective.d.ts.map +1 -1
- package/dist/types/translatePipe.d.ts +0 -2
- package/dist/types/translatePipe.d.ts.map +1 -1
- package/dist/types/translateService.d.ts +2 -3
- package/dist/types/translateService.d.ts.map +1 -1
- package/dist/types/translateStore.d.ts +0 -2
- package/dist/types/translateStore.d.ts.map +1 -1
- package/dist/types/types.d.ts +0 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/util.d.ts +1 -2
- package/dist/types/util.d.ts.map +1 -1
- package/package.json +33 -33
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { intlayerEsbuildPlugin } from "angular-intlayer/esbuild";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/esbuild/index.ts
|
|
4
4
|
/** Imports rewritten to the adapter. */
|
|
5
5
|
const NGX_TRANSLATE_IMPORT_FILTER = /^@ngx-translate\/core$/;
|
|
6
6
|
/** The adapter module every `@ngx-translate/core` import resolves to. */
|
|
@@ -38,6 +38,5 @@ const ngxTranslateEsbuildPlugin = (options) => {
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
export { ngxTranslateEsbuildPlugin as default, ngxTranslateEsbuildPlugin };
|
|
43
42
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/handlers.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { getValue, isDefinedAndNotNull, isFunction, isString } from "./util.mjs"
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import { of } from "rxjs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/handlers.ts
|
|
6
6
|
/** Handles a key missing from every translation source. */
|
|
7
7
|
var MissingTranslationHandler = class {};
|
|
8
8
|
/** Returns the key itself, ngx-translate's default. */
|
|
@@ -111,6 +111,5 @@ var TranslateDefaultParser = class TranslateDefaultParser extends TranslateParse
|
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
//#endregion
|
|
115
114
|
export { DefaultMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateLoader, TranslateNoOpCompiler, TranslateNoOpLoader, TranslateParser };
|
|
116
115
|
//# sourceMappingURL=handlers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.mjs","names":[],"sources":["../../src/handlers.ts"],"sourcesContent":["import * as i0 from '@angular/core';\nimport { type Observable, of } from 'rxjs';\nimport type {\n FactoryDeclaration,\n InjectableDeclaration,\n} from './partialDeclarations';\nimport type {\n InterpolatableTranslation,\n InterpolatableTranslationObject,\n InterpolateFunction,\n InterpolationParameters,\n MissingTranslationHandlerParams,\n StrictTranslation,\n TranslationObject,\n} from './types';\nimport { getValue, isDefinedAndNotNull, isFunction, isString } from './util';\n\n/*\n * Angular metadata is written as partial declarations (`ɵɵngDeclare*`), the\n * format ngx-translate itself ships: the application build links them to the\n * user's Angular version, so no JIT compiler is needed at runtime.\n */\n\n/** Handles a key missing from every translation source. */\nexport abstract class MissingTranslationHandler {\n abstract handle(\n params: MissingTranslationHandlerParams\n ): StrictTranslation | Observable<StrictTranslation> | undefined;\n}\n\n/** Returns the key itself, ngx-translate's default. */\nexport class DefaultMissingTranslationHandler
|
|
1
|
+
{"version":3,"file":"handlers.mjs","names":[],"sources":["../../src/handlers.ts"],"sourcesContent":["import * as i0 from '@angular/core';\nimport { type Observable, of } from 'rxjs';\nimport type {\n FactoryDeclaration,\n InjectableDeclaration,\n} from './partialDeclarations';\nimport type {\n InterpolatableTranslation,\n InterpolatableTranslationObject,\n InterpolateFunction,\n InterpolationParameters,\n MissingTranslationHandlerParams,\n StrictTranslation,\n TranslationObject,\n} from './types';\nimport { getValue, isDefinedAndNotNull, isFunction, isString } from './util';\n\n/*\n * Angular metadata is written as partial declarations (`ɵɵngDeclare*`), the\n * format ngx-translate itself ships: the application build links them to the\n * user's Angular version, so no JIT compiler is needed at runtime.\n */\n\n/** Handles a key missing from every translation source. */\nexport abstract class MissingTranslationHandler {\n abstract handle(\n params: MissingTranslationHandlerParams\n ): StrictTranslation | Observable<StrictTranslation> | undefined;\n}\n\n/** Returns the key itself, ngx-translate's default. */\nexport class DefaultMissingTranslationHandler implements MissingTranslationHandler {\n handle(params: MissingTranslationHandlerParams): string {\n return params.key;\n }\n\n static ɵfac: i0.ɵɵFactoryDeclaration<\n DefaultMissingTranslationHandler,\n never\n > = i0.ɵɵngDeclareFactory({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: DefaultMissingTranslationHandler,\n deps: [],\n target: i0.ɵɵFactoryTarget.Injectable,\n } as FactoryDeclaration) as never;\n static ɵprov: i0.ɵɵInjectableDeclaration<DefaultMissingTranslationHandler> =\n i0.ɵɵngDeclareInjectable({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: DefaultMissingTranslationHandler,\n } as InjectableDeclaration) as never;\n}\n\n/** Compiles runtime translations registered through `setTranslation()`. */\nexport abstract class TranslateCompiler {\n abstract compile(value: string, lang: string): InterpolatableTranslation;\n abstract compileTranslations(\n translations: TranslationObject,\n lang: string\n ): InterpolatableTranslationObject;\n}\n\nexport class TranslateNoOpCompiler extends TranslateCompiler {\n compile(value: string, _lang: string): string {\n return value;\n }\n\n compileTranslations(\n translations: TranslationObject,\n _lang: string\n ): InterpolatableTranslationObject {\n return translations as InterpolatableTranslationObject;\n }\n\n static ɵfac: i0.ɵɵFactoryDeclaration<TranslateNoOpCompiler, never> =\n i0.ɵɵngDeclareFactory({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: TranslateNoOpCompiler,\n deps: [],\n target: i0.ɵɵFactoryTarget.Injectable,\n } as FactoryDeclaration) as never;\n static ɵprov: i0.ɵɵInjectableDeclaration<TranslateNoOpCompiler> =\n i0.ɵɵngDeclareInjectable({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: TranslateNoOpCompiler,\n } as InjectableDeclaration) as never;\n}\n\n/**\n * Loads runtime translations for a language. Intlayer dictionaries need no\n * loader; one is only called for catalogs kept outside intlayer.\n */\nexport abstract class TranslateLoader {\n abstract getTranslation(lang: string): Observable<TranslationObject>;\n}\n\nexport class TranslateNoOpLoader extends TranslateLoader {\n getTranslation(_lang: string): Observable<TranslationObject> {\n return of({});\n }\n\n static ɵfac: i0.ɵɵFactoryDeclaration<TranslateNoOpLoader, never> =\n i0.ɵɵngDeclareFactory({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: TranslateNoOpLoader,\n deps: [],\n target: i0.ɵɵFactoryTarget.Injectable,\n } as FactoryDeclaration) as never;\n static ɵprov: i0.ɵɵInjectableDeclaration<TranslateNoOpLoader> =\n i0.ɵɵngDeclareInjectable({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: TranslateNoOpLoader,\n } as InjectableDeclaration) as never;\n}\n\n/** Interpolates parameters into a translation. */\nexport abstract class TranslateParser {\n abstract interpolate(\n expression: InterpolatableTranslation,\n params?: InterpolationParameters\n ): string | undefined;\n}\n\n/** `{{ name }}` / `{{ user.name }}` interpolation, like ngx-translate. */\nexport class TranslateDefaultParser extends TranslateParser {\n templateMatcher = /{{\\s?([^{}\\s]*)\\s?}}/g;\n\n interpolate(\n expression: InterpolatableTranslation,\n params?: InterpolationParameters\n ): string | undefined {\n if (isString(expression)) {\n return this.interpolateString(expression, params);\n }\n if (isFunction(expression)) {\n return (expression as InterpolateFunction)(params);\n }\n return undefined;\n }\n\n protected interpolateString(\n expression: string,\n params?: InterpolationParameters\n ): string {\n if (!params) return expression;\n\n return expression.replace(\n this.templateMatcher,\n (substring, key: string) => {\n const replacement = this.formatValue(getValue(params, key));\n return replacement ?? substring;\n }\n );\n }\n\n protected formatValue(value: unknown): string | undefined {\n if (isString(value)) return value;\n if (typeof value === 'number' || typeof value === 'boolean') {\n return value.toString();\n }\n if (!isDefinedAndNotNull(value)) return undefined;\n\n const text = String(value);\n return text === '[object Object]' ? JSON.stringify(value) : text;\n }\n\n static ɵfac: i0.ɵɵFactoryDeclaration<TranslateDefaultParser, never> =\n i0.ɵɵngDeclareFactory({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: TranslateDefaultParser,\n deps: [],\n target: i0.ɵɵFactoryTarget.Injectable,\n } as FactoryDeclaration) as never;\n static ɵprov: i0.ɵɵInjectableDeclaration<TranslateDefaultParser> =\n i0.ɵɵngDeclareInjectable({\n minVersion: '12.0.0',\n version: '17.0.0',\n ngImport: i0,\n type: TranslateDefaultParser,\n } as InjectableDeclaration) as never;\n}\n"],"mappings":";;;;;;AAwBA,IAAsB,4BAAtB,MAAgD,CAIhD;;AAGA,IAAa,mCAAb,MAAa,iCAAsE;CACjF,OAAO,QAAiD;EACtD,OAAO,OAAO;CAChB;CAEA,OAAO,OAGH,GAAG,mBAAmB;EACxB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;EACN,MAAM,CAAC;EACP,QAAQ,GAAG,gBAAgB;CAC7B,CAAuB;CACvB,OAAO,QACL,GAAG,sBAAsB;EACvB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;CACR,CAA0B;AAC9B;;AAGA,IAAsB,oBAAtB,MAAwC,CAMxC;AAEA,IAAa,wBAAb,MAAa,8BAA8B,kBAAkB;CAC3D,QAAQ,OAAe,OAAuB;EAC5C,OAAO;CACT;CAEA,oBACE,cACA,OACiC;EACjC,OAAO;CACT;CAEA,OAAO,OACL,GAAG,mBAAmB;EACpB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;EACN,MAAM,CAAC;EACP,QAAQ,GAAG,gBAAgB;CAC7B,CAAuB;CACzB,OAAO,QACL,GAAG,sBAAsB;EACvB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;CACR,CAA0B;AAC9B;;;;;AAMA,IAAsB,kBAAtB,MAAsC,CAEtC;AAEA,IAAa,sBAAb,MAAa,4BAA4B,gBAAgB;CACvD,eAAe,OAA8C;EAC3D,OAAO,GAAG,CAAC,CAAC;CACd;CAEA,OAAO,OACL,GAAG,mBAAmB;EACpB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;EACN,MAAM,CAAC;EACP,QAAQ,GAAG,gBAAgB;CAC7B,CAAuB;CACzB,OAAO,QACL,GAAG,sBAAsB;EACvB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;CACR,CAA0B;AAC9B;;AAGA,IAAsB,kBAAtB,MAAsC,CAKtC;;AAGA,IAAa,yBAAb,MAAa,+BAA+B,gBAAgB;CAC1D,kBAAkB;CAElB,YACE,YACA,QACoB;EACpB,IAAI,SAAS,UAAU,GACrB,OAAO,KAAK,kBAAkB,YAAY,MAAM;EAElD,IAAI,WAAW,UAAU,GACvB,OAAQ,WAAmC,MAAM;CAGrD;CAEA,AAAU,kBACR,YACA,QACQ;EACR,IAAI,CAAC,QAAQ,OAAO;EAEpB,OAAO,WAAW,QAChB,KAAK,kBACJ,WAAW,QAAgB;GAE1B,OADoB,KAAK,YAAY,SAAS,QAAQ,GAAG,CACxC,KAAK;EACxB,CACF;CACF;CAEA,AAAU,YAAY,OAAoC;EACxD,IAAI,SAAS,KAAK,GAAG,OAAO;EAC5B,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAChD,OAAO,MAAM,SAAS;EAExB,IAAI,CAAC,oBAAoB,KAAK,GAAG,OAAO;EAExC,MAAM,OAAO,OAAO,KAAK;EACzB,OAAO,SAAS,oBAAoB,KAAK,UAAU,KAAK,IAAI;CAC9D;CAEA,OAAO,OACL,GAAG,mBAAmB;EACpB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;EACN,MAAM,CAAC;EACP,QAAQ,GAAG,gBAAgB;CAC7B,CAAuB;CACzB,OAAO,QACL,GAAG,sBAAsB;EACvB,YAAY;EACZ,SAAS;EACT,UAAU;EACV,MAAM;CACR,CAA0B;AAC9B"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { equals, getValue, insertValue, isArray, isDefined, isDefinedAndNotNull, isDict, isFunction, isObject, isString, mergeDeep } from "./util.mjs";
|
|
2
1
|
import { DefaultMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateLoader, TranslateNoOpCompiler, TranslateNoOpLoader, TranslateParser } from "./handlers.mjs";
|
|
3
|
-
import { TranslateStore } from "./translateStore.mjs";
|
|
4
|
-
import { ITranslateService, TRANSLATE_SERVICE_CONFIG, TranslateService } from "./translateService.mjs";
|
|
5
|
-
import { TranslateDirective } from "./translateDirective.mjs";
|
|
6
2
|
import { provideChildTranslateService, provideMissingTranslationHandler, provideTranslateCompiler, provideTranslateLoader, provideTranslateParser, provideTranslateService } from "./providers.mjs";
|
|
7
3
|
import { _, translate } from "./standalone.mjs";
|
|
8
4
|
import { TranslateBlockContext, TranslateBlockDirective } from "./translateBlockDirective.mjs";
|
|
5
|
+
import { TranslateDirective } from "./translateDirective.mjs";
|
|
9
6
|
import { TranslatePipe } from "./translatePipe.mjs";
|
|
7
|
+
import { ITranslateService, TRANSLATE_SERVICE_CONFIG, TranslateService } from "./translateService.mjs";
|
|
8
|
+
import { TranslateStore } from "./translateStore.mjs";
|
|
9
|
+
import { equals, getValue, insertValue, isArray, isDefined, isDefinedAndNotNull, isDict, isFunction, isObject, isString, mergeDeep } from "./util.mjs";
|
|
10
10
|
|
|
11
11
|
export { DefaultMissingTranslationHandler, ITranslateService, MissingTranslationHandler, TRANSLATE_SERVICE_CONFIG, TranslateBlockContext, TranslateBlockDirective, TranslateCompiler, TranslateDefaultParser, TranslateDirective, TranslateLoader, TranslateNoOpCompiler, TranslateNoOpLoader, TranslateParser, TranslatePipe, TranslateService, TranslateStore, _, equals, getValue, insertValue, isArray, isDefined, isDefinedAndNotNull, isDict, isFunction, isObject, isString, mergeDeep, provideChildTranslateService, provideMissingTranslationHandler, provideTranslateCompiler, provideTranslateLoader, provideTranslateParser, provideTranslateService, translate };
|
|
@@ -6,7 +6,7 @@ import { getConfiguration } from "@intlayer/config/node";
|
|
|
6
6
|
import { runOnce } from "@intlayer/engine/utils";
|
|
7
7
|
import { intlayer } from "vite-intlayer";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/plugin/index.ts
|
|
10
10
|
/**
|
|
11
11
|
* ngx-translate callers as the field-usage analysis must see them.
|
|
12
12
|
*
|
|
@@ -44,6 +44,5 @@ const ngxTranslateVitePlugin = (options) => {
|
|
|
44
44
|
return [...Array.isArray(basePlugins) ? basePlugins : [basePlugins], compatPlugin];
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
//#endregion
|
|
48
47
|
export { NGX_TRANSLATE_BUILD_CALLERS, ngxTranslateVitePlugin as default, ngxTranslateVitePlugin };
|
|
49
48
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/providers.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DefaultMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateLoader, TranslateNoOpCompiler, TranslateNoOpLoader, TranslateParser } from "./handlers.mjs";
|
|
2
|
-
import { TranslateStore } from "./translateStore.mjs";
|
|
3
2
|
import { TRANSLATE_SERVICE_CONFIG, TranslateService } from "./translateService.mjs";
|
|
3
|
+
import { TranslateStore } from "./translateStore.mjs";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/providers.ts
|
|
6
6
|
/** Whether a function is a class constructor rather than a factory. */
|
|
7
7
|
const isClass = (value) => typeof value === "function" && /^class\s/.test(Function.prototype.toString.call(value));
|
|
8
8
|
const toProvider = (token, value) => isClass(value) ? {
|
|
@@ -48,6 +48,5 @@ const provideTranslateService = (config = {}) => createProviders(config);
|
|
|
48
48
|
*/
|
|
49
49
|
const provideChildTranslateService = (config = {}) => createProviders(config);
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
export { provideChildTranslateService, provideMissingTranslationHandler, provideTranslateCompiler, provideTranslateLoader, provideTranslateParser, provideTranslateService };
|
|
53
52
|
//# sourceMappingURL=providers.mjs.map
|
|
@@ -2,7 +2,7 @@ import { navigatePath } from "@intlayer/core/messageFormat";
|
|
|
2
2
|
import { getIntlayer } from "@intlayer/core/interpreter";
|
|
3
3
|
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/registryLookup.ts
|
|
6
6
|
/**
|
|
7
7
|
* Registry-backed key resolution. The only module touching
|
|
8
8
|
* `@intlayer/dictionaries-entry`, which statically imports every dictionary.
|
|
@@ -47,6 +47,5 @@ const lookupRegistryTranslation = (key, locale) => {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { lookupRegistryTranslation };
|
|
52
51
|
//# sourceMappingURL=registryLookup.mjs.map
|
package/dist/esm/standalone.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TranslateService } from "./translateService.mjs";
|
|
2
2
|
import { inject } from "@angular/core";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/standalone.ts
|
|
5
5
|
/**
|
|
6
6
|
* Signal of a translation, updated on language change. Must run in an
|
|
7
7
|
* injection context.
|
|
@@ -22,6 +22,5 @@ const translate = (key, params, lang) => inject(TranslateService).translate(key,
|
|
|
22
22
|
*/
|
|
23
23
|
const _ = (key) => key;
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { _, translate };
|
|
27
26
|
//# sourceMappingURL=standalone.mjs.map
|
|
@@ -2,7 +2,7 @@ import { TranslateService } from "./translateService.mjs";
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import { TemplateRef, ViewContainerRef, inject } from "@angular/core";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/translateBlockDirective.ts
|
|
6
6
|
/** Template context of `*translateBlock="let t"`. */
|
|
7
7
|
var TranslateBlockContext = class {
|
|
8
8
|
$implicit;
|
|
@@ -42,6 +42,5 @@ var TranslateBlockDirective = class TranslateBlockDirective {
|
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
export { TranslateBlockContext, TranslateBlockDirective };
|
|
47
46
|
//# sourceMappingURL=translateBlockDirective.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { equals, isString } from "./util.mjs";
|
|
2
1
|
import { TranslateService } from "./translateService.mjs";
|
|
2
|
+
import { equals, isString } from "./util.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { ElementRef, Injector, effect, inject, signal } from "@angular/core";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/translateDirective.ts
|
|
7
7
|
/**
|
|
8
8
|
* `<p [translate]="'home.title'" [translateParams]="{ name }"></p>` or
|
|
9
9
|
* `<p translate>home.title</p>` — writes the translation as text content.
|
|
@@ -61,6 +61,5 @@ var TranslateDirective = class TranslateDirective {
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
//#endregion
|
|
65
64
|
export { TranslateDirective };
|
|
66
65
|
//# sourceMappingURL=translateDirective.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { equals, isDict, isString } from "./util.mjs";
|
|
2
1
|
import { TranslateService } from "./translateService.mjs";
|
|
2
|
+
import { equals, isDict, isString } from "./util.mjs";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
import { inject } from "@angular/core";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/translatePipe.ts
|
|
7
7
|
/**
|
|
8
8
|
* `{{ 'home.title' | translate: { name } }}` — impure pipe reading a
|
|
9
9
|
* translation signal, so the view refreshes on language change.
|
|
@@ -55,6 +55,5 @@ var TranslatePipe = class TranslatePipe {
|
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
//#endregion
|
|
59
58
|
export { TranslatePipe };
|
|
60
59
|
//# sourceMappingURL=translatePipe.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { insertValue, isDict, isString } from "./util.mjs";
|
|
2
1
|
import { MissingTranslationHandler, TranslateCompiler, TranslateLoader, TranslateNoOpLoader, TranslateParser } from "./handlers.mjs";
|
|
3
2
|
import { lookupRegistryTranslation } from "./registryLookup.mjs";
|
|
4
3
|
import { TranslateStore } from "./translateStore.mjs";
|
|
5
|
-
import {
|
|
4
|
+
import { insertValue, isDict, isString } from "./util.mjs";
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
7
6
|
import { InjectionToken, computed, inject, signal, untracked } from "@angular/core";
|
|
8
7
|
import { internationalization } from "@intlayer/config/built";
|
|
8
|
+
import { resolveMessageNodeToString } from "@intlayer/core/messageFormat";
|
|
9
9
|
import { createIntlayerClient } from "angular-intlayer";
|
|
10
10
|
import { Subject, isObservable, map, merge, of, startWith } from "rxjs";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/translateService.ts
|
|
13
13
|
/** Resolved `provideTranslateService()` options. */
|
|
14
14
|
const TRANSLATE_SERVICE_CONFIG = new InjectionToken("TRANSLATE_SERVICE_CONFIG");
|
|
15
15
|
/** Resolves a plain value or a function / signal returning it. */
|
|
@@ -219,6 +219,5 @@ var TranslateService = class TranslateService extends ITranslateService {
|
|
|
219
219
|
});
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
//#endregion
|
|
223
222
|
export { ITranslateService, TRANSLATE_SERVICE_CONFIG, TranslateService };
|
|
224
223
|
//# sourceMappingURL=translateService.mjs.map
|
|
@@ -3,7 +3,7 @@ import * as i0 from "@angular/core";
|
|
|
3
3
|
import { signal } from "@angular/core";
|
|
4
4
|
import { Subject } from "rxjs";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/translateStore.ts
|
|
7
7
|
/**
|
|
8
8
|
* Runtime translations registered through `setTranslation()` / a loader.
|
|
9
9
|
* Intlayer dictionaries are resolved separately and never copied here.
|
|
@@ -48,6 +48,5 @@ var TranslateStore = class TranslateStore {
|
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
export { TranslateStore };
|
|
53
52
|
//# sourceMappingURL=translateStore.mjs.map
|
package/dist/esm/util.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { navigatePath } from "@intlayer/core/messageFormat";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/util.ts
|
|
4
4
|
const isDefined = (value) => typeof value !== "undefined";
|
|
5
5
|
const isDefinedAndNotNull = (value) => typeof value !== "undefined" && value !== null;
|
|
6
6
|
const isObject = (value) => typeof value === "object" && value !== null;
|
|
@@ -39,6 +39,5 @@ const insertValue = (target, key, value) => {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { equals, getValue, insertValue, isArray, isDefined, isDefinedAndNotNull, isDict, isFunction, isObject, isString, mergeDeep };
|
|
44
43
|
//# sourceMappingURL=util.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EsbuildPlugin, IntlayerEsbuildPluginOptions } from "angular-intlayer/esbuild";
|
|
2
|
-
//#region src/esbuild/index.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* esbuild plugin for the Angular CLI (`@angular-builders/custom-esbuild`):
|
|
5
4
|
* sets up angular-intlayer's build integration and resolves
|
|
@@ -18,6 +17,5 @@ import { EsbuildPlugin, IntlayerEsbuildPluginOptions } from "angular-intlayer/es
|
|
|
18
17
|
* ```
|
|
19
18
|
*/
|
|
20
19
|
export declare const ngxTranslateEsbuildPlugin: (options?: IntlayerEsbuildPluginOptions) => EsbuildPlugin;
|
|
21
|
-
//#endregion
|
|
22
20
|
export { ngxTranslateEsbuildPlugin as default };
|
|
23
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/esbuild/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/esbuild/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBA6Ba,4BAAyB,UAC1B,iCACT"}
|
package/dist/types/handlers.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { InterpolatableTranslation, InterpolatableTranslationObject, InterpolationParameters, MissingTranslationHandlerParams, StrictTranslation, TranslationObject } from "./types.js";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
|
-
//#region src/handlers.d.ts
|
|
5
4
|
/** Handles a key missing from every translation source. */
|
|
6
5
|
export declare abstract class MissingTranslationHandler {
|
|
7
6
|
abstract handle(params: MissingTranslationHandlerParams): StrictTranslation | Observable<StrictTranslation> | undefined;
|
|
@@ -48,5 +47,4 @@ export declare class TranslateDefaultParser extends TranslateParser {
|
|
|
48
47
|
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateDefaultParser, never>;
|
|
49
48
|
static ɵprov: i0.ɵɵInjectableDeclaration<TranslateDefaultParser>;
|
|
50
49
|
}
|
|
51
|
-
//#endregion
|
|
52
50
|
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","names":[],"sources":["../../src/handlers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","names":[],"sources":["../../src/handlers.ts"],"mappings":";;;;8BAwBsB;WACX,OACP,QAAQ,kCACP,oBAAoB,WAAW;;;qBAIvB,4CAA4C;EACvD,OAAO,QAAQ;SAIR,MAAM,GAAG,qBACd;SAUK,OAAO,GAAG,wBAAwB;;;8BAUrB;WACX,QAAQ,eAAe,eAAe;WACtC,oBACP,cAAc,mBACd,eACC;;qBAGQ,8BAA8B;EACzC,QAAQ,eAAe;EAIvB,oBACE,cAAc,mBACd,gBACC;SAII,MAAM,GAAG,qBAAqB;SAS9B,OAAO,GAAG,wBAAwB;;;;;;8BAarB;WACX,eAAe,eAAe,WAAW;;qBAGvC,4BAA4B;EACvC,eAAe,gBAAgB,WAAW;SAInC,MAAM,GAAG,qBAAqB;SAS9B,OAAO,GAAG,wBAAwB;;;8BAUrB;WACX,YACP,YAAY,2BACZ,SAAS;;;qBAKA,+BAA+B;EAC1C,iBAAe;EAEf,YACE,YAAY,2BACZ,SAAS;YAWD,kBACR,oBACA,SAAS;YAaD,YAAY;SAWf,MAAM,GAAG,qBAAqB;SAS9B,OAAO,GAAG,wBAAwB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ChildTranslateServiceConfig, DeepReadonly, DefaultLangChangeEvent, FallbackLangChangeEvent, InterpolatableTranslation, InterpolatableTranslationObject, InterpolateFunction, InterpolationParameters, LangChangeEvent, Language, MissingTranslationHandlerParams, RootTranslateServiceConfig, StrictTranslation, TranslateProvider, TranslateProviders, TranslateServiceConfig, Translation, TranslationChangeEvent, TranslationObject } from "./types.js";
|
|
2
1
|
import { DefaultMissingTranslationHandler, MissingTranslationHandler, TranslateCompiler, TranslateDefaultParser, TranslateLoader, TranslateNoOpCompiler, TranslateNoOpLoader, TranslateParser } from "./handlers.js";
|
|
3
2
|
import { provideChildTranslateService, provideMissingTranslationHandler, provideTranslateCompiler, provideTranslateLoader, provideTranslateParser, provideTranslateService } from "./providers.js";
|
|
4
3
|
import { _, translate } from "./standalone.js";
|
|
5
4
|
import { TranslateBlockContext, TranslateBlockDirective } from "./translateBlockDirective.js";
|
|
6
5
|
import { TranslateDirective } from "./translateDirective.js";
|
|
7
6
|
import { TranslatePipe } from "./translatePipe.js";
|
|
8
|
-
import { TranslateStore } from "./translateStore.js";
|
|
9
7
|
import { ITranslateService, TRANSLATE_SERVICE_CONFIG, TranslateService } from "./translateService.js";
|
|
8
|
+
import { TranslateStore } from "./translateStore.js";
|
|
9
|
+
import { ChildTranslateServiceConfig, DeepReadonly, DefaultLangChangeEvent, FallbackLangChangeEvent, InterpolatableTranslation, InterpolatableTranslationObject, InterpolateFunction, InterpolationParameters, LangChangeEvent, Language, MissingTranslationHandlerParams, RootTranslateServiceConfig, StrictTranslation, TranslateProvider, TranslateProviders, TranslateServiceConfig, Translation, TranslationChangeEvent, TranslationObject } from "./types.js";
|
|
10
10
|
import { equals, getValue, insertValue, isArray, isDefined, isDefinedAndNotNull, isDict, isFunction, isObject, isString, mergeDeep } from "./util.js";
|
|
11
11
|
export { type ChildTranslateServiceConfig, type DeepReadonly, type DefaultLangChangeEvent, DefaultMissingTranslationHandler, type FallbackLangChangeEvent, ITranslateService, type InterpolatableTranslation, type InterpolatableTranslationObject, type InterpolateFunction, type InterpolationParameters, type LangChangeEvent, type Language, MissingTranslationHandler, type MissingTranslationHandlerParams, type RootTranslateServiceConfig, type StrictTranslation, TRANSLATE_SERVICE_CONFIG, TranslateBlockContext, TranslateBlockDirective, TranslateCompiler, TranslateDefaultParser, TranslateDirective, TranslateLoader, TranslateNoOpCompiler, TranslateNoOpLoader, TranslateParser, TranslatePipe, type TranslateProvider, type TranslateProviders, TranslateService, type TranslateServiceConfig, TranslateStore, type Translation, type TranslationChangeEvent, type TranslationObject, _, equals, getValue, insertValue, isArray, isDefined, isDefinedAndNotNull, isDict, isFunction, isObject, isString, mergeDeep, provideChildTranslateService, provideMissingTranslationHandler, provideTranslateCompiler, provideTranslateLoader, provideTranslateParser, provideTranslateService, translate };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
//#region src/partialDeclarations.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Argument types of Angular's partial-declaration functions.
|
|
5
4
|
*
|
|
@@ -14,5 +13,5 @@ export type FactoryDeclaration = WithMinVersion<Parameters<typeof i0.ɵɵngDecla
|
|
|
14
13
|
export type InjectableDeclaration = WithMinVersion<Parameters<typeof i0.ɵɵngDeclareInjectable>[0]>;
|
|
15
14
|
export type PipeDeclaration = WithMinVersion<Parameters<typeof i0.ɵɵngDeclarePipe>[0]>;
|
|
16
15
|
export type DirectiveDeclaration = WithMinVersion<Parameters<typeof i0.ɵɵngDeclareDirective>[0]>;
|
|
17
|
-
|
|
16
|
+
export {};
|
|
18
17
|
//# sourceMappingURL=partialDeclarations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partialDeclarations.d.ts","names":[],"sources":["../../src/partialDeclarations.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"partialDeclarations.d.ts","names":[],"sources":["../../src/partialDeclarations.ts"],"mappings":";;;;;;;;KASK,eAAe,KAAK;EAAM;;YAEnB,qBAAqB,eAC/B,kBAAkB,GAAG;YAEX,wBAAwB,eAClC,kBAAkB,GAAG;YAEX,kBAAkB,eAC5B,kBAAkB,GAAG;YAEX,uBAAuB,eACjC,kBAAkB,GAAG"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CallerDescriptor } from "@intlayer/config/callers";
|
|
2
2
|
import { PluginOption } from "vite";
|
|
3
3
|
import { intlayer } from "vite-intlayer";
|
|
4
|
-
//#region src/plugin/index.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* ngx-translate callers as the field-usage analysis must see them.
|
|
7
6
|
*
|
|
@@ -20,6 +19,5 @@ export declare const NGX_TRANSLATE_BUILD_CALLERS: CallerDescriptor[];
|
|
|
20
19
|
* Angular CLI apps use `@intlayer/ngx-translate/esbuild` instead.
|
|
21
20
|
*/
|
|
22
21
|
export declare const ngxTranslateVitePlugin: (options?: Parameters<typeof intlayer>[0]) => PluginOption[];
|
|
23
|
-
//#endregion
|
|
24
22
|
export { ngxTranslateVitePlugin as default };
|
|
25
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugin/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugin/index.ts"],"mappings":";;;;;;;;;;;;;qBAsBa,6BAA6B;;;;;;;qBAY7B,yBAAsB,UACvB,kBAAkB,iBAC3B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { ChildTranslateServiceConfig, RootTranslateServiceConfig } from "./types.js";
|
|
2
1
|
import { MissingTranslationHandler, TranslateCompiler, TranslateLoader, TranslateParser } from "./handlers.js";
|
|
2
|
+
import { ChildTranslateServiceConfig, RootTranslateServiceConfig } from "./types.js";
|
|
3
3
|
import { Provider, Type } from "@angular/core";
|
|
4
|
-
//#region src/providers.d.ts
|
|
5
4
|
/** A class to instantiate, or a factory returning the instance. */
|
|
6
5
|
type ClassOrFactory<T> = Type<T> | (() => T);
|
|
7
6
|
export declare const provideTranslateLoader: (loader: ClassOrFactory<TranslateLoader>) => Provider;
|
|
@@ -18,5 +17,5 @@ export declare const provideTranslateService: (config?: RootTranslateServiceConf
|
|
|
18
17
|
* intlayer's locale, so a child service only scopes runtime translations.
|
|
19
18
|
*/
|
|
20
19
|
export declare const provideChildTranslateService: (config?: ChildTranslateServiceConfig) => Provider[];
|
|
21
|
-
|
|
20
|
+
export {};
|
|
22
21
|
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","names":[],"sources":["../../src/providers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"providers.d.ts","names":[],"sources":["../../src/providers.ts"],"mappings":";;;;KAoBK,eAAe,KAAK,KAAK,YAAY;qBAe7B,yBAAsB,QACzB,eAAe,qBACtB;qBAEU,2BAAwB,UACzB,eAAe,uBACxB;qBAEU,yBAAsB,QACzB,eAAe,qBACtB;qBAEU,mCAAgC,SAClC,eAAe,+BACvB;;;;;qBA0CU,0BAAuB,SAC1B,+BACP;;;;;qBAMU,+BAA4B,SAC/B,gCACP"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/registryLookup.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Looks up an ngx-translate key across the intlayer dictionaries:
|
|
4
3
|
*
|
|
@@ -9,5 +8,4 @@
|
|
|
9
8
|
* @returns The interpreted node (string, object or callable), or `undefined`.
|
|
10
9
|
*/
|
|
11
10
|
export declare const lookupRegistryTranslation: (key: string, locale: string) => unknown;
|
|
12
|
-
//#endregion
|
|
13
11
|
//# sourceMappingURL=registryLookup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registryLookup.d.ts","names":[],"sources":["../../src/registryLookup.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"registryLookup.d.ts","names":[],"sources":["../../src/registryLookup.ts"],"mappings":";;;;;;;;;qBAuCa,4BAAyB,aACzB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InterpolationParameters, Language, Translation } from "./types.js";
|
|
2
2
|
import { Signal } from "@angular/core";
|
|
3
|
-
//#region src/standalone.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Signal of a translation, updated on language change. Must run in an
|
|
6
5
|
* injection context.
|
|
@@ -20,5 +19,4 @@ export declare const translate: (key: string | string[] | (() => string | string
|
|
|
20
19
|
* ```
|
|
21
20
|
*/
|
|
22
21
|
export declare const _: <T extends string | string[]>(key: T) => T;
|
|
23
|
-
//#endregion
|
|
24
22
|
//# sourceMappingURL=standalone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone.d.ts","names":[],"sources":["../../src/standalone.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"standalone.d.ts","names":[],"sources":["../../src/standalone.ts"],"mappings":";;;;;;;;;;;qBAaa,YAAS,oDAC8B,SAE9C,iCACO,sCAAoC,OACxC,kBAAkB,0BACxB,OAAO;;;;;;;;;qBAUG,IAAK,6BAA2B,KAAO,MAAI"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InterpolationParameters, Translation } from "./types.js";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
//#region src/translateBlockDirective.d.ts
|
|
4
3
|
/** Template context of `*translateBlock="let t"`. */
|
|
5
4
|
export declare class TranslateBlockContext {
|
|
6
5
|
$implicit: (key: string, params?: InterpolationParameters) => Translation;
|
|
@@ -19,5 +18,4 @@ export declare class TranslateBlockDirective {
|
|
|
19
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateBlockDirective, never>;
|
|
20
19
|
static ɵdir: i0.ɵɵDirectiveDeclaration<TranslateBlockDirective, '[translateBlock]', never, {}, {}, never, never, true, never>;
|
|
21
20
|
}
|
|
22
|
-
//#endregion
|
|
23
21
|
//# sourceMappingURL=translateBlockDirective.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateBlockDirective.d.ts","names":[],"sources":["../../src/translateBlockDirective.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translateBlockDirective.d.ts","names":[],"sources":["../../src/translateBlockDirective.ts"],"mappings":";;;qBAUa;EAEF,YACL,aACA,SAAS,4BACN;EAJP,YACS,YACL,aACA,SAAS,4BACN;;;;;;qBAQI;mBACM;mBAEA;mBACA;EAEjB;SASO,uBACL,YAAY,yBACZ,oBACC,YAAY;SAIR,MAAM,GAAG,qBAAqB;SAS9B,MAAM,GAAG,uBACd"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InterpolationParameters } from "./types.js";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
//#region src/translateDirective.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* `<p [translate]="'home.title'" [translateParams]="{ name }"></p>` or
|
|
6
5
|
* `<p translate>home.title</p>` — writes the translation as text content.
|
|
@@ -29,5 +28,4 @@ export declare class TranslateDirective {
|
|
|
29
28
|
};
|
|
30
29
|
}, {}, never, never, true, never>;
|
|
31
30
|
}
|
|
32
|
-
//#endregion
|
|
33
31
|
//# sourceMappingURL=translateDirective.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateDirective.d.ts","names":[],"sources":["../../src/translateDirective.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translateDirective.d.ts","names":[],"sources":["../../src/translateDirective.ts"],"mappings":";;;;;;qBAsBa;mBACM;mBACA;mBACA;mBAEA;mBAEA;UAGT;MAEJ,UAAU;MAMV,gBAAgB,QAAQ;;EAK5B;UAUQ;SAqBD,MAAM,GAAG,qBAAqB;SAS9B,MAAM,GAAG,uBACd;IAIE;MAAa;MAAoB;;IACjC;MAAmB;MAA0B"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Translation } from "./types.js";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import { PipeTransform } from "@angular/core";
|
|
4
|
-
//#region src/translatePipe.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* `{{ 'home.title' | translate: { name } }}` — impure pipe reading a
|
|
7
6
|
* translation signal, so the view refreshes on language change.
|
|
@@ -17,5 +16,4 @@ export declare class TranslatePipe implements PipeTransform {
|
|
|
17
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;
|
|
18
17
|
static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, 'translate', true>;
|
|
19
18
|
}
|
|
20
|
-
//#endregion
|
|
21
19
|
//# sourceMappingURL=translatePipe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translatePipe.d.ts","names":[],"sources":["../../src/translatePipe.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translatePipe.d.ts","names":[],"sources":["../../src/translatePipe.ts"],"mappings":";;;;;;;qBAca,yBAAyB;mBACnB;UACT;UACA;UACA;EAER,UACE,qCACG,kBACF;;UAkBK;SAmBD,MAAM,GAAG,qBAAqB;SAS9B,OAAO,GAAG,kBAAkB"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { FallbackLangChangeEvent, InterpolatableTranslationObject, InterpolationParameters, LangChangeEvent, Language, RootTranslateServiceConfig, StrictTranslation, Translation, TranslationChangeEvent, TranslationObject } from "./types.js";
|
|
2
1
|
import { MissingTranslationHandler, TranslateCompiler, TranslateLoader, TranslateParser } from "./handlers.js";
|
|
3
2
|
import { TranslateStore } from "./translateStore.js";
|
|
3
|
+
import { FallbackLangChangeEvent, InterpolatableTranslationObject, InterpolationParameters, LangChangeEvent, Language, RootTranslateServiceConfig, StrictTranslation, Translation, TranslationChangeEvent, TranslationObject } from "./types.js";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
import { InjectionToken, Signal } from "@angular/core";
|
|
6
6
|
import { Observable } from "rxjs";
|
|
7
|
-
//#region src/translateService.d.ts
|
|
8
7
|
/** Resolved `provideTranslateService()` options. */
|
|
9
8
|
export declare const TRANSLATE_SERVICE_CONFIG: InjectionToken<RootTranslateServiceConfig>;
|
|
10
9
|
/** A key, a key list, or a reactive source of either. */
|
|
@@ -102,5 +101,5 @@ export declare class TranslateService extends ITranslateService {
|
|
|
102
101
|
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateService, never>;
|
|
103
102
|
static ɵprov: i0.ɵɵInjectableDeclaration<TranslateService>;
|
|
104
103
|
}
|
|
105
|
-
|
|
104
|
+
export {};
|
|
106
105
|
//# sourceMappingURL=translateService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateService.d.ts","names":[],"sources":["../../src/translateService.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translateService.d.ts","names":[],"sources":["../../src/translateService.ts"],"mappings":";;;;;;;qBAmDa,0BAAwB,eAAA;;KAIhC;;8BAOiB;;;;;;;;;;;;qBAaT,yBAAyB;mBACnB;mBACA;WAIR,OAAK;WACL,eAAa;WACb,UAAQ;WACR,QAAM;WACN,2BAAyB;mBAEjB;mBACA;mBACA;mBACA;;WAIR,aAAa,OAAO;WAGpB,cAAc,OAAO;WAErB,WAAW;WAEX,cAAc,WAAW;WAEzB,sBAAsB,WAAW;;WAGjC,qBAAmB,WAAA;WACnB,qBAAqB,WAAW;;WAGhC,sBAAsB;EAM/B;EASA,kBAAkB;EAIlB,mBAAmB;;EAKnB,gBAAgB,MAAM,WAAW,WAAW;;EAU5C,eAAe,MAAM,WAAW,WAAW;;EAK3C,kBAAkB;;EAKlB,IAAI,MAAM,WAAW,WAAW;;;;;UAkBxB;EAqBR,WAAW,MAAM,WAAW,WAAW;EAKvC,UAAU,MAAM;;EAKhB,qBAAqB;;EAUrB,SAAS,YAAY;EAErB,gBAAgB,MAAM,WAAW;EAIjC,eAAe,MAAM,WAAW,WAAW;;EAK3C,eACE,MAAM,UACN,cAAc,mBACd;;EAUF,uBACE,MAAM,UACN,cAAc,iCACd;;EAMF,IACE,aACA,sBAAsB,mBACtB,OAAM;;;;;;UAoBA;;UA8BA;;EA6BR,gBACE,wBACA,oBAAoB,yBACpB,OAAO,WACN,oBAAoB,WAAW;;EAkClC,QACE,wBACA,oBAAoB,yBACpB,OAAO,WACN;;EAWH,IACE,wBACA,oBAAoB,yBACpB,OAAO,WACN,WAAW;;EAKd,OACE,wBACA,oBAAoB,yBACpB,OAAO,WACN,WAAW;;EAQd,UACE,KAAK,UACL,SACI,iCACO,sCACX,OAAO,kBAAkB,wBACxB,OAAO;EAMV,kBAAkB;EAIlB,yBAAyB;;SAKlB,kBAAkB;;SAKlB,yBAAyB;SAKzB,MAAM,GAAG,qBAAqB;SAS9B,OAAO,GAAG,wBAAwB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InterpolatableTranslationObject, LangChangeEvent, Language } from "./types.js";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
//#region src/translateStore.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Runtime translations registered through `setTranslation()` / a loader.
|
|
6
5
|
* Intlayer dictionaries are resolved separately and never copied here.
|
|
@@ -17,5 +16,4 @@ export declare class TranslateStore {
|
|
|
17
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateStore, never>;
|
|
18
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<TranslateStore>;
|
|
19
18
|
}
|
|
20
|
-
//#endregion
|
|
21
19
|
//# sourceMappingURL=translateStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateStore.d.ts","names":[],"sources":["../../src/translateStore.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"translateStore.d.ts","names":["_$__types0.LangChangeEvent"],"sources":["../../src/translateStore.ts"],"mappings":";;;;;;qBAkBa;mBACM;WAGR,cAAY,GAAA,OAAA,eAAA;mBAEJ;WAER,mCAAkB,WAJNA;EAMrB,gBAAgB,UAAU,WAAW;EAIrC,gBACE,UAAU,UACV,cAAc,iCACd;EAeF,mBAAmB,UAAU;EAI7B,oBAAoB,UAAU,UAAU;SAIjC,MAAM,GAAG,qBAAqB;SAS9B,OAAO,GAAG,wBAAwB"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Provider } from "@angular/core";
|
|
2
|
-
//#region src/types.d.ts
|
|
3
2
|
export type Language = string;
|
|
4
3
|
/** A compiled translation: a string, or a function of the parameters. */
|
|
5
4
|
export type InterpolateFunction = (params?: InterpolationParameters) => string;
|
|
@@ -52,5 +51,4 @@ export type RootTranslateServiceConfig = TranslateProviders & {
|
|
|
52
51
|
useDefaultLang?: boolean;
|
|
53
52
|
};
|
|
54
53
|
export type TranslateServiceConfig = RootTranslateServiceConfig;
|
|
55
|
-
//#endregion
|
|
56
54
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../src/types.ts"],"mappings":";YAEY;;YAGA,uBAAuB,SAAS;YAEhC,0BAA0B;YAE1B;GACT,cAAc;;YAGL,iDAKR,oBACA;YAEQ,oBAAoB,QAAQ;YAE5B,qCAER,sBACA,kCACA;YAEQ;GACT,cAAc;;YAGL,aAAa,KAAK,iBAAiB,OAC3C,cAAc,aAAa,MAC3B,eAAc,6BACZ,IACA,+BACc,WAAW,IAAI,aAAa,EAAE,SAC1C;YAEI;EACV,MAAM;EACN,cAAc;;YAGJ,yBAAyB;YAEzB;EACV,MAAM;EACN,cAAc;;;YAIJ,yBAAyB;YAEzB;EACV;EACA;EACA,oBAAoB;;YAGV,oBAAoB;YAEpB;EACV,SAAS;EACT,WAAW;EACX,SAAS;EACT,4BAA4B;;YAGlB,8BAA8B;;EAExC;;YAGU,6BAA6B;;EAEvC,OAAO;;EAEP,eAAe;;EAEf,kBAAkB;;EAElB;;YAGU,yBAAyB"}
|
package/dist/types/util.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/util.d.ts
|
|
2
1
|
type PlainObject = Record<string, unknown>;
|
|
3
2
|
export declare const isDefined: <T>(value: T | null | undefined) => value is T | null;
|
|
4
3
|
export declare const isDefinedAndNotNull: <T>(value: T | null | undefined) => value is T;
|
|
@@ -18,5 +17,5 @@ export declare const mergeDeep: <T>(target: T, source: unknown) => T;
|
|
|
18
17
|
export declare const getValue: (target: unknown, key: string) => unknown;
|
|
19
18
|
/** Returns a copy of `target` with `value` written at the dotted `key`. */
|
|
20
19
|
export declare const insertValue: <T>(target: Readonly<T>, key: string, value: unknown) => T;
|
|
21
|
-
|
|
20
|
+
export {};
|
|
22
21
|
//# sourceMappingURL=util.d.ts.map
|
package/dist/types/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","names":[],"sources":["../../src/util.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","names":[],"sources":["../../src/util.ts"],"mappings":"A,KAEK,cAAc;qBAEN,YAAa,GAAC,OAAS,yBAAuB,SAAS;qBAGvD,sBAAuB,GAAC,OAC5B,yBACN,SAAS;qBAEC,WAAQ,mBAAqB,SAAS;qBAGtC,SAAM,mBAAqB,SAAS;qBAGpC,UAAO,mBAAqB;qBAG5B,WAAQ,mBAAqB;qBAG7B,aAAU,mBAEpB,aAAa;;qBAGH,SAAM,gBAAkB;;qBAcxB,YAAa,GAAC,QAAU,GAAC,oBAAoB;;;;;qBAmB7C,WAAQ,iBAAmB;;qBAI3B,cAAe,GAAC,QACnB,SAAS,IAAE,aACR,mBAEV"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/ngx-translate",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "@ngx-translate/core API adapter for intlayer — drop-in compatibility layer",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"
|
|
8
|
-
"ngx-translate",
|
|
7
|
+
"adapter",
|
|
9
8
|
"angular",
|
|
9
|
+
"compatibility",
|
|
10
10
|
"i18n",
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"intlayer",
|
|
12
|
+
"ngx-translate"
|
|
13
13
|
],
|
|
14
14
|
"homepage": "https://intlayer.org",
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
17
17
|
},
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
21
|
-
},
|
|
22
18
|
"license": "Apache-2.0",
|
|
23
19
|
"author": {
|
|
24
20
|
"name": "Aymeric PINEAU",
|
|
@@ -31,7 +27,18 @@
|
|
|
31
27
|
"url": "https://github.com/aymericzip"
|
|
32
28
|
}
|
|
33
29
|
],
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"./dist",
|
|
36
|
+
"./package.json"
|
|
37
|
+
],
|
|
34
38
|
"sideEffects": false,
|
|
39
|
+
"main": "dist/esm/index.mjs",
|
|
40
|
+
"module": "dist/esm/index.mjs",
|
|
41
|
+
"types": "dist/types/index.d.ts",
|
|
35
42
|
"exports": {
|
|
36
43
|
".": {
|
|
37
44
|
"types": "./dist/types/index.d.ts",
|
|
@@ -47,22 +54,15 @@
|
|
|
47
54
|
},
|
|
48
55
|
"./package.json": "./package.json"
|
|
49
56
|
},
|
|
50
|
-
"main": "dist/esm/index.mjs",
|
|
51
|
-
"module": "dist/esm/index.mjs",
|
|
52
|
-
"types": "dist/types/index.d.ts",
|
|
53
|
-
"files": [
|
|
54
|
-
"./dist",
|
|
55
|
-
"./package.json"
|
|
56
|
-
],
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "bun --bun tsdown --config tsdown.config.ts",
|
|
59
59
|
"build:ci": "bun --bun tsdown --config tsdown.config.ts",
|
|
60
60
|
"clean": "bun --bun rimraf ./dist .turbo",
|
|
61
61
|
"dev": "bun --bun tsdown --config tsdown.config.ts --watch",
|
|
62
|
-
"format": "
|
|
63
|
-
"format:fix": "
|
|
64
|
-
"lint": "
|
|
65
|
-
"lint:fix": "
|
|
62
|
+
"format": "oxfmt --check .",
|
|
63
|
+
"format:fix": "oxfmt .",
|
|
64
|
+
"lint": "oxlint .",
|
|
65
|
+
"lint:fix": "oxlint --fix .",
|
|
66
66
|
"prepublish": "cp -f ../../README.md ./README.md",
|
|
67
67
|
"publish": "bun publish || true",
|
|
68
68
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
@@ -73,28 +73,28 @@
|
|
|
73
73
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@intlayer/config": "9.
|
|
77
|
-
"@intlayer/core": "9.7.
|
|
78
|
-
"@intlayer/dictionaries-entry": "9.
|
|
79
|
-
"@intlayer/engine": "9.7.
|
|
80
|
-
"@intlayer/types": "9.7.
|
|
81
|
-
"angular-intlayer": "9.
|
|
82
|
-
"vite-intlayer": "9.
|
|
76
|
+
"@intlayer/config": "9.7.2",
|
|
77
|
+
"@intlayer/core": "9.7.2",
|
|
78
|
+
"@intlayer/dictionaries-entry": "9.7.2",
|
|
79
|
+
"@intlayer/engine": "9.7.2",
|
|
80
|
+
"@intlayer/types": "9.7.2",
|
|
81
|
+
"angular-intlayer": "9.7.2",
|
|
82
|
+
"vite-intlayer": "9.7.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@angular/compiler": "22.2.
|
|
86
|
-
"@angular/core": "22.2.
|
|
85
|
+
"@angular/compiler": "22.2.4",
|
|
86
|
+
"@angular/core": "22.2.4",
|
|
87
87
|
"@ngx-translate/core": "^18.0.0",
|
|
88
88
|
"@types/node": "^26",
|
|
89
89
|
"@utils/ts-config": "1.0.4",
|
|
90
90
|
"@utils/ts-config-types": "1.0.4",
|
|
91
91
|
"@utils/tsdown-config": "1.0.4",
|
|
92
|
-
"rimraf": "6.1.
|
|
92
|
+
"rimraf": "6.1.4",
|
|
93
93
|
"rxjs": "^7.8.1",
|
|
94
|
-
"tsdown": "0.23.
|
|
94
|
+
"tsdown": "0.23.7",
|
|
95
95
|
"typescript": "7.0.2",
|
|
96
|
-
"vite": "8.3.
|
|
97
|
-
"vitest": "5.0
|
|
96
|
+
"vite": "8.3.7",
|
|
97
|
+
"vitest": "5.1.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"@angular/core": ">=17.0.0",
|