@rxap/ngx-localize 19.1.0-dev.4 → 19.1.0-dev.7
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/CHANGELOG.md +16 -0
- package/compodoc/changelog.html +12 -0
- package/compodoc/injectables/LanguageSelectorService.html +46 -7
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/functions.html +111 -4
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +260 -45
- package/docs/html/classes/I18nService.html +3 -3
- package/docs/html/classes/LanguageSelectorService.html +10 -2
- package/docs/html/functions/LanguageInterceptor.html +5 -1
- package/docs/html/functions/loadI18nBootstrapHook.html +4 -1
- package/docs/html/functions/loadLanguages.html +9 -1
- package/docs/html/functions/xliffToJson.html +4 -1
- package/docs/html/index.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/I18nService.md +5 -5
- package/docs/markdown/classes/LanguageSelectorService.md +22 -9
- package/docs/markdown/functions/LanguageInterceptor.md +10 -2
- package/docs/markdown/functions/loadI18nBootstrapHook.md +8 -2
- package/docs/markdown/functions/loadLanguages.md +20 -6
- package/docs/markdown/functions/xliffToJson.md +8 -2
- package/docs/markdown/globals.md +2 -2
- package/docs/wiki/Class.I18nService.md +4 -4
- package/docs/wiki/Class.LanguageSelectorService.md +21 -8
- package/docs/wiki/Function.LanguageInterceptor.md +9 -1
- package/docs/wiki/Function.loadI18nBootstrapHook.md +7 -1
- package/docs/wiki/Function.loadLanguages.md +19 -5
- package/docs/wiki/Function.xliffToJson.md +7 -1
- package/docs/wiki/globals.md +1 -1
- package/fesm2022/rxap-ngx-localize.mjs +84 -14
- package/fesm2022/rxap-ngx-localize.mjs.map +1 -1
- package/lib/language-interceptor.d.ts +7 -0
- package/lib/language-selector.service.d.ts +13 -0
- package/lib/load-i18n-bootstrap-hook.d.ts +6 -0
- package/lib/load-languages.d.ts +11 -0
- package/lib/xliff-to-json.d.ts +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [19.1.0-dev.7](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.6...@rxap/ngx-localize@19.1.0-dev.7) (2025-05-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rxap/ngx-localize
|
|
9
|
+
|
|
10
|
+
# [19.1.0-dev.6](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.5...@rxap/ngx-localize@19.1.0-dev.6) (2025-05-15)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- support translation loading ([eebdf58](https://gitlab.com/rxap/packages/commit/eebdf58381a9ca82a9fca9b9fd5cf664e82fc492))
|
|
15
|
+
|
|
16
|
+
# [19.1.0-dev.5](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.4...@rxap/ngx-localize@19.1.0-dev.5) (2025-05-15)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- support translation interpolation ([6908776](https://gitlab.com/rxap/packages/commit/69087764116316bcc9675ccc028b5134aee9ab52))
|
|
21
|
+
|
|
6
22
|
# [19.1.0-dev.4](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.3...@rxap/ngx-localize@19.1.0-dev.4) (2025-05-15)
|
|
7
23
|
|
|
8
24
|
### Features
|
package/compodoc/changelog.html
CHANGED
|
@@ -85,6 +85,18 @@
|
|
|
85
85
|
<h1>Change Log</h1>
|
|
86
86
|
<p>All notable changes to this project will be documented in this file.
|
|
87
87
|
See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
|
|
88
|
+
<h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.6...@rxap/ngx-localize@19.1.0-dev.7">19.1.0-dev.7</a> (2025-05-15)</h1>
|
|
89
|
+
<p><strong>Note:</strong> Version bump only for package @rxap/ngx-localize</p>
|
|
90
|
+
<h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.5...@rxap/ngx-localize@19.1.0-dev.6">19.1.0-dev.6</a> (2025-05-15)</h1>
|
|
91
|
+
<h3>Bug Fixes</h3>
|
|
92
|
+
<ul>
|
|
93
|
+
<li>support translation loading (<a href="https://gitlab.com/rxap/packages/commit/eebdf58381a9ca82a9fca9b9fd5cf664e82fc492">eebdf58</a>)</li>
|
|
94
|
+
</ul>
|
|
95
|
+
<h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.4...@rxap/ngx-localize@19.1.0-dev.5">19.1.0-dev.5</a> (2025-05-15)</h1>
|
|
96
|
+
<h3>Bug Fixes</h3>
|
|
97
|
+
<ul>
|
|
98
|
+
<li>support translation interpolation (<a href="https://gitlab.com/rxap/packages/commit/69087764116316bcc9675ccc028b5134aee9ab52">6908776</a>)</li>
|
|
99
|
+
</ul>
|
|
88
100
|
<h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.0-dev.3...@rxap/ngx-localize@19.1.0-dev.4">19.1.0-dev.4</a> (2025-05-15)</h1>
|
|
89
101
|
<h3>Features</h3>
|
|
90
102
|
<ul>
|
|
@@ -119,6 +119,15 @@
|
|
|
119
119
|
</p>
|
|
120
120
|
|
|
121
121
|
|
|
122
|
+
<p class="comment">
|
|
123
|
+
<h3>Description</h3>
|
|
124
|
+
</p>
|
|
125
|
+
<p class="comment">
|
|
126
|
+
<p>A service that manages language selection and configuration for the application.
|
|
127
|
+
Provides functionality to retrieve available languages, default language,
|
|
128
|
+
selected language, and dynamically change the application's language settings.</p>
|
|
129
|
+
|
|
130
|
+
</p>
|
|
122
131
|
|
|
123
132
|
|
|
124
133
|
|
|
@@ -212,14 +221,17 @@
|
|
|
212
221
|
|
|
213
222
|
<tr>
|
|
214
223
|
<td class="col-md-4">
|
|
215
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
216
|
-
class="link-to-prism">src/lib/language-selector.service.ts:
|
|
224
|
+
<div class="io-line">Defined in <a href="" data-line="36"
|
|
225
|
+
class="link-to-prism">src/lib/language-selector.service.ts:36</a></div>
|
|
217
226
|
</td>
|
|
218
227
|
</tr>
|
|
219
228
|
|
|
220
229
|
|
|
221
230
|
<tr>
|
|
222
231
|
<td class="col-md-4">
|
|
232
|
+
<div class="io-description"><p>Sets the application language to the specified value if it exists in the list of supported languages.
|
|
233
|
+
Optionally reloads the page if the <code>reload</code> parameter is set to <code>true</code>.</p>
|
|
234
|
+
</div>
|
|
223
235
|
|
|
224
236
|
<div class="io-description">
|
|
225
237
|
<b>Parameters :</b>
|
|
@@ -231,6 +243,7 @@
|
|
|
231
243
|
<td>Type</td>
|
|
232
244
|
<td>Optional</td>
|
|
233
245
|
<td>Default value</td>
|
|
246
|
+
<td>Description</td>
|
|
234
247
|
</tr>
|
|
235
248
|
</thead>
|
|
236
249
|
<tbody>
|
|
@@ -247,6 +260,12 @@
|
|
|
247
260
|
<td>
|
|
248
261
|
</td>
|
|
249
262
|
|
|
263
|
+
<td>
|
|
264
|
+
<ul>
|
|
265
|
+
<li>The language code to set as the active language.</li>
|
|
266
|
+
</ul>
|
|
267
|
+
|
|
268
|
+
</td>
|
|
250
269
|
</tr>
|
|
251
270
|
<tr>
|
|
252
271
|
<td>reload</td>
|
|
@@ -261,6 +280,12 @@
|
|
|
261
280
|
<code>false</code>
|
|
262
281
|
</td>
|
|
263
282
|
|
|
283
|
+
<td>
|
|
284
|
+
<ul>
|
|
285
|
+
<li>A flag indicating whether to reload the page after updating the language.</li>
|
|
286
|
+
</ul>
|
|
287
|
+
|
|
288
|
+
</td>
|
|
264
289
|
</tr>
|
|
265
290
|
</tbody>
|
|
266
291
|
</table>
|
|
@@ -270,7 +295,8 @@
|
|
|
270
295
|
|
|
271
296
|
</div>
|
|
272
297
|
<div class="io-description">
|
|
273
|
-
|
|
298
|
+
<p>A promise that resolves once the language has been set and optional reload is completed.</p>
|
|
299
|
+
|
|
274
300
|
</div>
|
|
275
301
|
</td>
|
|
276
302
|
</tr>
|
|
@@ -308,7 +334,7 @@
|
|
|
308
334
|
</tr>
|
|
309
335
|
<tr>
|
|
310
336
|
<td class="col-md-4">
|
|
311
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
337
|
+
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">src/lib/language-selector.service.ts:23</a></div>
|
|
312
338
|
</td>
|
|
313
339
|
</tr>
|
|
314
340
|
|
|
@@ -335,7 +361,7 @@
|
|
|
335
361
|
</tr>
|
|
336
362
|
<tr>
|
|
337
363
|
<td class="col-md-4">
|
|
338
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
364
|
+
<div class="io-line">Defined in <a href="" data-line="26" class="link-to-prism">src/lib/language-selector.service.ts:26</a></div>
|
|
339
365
|
</td>
|
|
340
366
|
</tr>
|
|
341
367
|
|
|
@@ -368,7 +394,7 @@
|
|
|
368
394
|
</tr>
|
|
369
395
|
<tr>
|
|
370
396
|
<td class="col-md-4">
|
|
371
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
397
|
+
<div class="io-line">Defined in <a href="" data-line="22" class="link-to-prism">src/lib/language-selector.service.ts:22</a></div>
|
|
372
398
|
</td>
|
|
373
399
|
</tr>
|
|
374
400
|
|
|
@@ -395,7 +421,7 @@
|
|
|
395
421
|
</tr>
|
|
396
422
|
<tr>
|
|
397
423
|
<td class="col-md-4">
|
|
398
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
424
|
+
<div class="io-line">Defined in <a href="" data-line="24" class="link-to-prism">src/lib/language-selector.service.ts:24</a></div>
|
|
399
425
|
</td>
|
|
400
426
|
</tr>
|
|
401
427
|
|
|
@@ -420,6 +446,11 @@ import {
|
|
|
420
446
|
LanguagesConfig,
|
|
421
447
|
} from '@rxap/config';
|
|
422
448
|
|
|
449
|
+
/**
|
|
450
|
+
* A service that manages language selection and configuration for the application.
|
|
451
|
+
* Provides functionality to retrieve available languages, default language,
|
|
452
|
+
* selected language, and dynamically change the application's language settings.
|
|
453
|
+
*/
|
|
423
454
|
@Injectable({ providedIn: 'root' })
|
|
424
455
|
export class LanguageSelectorService {
|
|
425
456
|
private readonly config = inject(ConfigService);
|
|
@@ -430,6 +461,14 @@ export class LanguageSelectorService {
|
|
|
430
461
|
|
|
431
462
|
public readonly hasLanguages = computed(() => Object.keys(this.languages()).length > 1);
|
|
432
463
|
|
|
464
|
+
/**
|
|
465
|
+
* Sets the application language to the specified value if it exists in the list of supported languages.
|
|
466
|
+
* Optionally reloads the page if the `reload` parameter is set to `true`.
|
|
467
|
+
*
|
|
468
|
+
* @param {string} language - The language code to set as the active language.
|
|
469
|
+
* @param {boolean} [reload=false] - A flag indicating whether to reload the page after updating the language.
|
|
470
|
+
* @return {Promise<void>} A promise that resolves once the language has been set and optional reload is completed.
|
|
471
|
+
*/
|
|
433
472
|
public async setLanguage(language: string, reload = false) {
|
|
434
473
|
if (language !== this.selectedLanguage()) {
|
|
435
474
|
if (Object.keys(this.languages()).includes(language)) {
|