@rxap/ngx-localize 19.1.1-dev.4 → 19.2.0-dev.0
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 +11 -0
- package/compodoc/changelog.html +8 -0
- package/compodoc/dependencies.html +1 -1
- package/compodoc/injectables/LanguageSelectorService.html +12 -11
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/functions.html +1 -1
- package/compodoc/miscellaneous/variables.html +32 -0
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +217 -185
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/I18nService.html +3 -3
- package/docs/html/classes/LanguageSelectorService.html +4 -4
- package/docs/html/functions/LanguageInterceptor.html +2 -2
- package/docs/html/functions/defaultLoadModule.html +2 -2
- package/docs/html/functions/loadI18nBootstrapHook.html +1 -1
- package/docs/html/functions/loadLanguages.html +2 -2
- package/docs/html/index.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/FetchTranslationsFunction.html +1 -1
- package/docs/html/types/LoadModuleFunction.html +1 -1
- package/docs/html/variables/LOCALE_STORAGE_KEY.html +1 -0
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/I18nService.md +5 -5
- package/docs/markdown/classes/LanguageSelectorService.md +7 -7
- package/docs/markdown/functions/LanguageInterceptor.md +2 -2
- package/docs/markdown/functions/defaultLoadModule.md +2 -2
- package/docs/markdown/functions/loadI18nBootstrapHook.md +2 -2
- package/docs/markdown/functions/loadLanguages.md +2 -2
- package/docs/markdown/globals.md +6 -2
- package/docs/markdown/type-aliases/FetchTranslationsFunction.md +2 -2
- package/docs/markdown/type-aliases/LoadModuleFunction.md +2 -2
- package/docs/markdown/variables/LOCALE_STORAGE_KEY.md +11 -0
- package/docs/wiki/Class.I18nService.md +4 -4
- package/docs/wiki/Class.LanguageSelectorService.md +6 -6
- package/docs/wiki/Function.LanguageInterceptor.md +1 -1
- package/docs/wiki/Function.defaultLoadModule.md +1 -1
- package/docs/wiki/Function.loadI18nBootstrapHook.md +1 -1
- package/docs/wiki/Function.loadLanguages.md +1 -1
- package/docs/wiki/TypeAlias.FetchTranslationsFunction.md +1 -1
- package/docs/wiki/TypeAlias.LoadModuleFunction.md +1 -1
- package/docs/wiki/Variable.LOCALE_STORAGE_KEY.md +7 -0
- package/docs/wiki/_Sidebar.md +4 -0
- package/docs/wiki/globals.md +5 -1
- package/fesm2022/rxap-ngx-localize.mjs +10 -8
- package/fesm2022/rxap-ngx-localize.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/const.d.ts +1 -0
- package/package.json +18 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.2.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.1...@rxap/ngx-localize@19.2.0-dev.0) (2026-02-09)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **localize:** centralize and reuse locale storage key constant ([34879e9](https://gitlab.com/rxap/packages/commit/34879e9ba4cbe7fd4ccc479c992f3e72a961fc01))
|
|
11
|
+
- **localize:** export additional constants for reuse ([5cc410d](https://gitlab.com/rxap/packages/commit/5cc410da04a3adb7ffb853fc141d6cbe396f5f58))
|
|
12
|
+
|
|
13
|
+
## [19.1.1](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.1-dev.4...@rxap/ngx-localize@19.1.1) (2026-01-23)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @rxap/ngx-localize
|
|
16
|
+
|
|
6
17
|
## [19.1.1-dev.4](https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.1-dev.3...@rxap/ngx-localize@19.1.1-dev.4) (2025-12-08)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @rxap/ngx-localize
|
package/compodoc/changelog.html
CHANGED
|
@@ -85,6 +85,14 @@
|
|
|
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.1...@rxap/ngx-localize@19.2.0-dev.0">19.2.0-dev.0</a> (2026-02-09)</h1>
|
|
89
|
+
<h3>Features</h3>
|
|
90
|
+
<ul>
|
|
91
|
+
<li><strong>localize:</strong> centralize and reuse locale storage key constant (<a href="https://gitlab.com/rxap/packages/commit/34879e9ba4cbe7fd4ccc479c992f3e72a961fc01">34879e9</a>)</li>
|
|
92
|
+
<li><strong>localize:</strong> export additional constants for reuse (<a href="https://gitlab.com/rxap/packages/commit/5cc410da04a3adb7ffb853fc141d6cbe396f5f58">5cc410d</a>)</li>
|
|
93
|
+
</ul>
|
|
94
|
+
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.1-dev.4...@rxap/ngx-localize@19.1.1">19.1.1</a> (2026-01-23)</h2>
|
|
95
|
+
<p><strong>Note:</strong> Version bump only for package @rxap/ngx-localize</p>
|
|
88
96
|
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.1-dev.3...@rxap/ngx-localize@19.1.1-dev.4">19.1.1-dev.4</a> (2025-12-08)</h2>
|
|
89
97
|
<p><strong>Note:</strong> Version bump only for package @rxap/ngx-localize</p>
|
|
90
98
|
<h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-localize@19.1.1-dev.2...@rxap/ngx-localize@19.1.1-dev.3">19.1.1-dev.3</a> (2025-08-29)</h2>
|
|
@@ -221,8 +221,8 @@ selected language, and dynamically change the application's language setting
|
|
|
221
221
|
|
|
222
222
|
<tr>
|
|
223
223
|
<td class="col-md-4">
|
|
224
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
225
|
-
class="link-to-prism">src/lib/language-selector.service.ts:
|
|
224
|
+
<div class="io-line">Defined in <a href="" data-line="37"
|
|
225
|
+
class="link-to-prism">src/lib/language-selector.service.ts:37</a></div>
|
|
226
226
|
</td>
|
|
227
227
|
</tr>
|
|
228
228
|
|
|
@@ -334,7 +334,7 @@ Optionally reloads the page if the <code>reload</code> parameter is set to <code
|
|
|
334
334
|
</tr>
|
|
335
335
|
<tr>
|
|
336
336
|
<td class="col-md-4">
|
|
337
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
337
|
+
<div class="io-line">Defined in <a href="" data-line="24" class="link-to-prism">src/lib/language-selector.service.ts:24</a></div>
|
|
338
338
|
</td>
|
|
339
339
|
</tr>
|
|
340
340
|
|
|
@@ -361,7 +361,7 @@ Optionally reloads the page if the <code>reload</code> parameter is set to <code
|
|
|
361
361
|
</tr>
|
|
362
362
|
<tr>
|
|
363
363
|
<td class="col-md-4">
|
|
364
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
364
|
+
<div class="io-line">Defined in <a href="" data-line="27" class="link-to-prism">src/lib/language-selector.service.ts:27</a></div>
|
|
365
365
|
</td>
|
|
366
366
|
</tr>
|
|
367
367
|
|
|
@@ -394,7 +394,7 @@ Optionally reloads the page if the <code>reload</code> parameter is set to <code
|
|
|
394
394
|
</tr>
|
|
395
395
|
<tr>
|
|
396
396
|
<td class="col-md-4">
|
|
397
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
397
|
+
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">src/lib/language-selector.service.ts:23</a></div>
|
|
398
398
|
</td>
|
|
399
399
|
</tr>
|
|
400
400
|
|
|
@@ -416,12 +416,12 @@ Optionally reloads the page if the <code>reload</code> parameter is set to <code
|
|
|
416
416
|
</tr>
|
|
417
417
|
<tr>
|
|
418
418
|
<td class="col-md-4">
|
|
419
|
-
<i>Default value : </i><code>signal(localStorage.getItem(
|
|
419
|
+
<i>Default value : </i><code>signal(localStorage.getItem(LOCALE_STORAGE_KEY) ?? this.defaultLanguage())</code>
|
|
420
420
|
</td>
|
|
421
421
|
</tr>
|
|
422
422
|
<tr>
|
|
423
423
|
<td class="col-md-4">
|
|
424
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
424
|
+
<div class="io-line">Defined in <a href="" data-line="25" class="link-to-prism">src/lib/language-selector.service.ts:25</a></div>
|
|
425
425
|
</td>
|
|
426
426
|
</tr>
|
|
427
427
|
|
|
@@ -445,6 +445,7 @@ import {
|
|
|
445
445
|
ConfigService,
|
|
446
446
|
LanguagesConfig,
|
|
447
447
|
} from '@rxap/config';
|
|
448
|
+
import { LOCALE_STORAGE_KEY } from './const';
|
|
448
449
|
|
|
449
450
|
/**
|
|
450
451
|
* A service that manages language selection and configuration for the application.
|
|
@@ -457,7 +458,7 @@ export class LanguageSelectorService {
|
|
|
457
458
|
|
|
458
459
|
public readonly languages: Signal<LanguagesConfig> = signal(this.config.get<LanguagesConfig>('i18n.languages', {}));
|
|
459
460
|
public readonly defaultLanguage: Signal<string> = signal(this.config.get('i18n.defaultLanguage', Object.keys(this.languages())[0] ?? 'en'));
|
|
460
|
-
public readonly selectedLanguage = signal(localStorage.getItem(
|
|
461
|
+
public readonly selectedLanguage = signal(localStorage.getItem(LOCALE_STORAGE_KEY) ?? this.defaultLanguage());
|
|
461
462
|
|
|
462
463
|
public readonly hasLanguages = computed(() => Object.keys(this.languages()).length > 1);
|
|
463
464
|
|
|
@@ -472,11 +473,11 @@ export class LanguageSelectorService {
|
|
|
472
473
|
public async setLanguage(language: string, reload = false) {
|
|
473
474
|
if (language !== this.selectedLanguage()) {
|
|
474
475
|
if (Object.keys(this.languages()).includes(language)) {
|
|
475
|
-
localStorage.setItem(
|
|
476
|
+
localStorage.setItem(LOCALE_STORAGE_KEY, language);
|
|
476
477
|
} else if (this.defaultLanguage()) {
|
|
477
|
-
localStorage.setItem(
|
|
478
|
+
localStorage.setItem(LOCALE_STORAGE_KEY, this.defaultLanguage());
|
|
478
479
|
} else {
|
|
479
|
-
localStorage.removeItem(
|
|
480
|
+
localStorage.removeItem(LOCALE_STORAGE_KEY);
|
|
480
481
|
}
|
|
481
482
|
if (reload) {
|
|
482
483
|
location.reload();
|