@rxap/ngx-localize 22.0.0-dev.0 → 22.0.0-dev.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.
- package/CHANGELOG.md +15 -0
- package/compodoc/architecture.html +222 -0
- package/compodoc/changelog.html +60 -5
- package/compodoc/dependencies.html +96 -21
- package/compodoc/index.html +46 -5
- package/compodoc/injectables/I18nService.html +86 -22
- package/compodoc/injectables/LanguageSelectorService.html +102 -23
- package/compodoc/js/architecture-graph.js +288 -0
- package/compodoc/js/libs/bootstrap-native.js +4 -2
- package/compodoc/js/libs/jszip.min.js +13 -0
- package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
- package/compodoc/js/libs/tablesort.min.js +3 -3
- package/compodoc/js/libs/tablesort.number.min.js +3 -3
- package/compodoc/js/libs/vis-network.min.js +78 -0
- package/compodoc/js/menu-wc.js +25 -12
- package/compodoc/js/menu.js +10 -11
- package/compodoc/js/routes/routes_index.js +1 -0
- package/compodoc/js/routes.js +142 -34
- package/compodoc/js/search/search-lunr.js +6 -8
- package/compodoc/js/search/search.js +118 -66
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/js/tabs.js +98 -15
- package/compodoc/js/tree.js +44 -7
- package/compodoc/license.html +48 -6
- package/compodoc/llms.txt +61 -0
- package/compodoc/miscellaneous/functions.html +65 -19
- package/compodoc/miscellaneous/typealiases.html +47 -5
- package/compodoc/miscellaneous/variables.html +52 -5
- package/compodoc/modules.html +44 -3
- package/compodoc/overview.html +54 -3
- package/compodoc/properties.html +45 -4
- package/compodoc/routes.html +227 -0
- package/compodoc/styles/compodoc.css +365 -44
- package/compodoc/styles/dark.css +16 -0
- package/compodoc/template-playground/default-templates.json +192 -0
- package/compodoc/template-playground/hbs-render.service.ts +217 -0
- package/compodoc/template-playground/main.ts +9 -0
- package/compodoc/template-playground/template-editor.service.ts +173 -0
- package/compodoc/template-playground/template-playground.component.ts +614 -0
- package/compodoc/template-playground/template-playground.module.ts +29 -0
- package/compodoc/template-playground/zip-export.service.ts +86 -0
- package/compodoc/template-playground-app/app.js +1389 -0
- package/compodoc/template-playground-app/index.html +462 -0
- package/docs/documentation.json +188 -146
- package/docs/html/assets/highlight.css +1 -1
- package/docs/html/assets/icons.js +1 -1
- package/docs/html/assets/icons.svg +1 -1
- package/docs/html/assets/main.js +5 -5
- package/docs/html/assets/search.js +1 -1
- package/docs/html/assets/style.css +265 -228
- package/docs/html/classes/I18nService.html +112 -6
- package/docs/html/classes/LanguageSelectorService.html +121 -12
- package/docs/html/functions/LanguageInterceptor.html +50 -5
- package/docs/html/functions/defaultLoadModule.html +47 -4
- package/docs/html/functions/loadI18nBootstrapHook.html +46 -1
- package/docs/html/functions/loadLanguages.html +59 -8
- package/docs/html/hierarchy.html +29 -0
- package/docs/html/index.html +40 -4
- package/docs/html/modules.html +48 -1
- package/docs/html/types/FetchTranslationsFunction.html +47 -1
- package/docs/html/types/LoadModuleFunction.html +45 -1
- package/docs/html/variables/LOCALE_STORAGE_KEY.html +33 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/I18nService.md +11 -11
- package/docs/markdown/classes/LanguageSelectorService.md +11 -11
- package/docs/markdown/functions/LanguageInterceptor.md +2 -2
- package/docs/markdown/functions/defaultLoadModule.md +2 -2
- package/docs/markdown/functions/loadI18nBootstrapHook.md +5 -19
- package/docs/markdown/functions/loadLanguages.md +4 -4
- package/docs/markdown/globals.md +2 -2
- package/docs/markdown/type-aliases/FetchTranslationsFunction.md +4 -4
- package/docs/markdown/type-aliases/LoadModuleFunction.md +4 -4
- package/docs/markdown/variables/LOCALE_STORAGE_KEY.md +2 -2
- package/docs/wiki/Class.I18nService.md +10 -10
- package/docs/wiki/Class.LanguageSelectorService.md +10 -10
- package/docs/wiki/Function.LanguageInterceptor.md +1 -1
- package/docs/wiki/Function.defaultLoadModule.md +1 -1
- package/docs/wiki/Function.loadI18nBootstrapHook.md +4 -18
- package/docs/wiki/Function.loadLanguages.md +3 -3
- package/docs/wiki/TypeAlias.FetchTranslationsFunction.md +3 -3
- package/docs/wiki/TypeAlias.LoadModuleFunction.md +3 -3
- package/docs/wiki/Variable.LOCALE_STORAGE_KEY.md +1 -1
- package/docs/wiki/globals.md +1 -1
- package/package.json +21 -21
package/compodoc/js/tabs.js
CHANGED
|
@@ -1,21 +1,104 @@
|
|
|
1
1
|
document.addEventListener('DOMContentLoaded', function() {
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var tabContainers = document.getElementsByClassName('nav-tabs');
|
|
3
|
+
var tabLinks = [];
|
|
4
|
+
var tabAliasMap = {
|
|
5
|
+
'template': 'templateData',
|
|
6
|
+
'dom-tree': 'tree'
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
function updateAddress(e) {
|
|
10
|
+
if (history.pushState && e.target.dataset.link) {
|
|
11
|
+
history.pushState(null, null, '#' + e.target.dataset.link);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function findTabLinkByDataLink(dataLink) {
|
|
16
|
+
for (var i = 0; i < tabLinks.length; i++) {
|
|
17
|
+
if (tabLinks[i].dataset.link === dataLink) {
|
|
18
|
+
return tabLinks[i];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getClosestTabPane(element) {
|
|
25
|
+
if (!element) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
if (element.closest) {
|
|
29
|
+
return element.closest('.tab-pane');
|
|
30
|
+
}
|
|
31
|
+
var node = element;
|
|
32
|
+
while (node) {
|
|
33
|
+
if (node.classList && node.classList.contains('tab-pane')) {
|
|
34
|
+
return node;
|
|
6
35
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
36
|
+
node = node.parentElement;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function findAnchorTarget(hashValue) {
|
|
42
|
+
if (!hashValue) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
var targetById = document.getElementById(hashValue);
|
|
47
|
+
if (targetById) {
|
|
48
|
+
return targetById;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var targetsByName = document.getElementsByName(hashValue);
|
|
52
|
+
if (targetsByName && targetsByName.length > 0) {
|
|
53
|
+
return targetsByName[0];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function activateTabFromHash() {
|
|
60
|
+
if (location.hash === '') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var currentHash = decodeURIComponent(location.hash.substr(1));
|
|
65
|
+
if (!currentHash) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var resolvedHash = tabAliasMap[currentHash] || currentHash;
|
|
70
|
+
var directMatch = findTabLinkByDataLink(resolvedHash);
|
|
71
|
+
if (directMatch) {
|
|
72
|
+
directMatch.click();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (currentHash.indexOf('source.') === 0) {
|
|
77
|
+
var sourceTabLink = findTabLinkByDataLink('source');
|
|
78
|
+
if (sourceTabLink) {
|
|
79
|
+
sourceTabLink.click();
|
|
80
|
+
return;
|
|
18
81
|
}
|
|
19
82
|
}
|
|
83
|
+
|
|
84
|
+
var targetAnchor = findAnchorTarget(currentHash);
|
|
85
|
+
var tabPane = getClosestTabPane(targetAnchor);
|
|
86
|
+
if (!tabPane || !tabPane.id) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
var tabLink = findTabLinkByDataLink(tabPane.id);
|
|
91
|
+
if (tabLink) {
|
|
92
|
+
tabLink.click();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (tabContainers.length > 0) {
|
|
97
|
+
tabLinks = tabContainers[0].querySelectorAll('a[data-link]');
|
|
98
|
+
for (var i = 0; i < tabLinks.length; i++) {
|
|
99
|
+
tabLinks[i].addEventListener('click', updateAddress);
|
|
100
|
+
}
|
|
101
|
+
activateTabFromHash();
|
|
102
|
+
window.addEventListener('hashchange', activateTabFromHash, false);
|
|
20
103
|
}
|
|
21
104
|
});
|
package/compodoc/js/tree.js
CHANGED
|
@@ -58,10 +58,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
58
58
|
type
|
|
59
59
|
} of it) {
|
|
60
60
|
if (type === 'NonIterableObject' && typeof key !== 'undefined' && value.type === 'tag') {
|
|
61
|
+
var parentId = parentNode && parentNode._parent ? parentNode._parent._id : null,
|
|
62
|
+
parentLevel = parentNode && parentNode._parent && typeof parentNode._parent._level === 'number'
|
|
63
|
+
? parentNode._parent._level
|
|
64
|
+
: 0,
|
|
65
|
+
nodeLevel = parentLevel + 1;
|
|
66
|
+
value._level = nodeLevel;
|
|
67
|
+
|
|
61
68
|
var newNode = {
|
|
62
69
|
id: value._id,
|
|
63
70
|
label: value.name,
|
|
64
|
-
type: value.type
|
|
71
|
+
type: value.type,
|
|
72
|
+
level: nodeLevel
|
|
65
73
|
};
|
|
66
74
|
for(var i = 0; i < COMPONENTS.length; i++) {
|
|
67
75
|
if (COMPONENTS[i].selector === value.name) {
|
|
@@ -88,17 +96,29 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
98
|
newNodes.push(newNode);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
if (parentId !== null && typeof parentId !== 'undefined') {
|
|
100
|
+
newEdges.push({
|
|
101
|
+
from: parentId,
|
|
102
|
+
to: value._id
|
|
103
|
+
});
|
|
104
|
+
}
|
|
96
105
|
}
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
newNodes.shift();
|
|
100
109
|
|
|
110
|
+
var stripHtml = function(value) {
|
|
111
|
+
return String(value || '').replace(/<[^>]*>/g, '');
|
|
112
|
+
},
|
|
113
|
+
longestLabelLength = newNodes.reduce(function(max, node) {
|
|
114
|
+
var labelLength = stripHtml(node.label).length;
|
|
115
|
+
return Math.max(max, labelLength);
|
|
116
|
+
}, 0),
|
|
117
|
+
uniformNodeWidth = Math.max(40, Math.ceil(longestLabelLength * 8 + 28));
|
|
118
|
+
|
|
101
119
|
var container = document.getElementById('tree-container'),
|
|
120
|
+
isDarkMode = document.body && document.body.classList.contains('dark'),
|
|
121
|
+
treeFontColor = isDarkMode ? '#f0f0f0' : '#2d2d2d',
|
|
102
122
|
data = {
|
|
103
123
|
nodes: newNodes,
|
|
104
124
|
edges: newEdges
|
|
@@ -107,12 +127,29 @@ document.addEventListener('DOMContentLoaded', function() {
|
|
|
107
127
|
layout: {
|
|
108
128
|
hierarchical: {
|
|
109
129
|
sortMethod: 'directed',
|
|
130
|
+
shakeTowards: 'roots',
|
|
131
|
+
levelSeparation: 130,
|
|
110
132
|
enabled: true
|
|
111
133
|
}
|
|
112
134
|
},
|
|
135
|
+
edges: {
|
|
136
|
+
smooth: {
|
|
137
|
+
enabled: true,
|
|
138
|
+
type: 'cubicBezier',
|
|
139
|
+
forceDirection: 'vertical',
|
|
140
|
+
roundness: 0.45
|
|
141
|
+
}
|
|
142
|
+
},
|
|
113
143
|
nodes: {
|
|
114
144
|
shape: 'ellipse',
|
|
115
|
-
fixed: true
|
|
145
|
+
fixed: true,
|
|
146
|
+
font: {
|
|
147
|
+
color: treeFontColor
|
|
148
|
+
},
|
|
149
|
+
widthConstraint: {
|
|
150
|
+
minimum: uniformNodeWidth,
|
|
151
|
+
maximum: uniformNodeWidth
|
|
152
|
+
}
|
|
116
153
|
}
|
|
117
154
|
},
|
|
118
155
|
|
package/compodoc/license.html
CHANGED
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -79,9 +100,13 @@
|
|
|
79
100
|
<compodoc-menu mode="normal"></compodoc-menu>
|
|
80
101
|
</div>
|
|
81
102
|
<!-- START CONTENT -->
|
|
82
|
-
<div class="content
|
|
103
|
+
<div class="content license">
|
|
83
104
|
<div class="content-data">
|
|
84
105
|
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
85
110
|
<b>Example :</b><div><pre class="line-numbers"><code class="language-none"> GNU GENERAL PUBLIC LICENSE
|
|
86
111
|
Version 3, 29 June 2007</code></pre></div><p> Copyright (C) 2007 Free Software Foundation, Inc. <a href="https://fsf.org/">https://fsf.org/</a>
|
|
87
112
|
Everyone is permitted to copy and distribute verbatim copies
|
|
@@ -636,7 +661,8 @@ reviewing courts shall apply local law that most closely approximates
|
|
|
636
661
|
an absolute waiver of all civil liability in connection with the
|
|
637
662
|
Program, unless a warranty or assumption of liability accompanies a
|
|
638
663
|
copy of the Program in return for a fee.</p>
|
|
639
|
-
<b>Example :</b><div><pre class="line-numbers"><code class="language-none"> END OF TERMS AND CONDITIONS
|
|
664
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-none"> END OF TERMS AND CONDITIONS
|
|
665
|
+
</code></pre></div>
|
|
640
666
|
|
|
641
667
|
|
|
642
668
|
|
|
@@ -682,13 +708,31 @@ copy of the Program in return for a fee.</p>
|
|
|
682
708
|
|
|
683
709
|
<script>
|
|
684
710
|
var COMPODOC_CURRENT_PAGE_DEPTH = 0;
|
|
685
|
-
var COMPODOC_CURRENT_PAGE_CONTEXT = '
|
|
711
|
+
var COMPODOC_CURRENT_PAGE_CONTEXT = 'license';
|
|
686
712
|
var COMPODOC_CURRENT_PAGE_URL = 'license.html';
|
|
687
713
|
var MAX_SEARCH_RESULTS = 15;
|
|
688
714
|
</script>
|
|
689
715
|
|
|
690
716
|
<script>
|
|
691
717
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
718
|
+
var updateDarkModeSwitchOffset = function () {
|
|
719
|
+
var content = document.querySelector('.content');
|
|
720
|
+
var scrollbarWidth = 0;
|
|
721
|
+
|
|
722
|
+
if (content) {
|
|
723
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
document.documentElement.style.setProperty(
|
|
727
|
+
'--content-scrollbar-width',
|
|
728
|
+
scrollbarWidth + 'px'
|
|
729
|
+
);
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
updateDarkModeSwitchOffset();
|
|
733
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
734
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
735
|
+
|
|
692
736
|
checkToggle(darkModeState);
|
|
693
737
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
694
738
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -704,14 +748,12 @@ copy of the Program in return for a fee.</p>
|
|
|
704
748
|
<script src="./js/libs/lit-html.js"></script>
|
|
705
749
|
|
|
706
750
|
<script src="./js/menu-wc.js" defer></script>
|
|
707
|
-
<script nomodule src="./js/menu-wc_es5.js" defer></script>
|
|
708
751
|
|
|
709
752
|
<script src="./js/libs/bootstrap-native.js"></script>
|
|
710
753
|
|
|
711
754
|
<script src="./js/libs/es6-shim.min.js"></script>
|
|
712
755
|
<script src="./js/libs/EventDispatcher.js"></script>
|
|
713
756
|
<script src="./js/libs/promise.min.js"></script>
|
|
714
|
-
<script src="./js/libs/zepto.min.js"></script>
|
|
715
757
|
|
|
716
758
|
<script src="./js/compodoc.js"></script>
|
|
717
759
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# angular-localize
|
|
2
|
+
|
|
3
|
+
> This package provides internationalization (i18n) support for Angular applications, including services for language management, an HTTP interceptor for setting the \`Accept-Language\` header, and a language selector component. It allows you to set and manage the current language of your application, redirect users based on their language preference, and configure available languages. The package also includes an init generator to handle peer dependencies.
|
|
4
|
+
|
|
5
|
+
> Generated by compodoc 2.0.0 at 2026-11-23T22:34:17.671Z, llm-md export.
|
|
6
|
+
|
|
7
|
+
## Services / Injectables
|
|
8
|
+
|
|
9
|
+
### I18nService
|
|
10
|
+
|
|
11
|
+
File: `src/lib/i18n.service.ts`
|
|
12
|
+
providedIn: `root`
|
|
13
|
+
Deprecated: (deprecated: removed)
|
|
14
|
+
|
|
15
|
+
Properties:
|
|
16
|
+
- `currentLanguage: Signal<string> = signal(this.localId.replace(/-[A-Z]+$/, ''))`
|
|
17
|
+
|
|
18
|
+
Methods:
|
|
19
|
+
- `redirect(next: string, current: string = this.currentLanguage()): void`
|
|
20
|
+
- `setLanguage(language: string): any`
|
|
21
|
+
|
|
22
|
+
### LanguageSelectorService
|
|
23
|
+
|
|
24
|
+
File: `src/lib/language-selector.service.ts`
|
|
25
|
+
providedIn: `root`
|
|
26
|
+
|
|
27
|
+
Description: A service that manages language selection and configuration for the application. Provides functionality to retrieve available languages, default language, selected language, and dynamically change the application's language settings.
|
|
28
|
+
|
|
29
|
+
Properties:
|
|
30
|
+
- `defaultLanguage: Signal<string> = signal(this.config.get('i18n.defaultLanguage', Object.keys(this.languages())[0] ?? 'en'))`
|
|
31
|
+
- `hasLanguages: unknown = computed(() => Object.keys(this.languages()).length > 1)`
|
|
32
|
+
- `languages: Signal<LanguagesConfig> = signal(this.config.get<LanguagesConfig>('i18n.languages', {}))`
|
|
33
|
+
- `selectedLanguage: unknown = signal(localStorage.getItem(LOCALE_STORAGE_KEY) ?? this.defaultLanguage())`
|
|
34
|
+
|
|
35
|
+
Methods:
|
|
36
|
+
- `setLanguage(language: string, reload: unknown = false): any` — Sets the application language to the specified value if it exists in the list of supported languages. Optionally reloads the page if the reload parameter is set to true .
|
|
37
|
+
|
|
38
|
+
## Public functions
|
|
39
|
+
|
|
40
|
+
- `defaultLoadModule(locale: string)` — Loads the locale data module for the specified locale and registers it.
|
|
41
|
+
Defined in `src/lib/load-languages.ts`
|
|
42
|
+
- `initGenerator(tree: Tree, options: InitGeneratorSchema)`
|
|
43
|
+
Defined in `src/generators/init/generator.ts`
|
|
44
|
+
- `LanguageInterceptor(request: HttpRequest, next: HttpHandlerFn): Observable<HttpEvent<unknown>>` — Intercepts an HTTP request to include a localized 'Accept-Language' header, if available.
|
|
45
|
+
Defined in `src/lib/language-interceptor.ts`
|
|
46
|
+
- `loadI18nBootstrapHook(fetchTranslations: FetchTranslationsFunction, loadModule: LoadModuleFunction = defaultLoadModule, locale?: string, preferredLanguages?, fallback?: string)`
|
|
47
|
+
Defined in `src/lib/load-i18n-bootstrap-hook.ts`
|
|
48
|
+
- `loadLanguages(fetchTranslations: FetchTranslationsFunction, loadModule: LoadModuleFunction = defaultLoadModule, locale: string = localStorage.getItem(LOCALE_STORAGE_KEY) || navigator.language || 'en', preferredLanguages: unknown = (navigator.languages ?? []).slice(), fallback: string = 'messages')` — Loads language translations and sets the locale for the application. This function fetches the translations based on the specified locale, preferred languages, and a fallback, then initializes the translations and optionally loads additional modules.
|
|
49
|
+
Defined in `src/lib/load-languages.ts`
|
|
50
|
+
|
|
51
|
+
## Public type aliases
|
|
52
|
+
|
|
53
|
+
- `type FetchTranslationsFunction = function`
|
|
54
|
+
- `type LoadModuleFunction = function`
|
|
55
|
+
|
|
56
|
+
## Public variables
|
|
57
|
+
|
|
58
|
+
- `LOCALE_STORAGE_KEY: string = 'locale'`
|
|
59
|
+
Defined in `src/lib/const.ts`
|
|
60
|
+
- `schematic: unknown = convertNxGenerator(generator)`
|
|
61
|
+
Defined in `src/generators/init/index.ts`
|
|
@@ -61,6 +61,20 @@
|
|
|
61
61
|
}
|
|
62
62
|
toggleDarkMode(darkModeState);
|
|
63
63
|
</script>
|
|
64
|
+
<script>
|
|
65
|
+
// --- Iframe navigation tracking for Template Playground ---
|
|
66
|
+
function sendCurrentUrlToParent() {
|
|
67
|
+
if (window.parent && window.parent !== window) {
|
|
68
|
+
window.parent.postMessage({
|
|
69
|
+
type: 'compodoc-iframe-navigate',
|
|
70
|
+
url: window.location.pathname + window.location.hash
|
|
71
|
+
}, '*');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
window.addEventListener('hashchange', sendCurrentUrlToParent, false);
|
|
75
|
+
window.addEventListener('popstate', sendCurrentUrlToParent, false);
|
|
76
|
+
window.addEventListener('DOMContentLoaded', sendCurrentUrlToParent, false);
|
|
77
|
+
</script>
|
|
64
78
|
|
|
65
79
|
<div class="navbar navbar-default navbar-fixed-top d-md-none p-0">
|
|
66
80
|
<div class="d-flex">
|
|
@@ -70,7 +84,14 @@
|
|
|
70
84
|
</div>
|
|
71
85
|
|
|
72
86
|
<div class="xs-menu menu" id="mobile-menu">
|
|
73
|
-
<div id="book-search-input" role="search"
|
|
87
|
+
<div id="book-search-input" role="search">
|
|
88
|
+
<input type="text" placeholder="Type to search">
|
|
89
|
+
<button type="button"
|
|
90
|
+
class="search-input-clear"
|
|
91
|
+
aria-label="Clear search"
|
|
92
|
+
data-search-input-clear>×</button>
|
|
93
|
+
</div>
|
|
94
|
+
<compodoc-menu></compodoc-menu>
|
|
74
95
|
</div>
|
|
75
96
|
|
|
76
97
|
<div class="container-fluid main">
|
|
@@ -97,6 +118,10 @@
|
|
|
97
118
|
|
|
98
119
|
|
|
99
120
|
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
100
125
|
|
|
101
126
|
|
|
102
127
|
<ol class="breadcrumb">
|
|
@@ -112,19 +137,19 @@
|
|
|
112
137
|
<td class="col-md-4">
|
|
113
138
|
<ul class="index-list">
|
|
114
139
|
<li>
|
|
115
|
-
<a href="#defaultLoadModule" title="src/lib/load-languages.ts" ><b>defaultLoadModule</b> (src/.../load-languages.ts)</a>
|
|
140
|
+
<a href="#defaultLoadModule" title="src/lib/load-languages.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>defaultLoadModule</b> (src/.../load-languages.ts)</span></a>
|
|
116
141
|
</li>
|
|
117
142
|
<li>
|
|
118
|
-
<a href="#initGenerator" title="src/generators/init/generator.ts" ><b>initGenerator</b> (src/.../generator.ts)</a>
|
|
143
|
+
<a href="#initGenerator" title="src/generators/init/generator.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>initGenerator</b> (src/.../generator.ts)</span></a>
|
|
119
144
|
</li>
|
|
120
145
|
<li>
|
|
121
|
-
<a href="#LanguageInterceptor" title="src/lib/language-interceptor.ts" ><b>LanguageInterceptor</b> (src/.../language-interceptor.ts)</a>
|
|
146
|
+
<a href="#LanguageInterceptor" title="src/lib/language-interceptor.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>LanguageInterceptor</b> (src/.../language-interceptor.ts)</span></a>
|
|
122
147
|
</li>
|
|
123
148
|
<li>
|
|
124
|
-
<a href="#loadI18nBootstrapHook" title="src/lib/load-i18n-bootstrap-hook.ts" ><b>loadI18nBootstrapHook</b> (src/.../load-i18n-bootstrap-hook.ts)</a>
|
|
149
|
+
<a href="#loadI18nBootstrapHook" title="src/lib/load-i18n-bootstrap-hook.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>loadI18nBootstrapHook</b> (src/.../load-i18n-bootstrap-hook.ts)</span></a>
|
|
125
150
|
</li>
|
|
126
151
|
<li>
|
|
127
|
-
<a href="#loadLanguages" title="src/lib/load-languages.ts" ><b>loadLanguages</b> (src/.../load-languages.ts)</a>
|
|
152
|
+
<a href="#loadLanguages" title="src/lib/load-languages.ts" class="reference-link "><span class="reference-badge reference-badge--function" aria-hidden="true">F</span><span class="reference-link-label"><b>loadLanguages</b> (src/.../load-languages.ts)</span></a>
|
|
128
153
|
</li>
|
|
129
154
|
</ul>
|
|
130
155
|
</td>
|
|
@@ -211,7 +236,7 @@
|
|
|
211
236
|
</tr>
|
|
212
237
|
<tr>
|
|
213
238
|
<td class="col-md-4">
|
|
214
|
-
<code>loadLanguages(fetchTranslations: <a href="../
|
|
239
|
+
<code>loadLanguages(fetchTranslations: <a href="../miscellaneous/typealiases.html#FetchTranslationsFunction" target="_self">FetchTranslationsFunction</a>, loadModule: <a href="../miscellaneous/typealiases.html#LoadModuleFunction" target="_self">LoadModuleFunction</a>, locale: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, preferredLanguages: unknown, fallback: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
215
240
|
</td>
|
|
216
241
|
</tr>
|
|
217
242
|
|
|
@@ -304,6 +329,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
304
329
|
<tr>
|
|
305
330
|
<td>preferredLanguages</td>
|
|
306
331
|
<td>
|
|
332
|
+
<code>unknown</code>
|
|
307
333
|
</td>
|
|
308
334
|
|
|
309
335
|
<td>
|
|
@@ -349,7 +375,8 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
349
375
|
</tr>
|
|
350
376
|
</tbody>
|
|
351
377
|
</table>
|
|
352
|
-
</section>
|
|
378
|
+
</section>
|
|
379
|
+
<h3>src/generators/init/generator.ts</h3>
|
|
353
380
|
<section data-compodoc="block-methods">
|
|
354
381
|
<h3></h3> <table class="table table-sm table-bordered">
|
|
355
382
|
<tbody>
|
|
@@ -364,7 +391,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
364
391
|
</tr>
|
|
365
392
|
<tr>
|
|
366
393
|
<td class="col-md-4">
|
|
367
|
-
<code>initGenerator(tree: Tree
|
|
394
|
+
<code>initGenerator(tree: <a href="https://angular.dev/api/aria/tree/Tree" target="_blank">Tree</a>, options: InitGeneratorSchema)</code>
|
|
368
395
|
</td>
|
|
369
396
|
</tr>
|
|
370
397
|
|
|
@@ -389,7 +416,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
389
416
|
<tr>
|
|
390
417
|
<td>tree</td>
|
|
391
418
|
<td>
|
|
392
|
-
|
|
419
|
+
<code><a href="https://angular.dev/api/aria/tree/Tree" target="_blank" >Tree</a></code>
|
|
393
420
|
</td>
|
|
394
421
|
|
|
395
422
|
<td>
|
|
@@ -417,7 +444,8 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
417
444
|
</tr>
|
|
418
445
|
</tbody>
|
|
419
446
|
</table>
|
|
420
|
-
</section>
|
|
447
|
+
</section>
|
|
448
|
+
<h3>src/lib/language-interceptor.ts</h3>
|
|
421
449
|
<section data-compodoc="block-methods">
|
|
422
450
|
<h3></h3> <table class="table table-sm table-bordered">
|
|
423
451
|
<tbody>
|
|
@@ -432,7 +460,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
432
460
|
</tr>
|
|
433
461
|
<tr>
|
|
434
462
|
<td class="col-md-4">
|
|
435
|
-
<code>LanguageInterceptor(request: HttpRequest
|
|
463
|
+
<code>LanguageInterceptor(request: <a href="https://angular.dev/api/common/http/HttpRequest" target="_blank">HttpRequest</a>, next: <a href="https://angular.dev/api/common/http/HttpHandlerFn" target="_blank">HttpHandlerFn</a>)</code>
|
|
436
464
|
</td>
|
|
437
465
|
</tr>
|
|
438
466
|
|
|
@@ -460,7 +488,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
460
488
|
<tr>
|
|
461
489
|
<td>request</td>
|
|
462
490
|
<td>
|
|
463
|
-
|
|
491
|
+
<code><a href="https://angular.dev/api/common/http/HttpRequest" target="_blank" >HttpRequest</a></code>
|
|
464
492
|
</td>
|
|
465
493
|
|
|
466
494
|
<td>
|
|
@@ -478,7 +506,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
478
506
|
<tr>
|
|
479
507
|
<td>next</td>
|
|
480
508
|
<td>
|
|
481
|
-
|
|
509
|
+
<code><a href="https://angular.dev/api/common/http/HttpHandlerFn" target="_blank" >HttpHandlerFn</a></code>
|
|
482
510
|
</td>
|
|
483
511
|
|
|
484
512
|
<td>
|
|
@@ -497,7 +525,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
497
525
|
</table>
|
|
498
526
|
</div>
|
|
499
527
|
<div class="io-description">
|
|
500
|
-
<b>Returns : </b> <code>Observable<HttpEvent<
|
|
528
|
+
<b>Returns : </b> <code>Observable<HttpEvent<unknown>></code>
|
|
501
529
|
|
|
502
530
|
</div>
|
|
503
531
|
<div class="io-description">
|
|
@@ -508,7 +536,8 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
508
536
|
</tr>
|
|
509
537
|
</tbody>
|
|
510
538
|
</table>
|
|
511
|
-
</section>
|
|
539
|
+
</section>
|
|
540
|
+
<h3>src/lib/load-i18n-bootstrap-hook.ts</h3>
|
|
512
541
|
<section data-compodoc="block-methods">
|
|
513
542
|
<h3></h3> <table class="table table-sm table-bordered">
|
|
514
543
|
<tbody>
|
|
@@ -523,7 +552,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
523
552
|
</tr>
|
|
524
553
|
<tr>
|
|
525
554
|
<td class="col-md-4">
|
|
526
|
-
<code>loadI18nBootstrapHook(fetchTranslations: <a href="../
|
|
555
|
+
<code>loadI18nBootstrapHook(fetchTranslations: <a href="../miscellaneous/typealiases.html#FetchTranslationsFunction" target="_self">FetchTranslationsFunction</a>, loadModule: <a href="../miscellaneous/typealiases.html#LoadModuleFunction" target="_self">LoadModuleFunction</a>, locale?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, preferredLanguages?, fallback?: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
527
556
|
</td>
|
|
528
557
|
</tr>
|
|
529
558
|
|
|
@@ -626,6 +655,7 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
626
655
|
</section>
|
|
627
656
|
|
|
628
657
|
|
|
658
|
+
|
|
629
659
|
</div><div class="search-results">
|
|
630
660
|
<div class="has-results">
|
|
631
661
|
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
|
@@ -658,6 +688,24 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
658
688
|
|
|
659
689
|
<script>
|
|
660
690
|
$darkModeToggleSwitchers = document.querySelectorAll('.dark-mode-switch input');
|
|
691
|
+
var updateDarkModeSwitchOffset = function () {
|
|
692
|
+
var content = document.querySelector('.content');
|
|
693
|
+
var scrollbarWidth = 0;
|
|
694
|
+
|
|
695
|
+
if (content) {
|
|
696
|
+
scrollbarWidth = Math.max(0, content.offsetWidth - content.clientWidth);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
document.documentElement.style.setProperty(
|
|
700
|
+
'--content-scrollbar-width',
|
|
701
|
+
scrollbarWidth + 'px'
|
|
702
|
+
);
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
updateDarkModeSwitchOffset();
|
|
706
|
+
requestAnimationFrame(updateDarkModeSwitchOffset);
|
|
707
|
+
window.addEventListener('resize', updateDarkModeSwitchOffset);
|
|
708
|
+
|
|
661
709
|
checkToggle(darkModeState);
|
|
662
710
|
if ($darkModeToggleSwitchers.length > 0) {
|
|
663
711
|
for (var i = 0; i < $darkModeToggleSwitchers.length; i++) {
|
|
@@ -673,14 +721,12 @@ and a fallback, then initializes the translations and optionally loads additiona
|
|
|
673
721
|
<script src="../js/libs/lit-html.js"></script>
|
|
674
722
|
|
|
675
723
|
<script src="../js/menu-wc.js" defer></script>
|
|
676
|
-
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
|
677
724
|
|
|
678
725
|
<script src="../js/libs/bootstrap-native.js"></script>
|
|
679
726
|
|
|
680
727
|
<script src="../js/libs/es6-shim.min.js"></script>
|
|
681
728
|
<script src="../js/libs/EventDispatcher.js"></script>
|
|
682
729
|
<script src="../js/libs/promise.min.js"></script>
|
|
683
|
-
<script src="../js/libs/zepto.min.js"></script>
|
|
684
730
|
|
|
685
731
|
<script src="../js/compodoc.js"></script>
|
|
686
732
|
|