@genesislcap/foundation-i18n 14.177.0 → 14.177.1

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.
@@ -1,4 +1,4 @@
1
- import type { InitOptions, Callback, TFunction, TOptions, StringMap } from 'i18next';
1
+ import type { InitOptions, Callback, TFunction, TOptions, StringMap, Resource } from 'i18next';
2
2
  import { I18nextConfig } from './config';
3
3
  /**
4
4
  * The I18next interface is used to provide i18n functionality to components.
@@ -11,6 +11,7 @@ export interface I18next {
11
11
  init(options: InitOptions, callback?: Callback): Promise<TFunction>;
12
12
  t(key: string | string[], options?: string | TOptions<StringMap>): string;
13
13
  changeLanguageTo(language: string): void;
14
+ addResources(resources: Resource): void;
14
15
  }
15
16
  /**
16
17
  * The default implementation for the I18next interface.
@@ -24,6 +25,7 @@ export declare class DefaultI18next implements I18next {
24
25
  init(options: InitOptions, callback?: Callback): Promise<TFunction>;
25
26
  t(key: string | string[], options?: string | TOptions<StringMap>): string;
26
27
  changeLanguageTo(language: string): void;
28
+ addResources(resources: Resource): void;
27
29
  }
28
30
  /**
29
31
  * The DI token for the i18n interface.
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/i18n/i18n.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC,CAAC,GAAG,EAAE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C,SAAS,CAAC,GAAG,MAAM,CAAC;IAC1E,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,YAAY,CAAC,SAAS,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzC;AAED;;;GAGG;AACH,qBAAa,cAAe,YAAW,OAAO;IAC7B,MAAM,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,WAAW,CAAC;;IAMjC,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAMnE,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM;IAIzE,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAIjC,YAAY,CAAC,SAAS,EAAE,QAAQ,GAAG,IAAI;CAOxC;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,+DAAkE,CAAC"}
@@ -22,6 +22,13 @@ export class DefaultI18next {
22
22
  changeLanguageTo(language) {
23
23
  this.language = language;
24
24
  }
25
+ addResources(resources) {
26
+ Object.keys(resources).forEach((lang) => {
27
+ Object.keys(resources[lang]).forEach((namespace) => {
28
+ i18next.addResourceBundle(lang, namespace, resources[lang][namespace], true, true);
29
+ });
30
+ });
31
+ }
25
32
  }
26
33
  __decorate([
27
34
  I18nextConfig
@@ -212,6 +212,55 @@
212
212
  "overloadIndex": 1,
213
213
  "parameters": []
214
214
  },
215
+ {
216
+ "kind": "Method",
217
+ "canonicalReference": "@genesislcap/foundation-i18n!DefaultI18next#addResources:member(1)",
218
+ "docComment": "",
219
+ "excerptTokens": [
220
+ {
221
+ "kind": "Content",
222
+ "text": "addResources(resources: "
223
+ },
224
+ {
225
+ "kind": "Reference",
226
+ "text": "Resource",
227
+ "canonicalReference": "i18next!Resource:interface"
228
+ },
229
+ {
230
+ "kind": "Content",
231
+ "text": "): "
232
+ },
233
+ {
234
+ "kind": "Content",
235
+ "text": "void"
236
+ },
237
+ {
238
+ "kind": "Content",
239
+ "text": ";"
240
+ }
241
+ ],
242
+ "isStatic": false,
243
+ "returnTypeTokenRange": {
244
+ "startIndex": 3,
245
+ "endIndex": 4
246
+ },
247
+ "releaseTag": "Public",
248
+ "isProtected": false,
249
+ "overloadIndex": 1,
250
+ "parameters": [
251
+ {
252
+ "parameterName": "resources",
253
+ "parameterTypeTokenRange": {
254
+ "startIndex": 1,
255
+ "endIndex": 2
256
+ },
257
+ "isOptional": false
258
+ }
259
+ ],
260
+ "isOptional": false,
261
+ "isAbstract": false,
262
+ "name": "addResources"
263
+ },
215
264
  {
216
265
  "kind": "Method",
217
266
  "canonicalReference": "@genesislcap/foundation-i18n!DefaultI18next#changeLanguageTo:member(1)",
@@ -2,6 +2,7 @@ import type { Callback } from 'i18next';
2
2
  import i18next from 'i18next';
3
3
  import type { InitOptions } from 'i18next';
4
4
  import { InterfaceSymbol } from '@microsoft/fast-foundation';
5
+ import type { Resource } from 'i18next';
5
6
  import type { StringMap } from 'i18next';
6
7
  import type { TFunction } from 'i18next';
7
8
  import type { TOptions } from 'i18next';
@@ -18,6 +19,7 @@ export declare class DefaultI18next implements I18next {
18
19
  init(options: InitOptions, callback?: Callback): Promise<TFunction>;
19
20
  t(key: string | string[], options?: string | TOptions<StringMap>): string;
20
21
  changeLanguageTo(language: string): void;
22
+ addResources(resources: Resource): void;
21
23
  }
22
24
 
23
25
  /**
@@ -37,6 +39,7 @@ export declare interface I18next {
37
39
  init(options: InitOptions, callback?: Callback): Promise<TFunction>;
38
40
  t(key: string | string[], options?: string | TOptions<StringMap>): string;
39
41
  changeLanguageTo(language: string): void;
42
+ addResources(resources: Resource): void;
40
43
  }
41
44
 
42
45
  /**
@@ -0,0 +1,22 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-i18n](./foundation-i18n.md) &gt; [DefaultI18next](./foundation-i18n.defaulti18next.md) &gt; [addResources](./foundation-i18n.defaulti18next.addresources.md)
4
+
5
+ ## DefaultI18next.addResources() method
6
+
7
+ **Signature:**
8
+
9
+ ```typescript
10
+ addResources(resources: Resource): void;
11
+ ```
12
+
13
+ ## Parameters
14
+
15
+ | Parameter | Type | Description |
16
+ | --- | --- | --- |
17
+ | resources | Resource | |
18
+
19
+ **Returns:**
20
+
21
+ void
22
+
@@ -31,6 +31,7 @@ export declare class DefaultI18next implements I18next
31
31
 
32
32
  | Method | Modifiers | Description |
33
33
  | --- | --- | --- |
34
+ | [addResources(resources)](./foundation-i18n.defaulti18next.addresources.md) | | |
34
35
  | [changeLanguageTo(language)](./foundation-i18n.defaulti18next.changelanguageto.md) | | |
35
36
  | [init(options, callback)](./foundation-i18n.defaulti18next.init.md) | | |
36
37
  | [t(key, options)](./foundation-i18n.defaulti18next.t.md) | | |
@@ -8,6 +8,7 @@ import type { Callback } from 'i18next';
8
8
  import i18next from 'i18next';
9
9
  import type { InitOptions } from 'i18next';
10
10
  import { InterfaceSymbol } from '@microsoft/fast-foundation';
11
+ import type { Resource } from 'i18next';
11
12
  import type { StringMap } from 'i18next';
12
13
  import type { TFunction } from 'i18next';
13
14
  import type { TOptions } from 'i18next';
@@ -18,6 +19,8 @@ import type { TOptions } from 'i18next';
18
19
  export class DefaultI18next implements I18next {
19
20
  constructor();
20
21
  // (undocumented)
22
+ addResources(resources: Resource): void;
23
+ // (undocumented)
21
24
  changeLanguageTo(language: string): void;
22
25
  // (undocumented)
23
26
  config: I18nextConfig;
@@ -38,6 +41,8 @@ export const defaultI18nextConfig: I18nextConfig;
38
41
  //
39
42
  // @alpha
40
43
  export interface I18next {
44
+ // (undocumented)
45
+ addResources(resources: Resource): void;
41
46
  // (undocumented)
42
47
  changeLanguageTo(language: string): void;
43
48
  // (undocumented)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-i18n",
3
3
  "description": "Foundation components and services for Internationalization (i18n) support",
4
- "version": "14.177.0",
4
+ "version": "14.177.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -22,16 +22,16 @@
22
22
  "serve": "genx serve"
23
23
  },
24
24
  "devDependencies": {
25
- "@genesislcap/genx": "14.177.0",
26
- "@genesislcap/rollup-builder": "14.177.0",
27
- "@genesislcap/ts-builder": "14.177.0",
28
- "@genesislcap/uvu-playwright-builder": "14.177.0",
29
- "@genesislcap/vite-builder": "14.177.0",
30
- "@genesislcap/webpack-builder": "14.177.0",
25
+ "@genesislcap/genx": "14.177.1",
26
+ "@genesislcap/rollup-builder": "14.177.1",
27
+ "@genesislcap/ts-builder": "14.177.1",
28
+ "@genesislcap/uvu-playwright-builder": "14.177.1",
29
+ "@genesislcap/vite-builder": "14.177.1",
30
+ "@genesislcap/webpack-builder": "14.177.1",
31
31
  "rimraf": "^3.0.2"
32
32
  },
33
33
  "dependencies": {
34
- "@genesislcap/foundation-logger": "14.177.0",
34
+ "@genesislcap/foundation-logger": "14.177.1",
35
35
  "@microsoft/fast-element": "^1.12.0",
36
36
  "@microsoft/fast-foundation": "^2.49.4",
37
37
  "i18next": "^20.3.0",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "b3c0ce3e0fa58bae562c2c9bec96beee6a4a2ed4"
48
+ "gitHead": "c07c95144c7ef605e038161300877aea756dcc28"
49
49
  }