@esfaenza/localizations 12.2.10 → 13.1.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/esfaenza-localizations.d.ts +1 -1
- package/esm2020/esfaenza-localizations.mjs +5 -0
- package/esm2020/lib/core/localization.base.mjs +177 -0
- package/esm2020/lib/localizations.module.mjs +30 -0
- package/esm2020/lib/localizations.service.mjs +112 -0
- package/{esm2015/lib/models/classes/ItemLocalization.js → esm2020/lib/models/classes/ItemLocalization.mjs} +0 -0
- package/{esm2015/lib/models/classes/LocaleDefinitions.js → esm2020/lib/models/classes/LocaleDefinitions.mjs} +0 -0
- package/{esm2015/lib/models/classes/LocaleObject.js → esm2020/lib/models/classes/LocaleObject.mjs} +0 -0
- package/{esm2015/lib/models/classes/LocalizationModuleConfig.js → esm2020/lib/models/classes/LocalizationModuleConfig.mjs} +0 -0
- package/{esm2015/lib/models/classes/SpecializedLocalization.js → esm2020/lib/models/classes/SpecializedLocalization.mjs} +0 -0
- package/{esm2015/lib/models/index.js → esm2020/lib/models/index.mjs} +0 -0
- package/esm2020/lib/pipes/loc_date.pipe.mjs +43 -0
- package/esm2020/lib/pipes/localize.pipe.mjs +39 -0
- package/{esm2015/lib/tokens.js → esm2020/lib/tokens.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/fesm2015/{esfaenza-localizations.js → esfaenza-localizations.mjs} +45 -32
- package/fesm2015/esfaenza-localizations.mjs.map +1 -0
- package/fesm2020/esfaenza-localizations.mjs +488 -0
- package/fesm2020/esfaenza-localizations.mjs.map +1 -0
- package/lib/core/localization.base.d.ts +3 -0
- package/lib/localizations.module.d.ts +6 -0
- package/lib/localizations.service.d.ts +3 -0
- package/lib/pipes/loc_date.pipe.d.ts +3 -0
- package/lib/pipes/localize.pipe.d.ts +3 -0
- package/package.json +22 -10
- package/bundles/esfaenza-localizations.umd.js +0 -508
- package/bundles/esfaenza-localizations.umd.js.map +0 -1
- package/esfaenza-localizations.metadata.json +0 -1
- package/esm2015/esfaenza-localizations.js +0 -6
- package/esm2015/lib/core/localization.base.js +0 -175
- package/esm2015/lib/localizations.module.js +0 -25
- package/esm2015/lib/localizations.service.js +0 -109
- package/esm2015/lib/pipes/loc_date.pipe.js +0 -41
- package/esm2015/lib/pipes/localize.pipe.js +0 -38
- package/fesm2015/esfaenza-localizations.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@esfaenza/localizations",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.1.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.0.0"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@angular/common": "~
|
|
9
|
-
"@angular/core": "~
|
|
10
|
-
"@esfaenza/extensions": "^
|
|
8
|
+
"@angular/common": "~13.1.1",
|
|
9
|
+
"@angular/core": "~13.1.1",
|
|
10
|
+
"@esfaenza/extensions": "^13.1.2"
|
|
11
11
|
},
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"fesm2015": "fesm2015/esfaenza-localizations.
|
|
12
|
+
"module": "fesm2015/esfaenza-localizations.mjs",
|
|
13
|
+
"es2020": "fesm2020/esfaenza-localizations.mjs",
|
|
14
|
+
"esm2020": "esm2020/esfaenza-localizations.mjs",
|
|
15
|
+
"fesm2020": "fesm2020/esfaenza-localizations.mjs",
|
|
16
|
+
"fesm2015": "fesm2015/esfaenza-localizations.mjs",
|
|
17
17
|
"typings": "esfaenza-localizations.d.ts",
|
|
18
|
-
"
|
|
18
|
+
"exports": {
|
|
19
|
+
"./package.json": {
|
|
20
|
+
"default": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./esfaenza-localizations.d.ts",
|
|
24
|
+
"esm2020": "./esm2020/esfaenza-localizations.mjs",
|
|
25
|
+
"es2020": "./fesm2020/esfaenza-localizations.mjs",
|
|
26
|
+
"es2015": "./fesm2015/esfaenza-localizations.mjs",
|
|
27
|
+
"node": "./fesm2015/esfaenza-localizations.mjs",
|
|
28
|
+
"default": "./fesm2020/esfaenza-localizations.mjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
19
31
|
"sideEffects": false
|
|
20
32
|
}
|
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@esfaenza/extensions')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@esfaenza/localizations', ['exports', '@angular/core', '@esfaenza/extensions'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.esfaenza = global.esfaenza || {}, global.esfaenza.localizations = {}), global.ng.core, global.extensions));
|
|
5
|
-
})(this, (function (exports, core, extensions) { 'use strict';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Locale da utilizzare per le traduzioni
|
|
9
|
-
*/
|
|
10
|
-
var LOC_LOCALE = new core.InjectionToken('LOC_LOCALE');
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Contenitore delle localizzazioni collegate ad un testo "base", una per ogni linguaggio supportato
|
|
14
|
-
*/
|
|
15
|
-
var ItemLocalization = /** @class */ (function () {
|
|
16
|
-
/**
|
|
17
|
-
* Costruttore
|
|
18
|
-
*
|
|
19
|
-
* @param {boolean} token Indica se è un token o se è un testo
|
|
20
|
-
* @param {string} baseText Testo base che verrà richiesto quando verrà cercata la localizzazione
|
|
21
|
-
* @param {SpecializedLocalization[]} translations Lista di traduzioni in base al testo base
|
|
22
|
-
*/
|
|
23
|
-
function ItemLocalization(token, baseText, translations) {
|
|
24
|
-
this.token = token;
|
|
25
|
-
this.baseText = baseText;
|
|
26
|
-
this.translations = translations;
|
|
27
|
-
}
|
|
28
|
-
return ItemLocalization;
|
|
29
|
-
}());
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Classe che rappresenta un locale (Es. 'Italiano') con i propri alias (Es. 'it' oppure 'it-IT')
|
|
33
|
-
*/
|
|
34
|
-
var LocaleObject = /** @class */ (function () {
|
|
35
|
-
/**
|
|
36
|
-
* Costruttore
|
|
37
|
-
*
|
|
38
|
-
* @param {string} id Codice locale
|
|
39
|
-
* @param {string} description Descrizione locale
|
|
40
|
-
* @param {string[]} aliases Alias con cui quel locale è conosciuto
|
|
41
|
-
*/
|
|
42
|
-
function LocaleObject(id, description, aliases) {
|
|
43
|
-
this.id = id;
|
|
44
|
-
this.description = description;
|
|
45
|
-
this.aliases = aliases;
|
|
46
|
-
}
|
|
47
|
-
return LocaleObject;
|
|
48
|
-
}());
|
|
49
|
-
|
|
50
|
-
// VVVVVVVV Tag per evitare che typescript muoia con l'errore "Error encountered in metadata generated for exported symbol 'LocaleDefinitions'" (https://github.com/angular/angular/issues/18867#issuecomment-357484102),
|
|
51
|
-
// @dynamic
|
|
52
|
-
/**
|
|
53
|
-
* Definizione dei locali disponibili
|
|
54
|
-
*/
|
|
55
|
-
var LocaleDefinitions = /** @class */ (function () {
|
|
56
|
-
/**
|
|
57
|
-
* Costruttore
|
|
58
|
-
*
|
|
59
|
-
* @ignore
|
|
60
|
-
*/
|
|
61
|
-
function LocaleDefinitions() {
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* In base a un alias restituisce il locale rappresentato
|
|
65
|
-
*
|
|
66
|
-
* @param {string} alias Alias in base al quale raccogliere il Locale
|
|
67
|
-
*
|
|
68
|
-
* @returns {LocaleObject} Locale richiesto dall'alias
|
|
69
|
-
*/
|
|
70
|
-
LocaleDefinitions.getByAlias = function (alias) {
|
|
71
|
-
return this.AvailableLocales.find(function (t) { return !!t.aliases.find(function (a) { return a == alias; }); });
|
|
72
|
-
};
|
|
73
|
-
return LocaleDefinitions;
|
|
74
|
-
}());
|
|
75
|
-
/**
|
|
76
|
-
* Lista dei locali disponibili, definiti anche con i vari alias
|
|
77
|
-
*/
|
|
78
|
-
LocaleDefinitions.AvailableLocales = [
|
|
79
|
-
new LocaleObject('it-IT', 'Italiano', ['it', 'it-IT']),
|
|
80
|
-
new LocaleObject('en-US', 'English', ['en', 'en-US'])
|
|
81
|
-
];
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Classe di configurazione per il modulo di localizzazione
|
|
85
|
-
*/
|
|
86
|
-
var LocalizationModuleConfig = /** @class */ (function () {
|
|
87
|
-
function LocalizationModuleConfig() {
|
|
88
|
-
}
|
|
89
|
-
return LocalizationModuleConfig;
|
|
90
|
-
}());
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Classe che rappresenta la localizzazione di un test base per una certa lingua
|
|
94
|
-
*/
|
|
95
|
-
var SpecializedLocalization = /** @class */ (function () {
|
|
96
|
-
/**
|
|
97
|
-
* Costruttore
|
|
98
|
-
*
|
|
99
|
-
* @param {string} culture Culture della traduzione
|
|
100
|
-
* @param {string} translation Traduzione nella lingua specificata dalla **culture**
|
|
101
|
-
*/
|
|
102
|
-
function SpecializedLocalization(culture, translation) {
|
|
103
|
-
this.culture = culture;
|
|
104
|
-
this.translation = translation;
|
|
105
|
-
}
|
|
106
|
-
return SpecializedLocalization;
|
|
107
|
-
}());
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Classe singleton che contiene le traduzioni di base (per evitare di ripeterle in oggi classe di traduzione) e le funzioni base per
|
|
111
|
-
* inserire e leggere traduzioni in/da una cache
|
|
112
|
-
*/
|
|
113
|
-
var BaseLocalization = /** @class */ (function () {
|
|
114
|
-
/**
|
|
115
|
-
* Costruttore. Da qui utilizzando il metodo statico **BaseLocalization.set** si va a popolare la cache delle traduzioni **BaseTranslations**
|
|
116
|
-
*/
|
|
117
|
-
function BaseLocalization() {
|
|
118
|
-
/**
|
|
119
|
-
* Cache di tutte le localizzazioni di base
|
|
120
|
-
*/
|
|
121
|
-
this.BaseTranslations = {};
|
|
122
|
-
// Odio sprecare caratteri... soprattutto quando rischio che non vengano minificati
|
|
123
|
-
var bt = this.BaseTranslations;
|
|
124
|
-
var bl = BaseLocalization;
|
|
125
|
-
bl.set(bt, "en->it", "Remove", ["Elimina"]);
|
|
126
|
-
bl.set(bt, "en->it", "Paging", ["Paginazione"]);
|
|
127
|
-
bl.set(bt, "en->it", "Yes", ["Si"]);
|
|
128
|
-
bl.set(bt, "en->it", "No", ["No"]);
|
|
129
|
-
bl.set(bt, "en->it", "YES", ["SI'"]);
|
|
130
|
-
bl.set(bt, "en->it", "NO", ["NO"]);
|
|
131
|
-
bl.set(bt, "en->it", "Found objects", ["Risultati trovati"]);
|
|
132
|
-
bl.set(bt, "en->it", "Loading data...", ["Carico i dati..."]);
|
|
133
|
-
bl.set(bt, "en->it", "Error during save operations", ["Errori durante il salvataggio"]);
|
|
134
|
-
bl.set(bt, "en->it", "Error", ["Errore"]);
|
|
135
|
-
bl.set(bt, "en->it", "Warning", ["Avviso"]);
|
|
136
|
-
bl.set(bt, "en->it", "Information", ["Informazione"]);
|
|
137
|
-
bl.set(bt, "en->it", "Save", ["Salva"]);
|
|
138
|
-
bl.set(bt, "en->it", "Back", ["Indietro"]);
|
|
139
|
-
bl.set(bt, "en->it", "From", ["Da"]);
|
|
140
|
-
bl.set(bt, "en->it", "To", ["A"]);
|
|
141
|
-
bl.set(bt, "en->it", "View Chart", ["Vedi Grafico"]);
|
|
142
|
-
bl.set(bt, "en->it", "View Table", ["Vedi Tabella"]);
|
|
143
|
-
bl.set(bt, "en->it", "Notes", ["Note"]);
|
|
144
|
-
bl.set(bt, "en->it", "Edit Notes", ["Modifica Note"]);
|
|
145
|
-
bl.set(bt, "en->it", "Cancel", ["Annulla"]);
|
|
146
|
-
bl.set(bt, "en->it", "Confirm", ["Conferma"]);
|
|
147
|
-
bl.set(bt, "en->it", "View", ["Visualizza"]);
|
|
148
|
-
bl.set(bt, "en->it", "Close", ["Chiudi"]);
|
|
149
|
-
bl.set(bt, "en->it", "Select", ["Seleziona"]);
|
|
150
|
-
bl.set(bt, "en->it", "Meter Reading registered successfully", ["Lettura registrata correttamente"]);
|
|
151
|
-
bl.set(bt, "en->it", "Validation errors during save operations", ["Errori di validazione durante il salvataggio"]);
|
|
152
|
-
bl.set(bt, "en->it", "Can't register reading", ["Impossibile registrare la lettura"]);
|
|
153
|
-
bl.set(bt, "en->it", "Electricity", ["Elettricita"]);
|
|
154
|
-
bl.set(bt, "en->it", "Gas", ["Gas"]);
|
|
155
|
-
bl.set(bt, "en->it", "Water", ["Acqua"]);
|
|
156
|
-
bl.set(bt, "en->it", "Delete", ["Elimina"]);
|
|
157
|
-
bl.set(bt, "en->it", "This operation cannot be reverted", ["Questa operazione non puo' essere annullata"]);
|
|
158
|
-
bl.set(bt, "en->it", "Hide", ["Nascondi"]);
|
|
159
|
-
// Helper validazione
|
|
160
|
-
bl.set(bt, "en->it", "Required field", ["Campo richiesto"]);
|
|
161
|
-
bl.set(bt, "en->it", "Wrong field format", ["Formato campo errato"]);
|
|
162
|
-
bl.set(bt, "en->it", "Wrong field format or field missing", ["Formato campo errato o campo mancante"]);
|
|
163
|
-
bl.set(bt, "en->it", "You don't have the required permissions to view this page. The navigation has been blocked", ["Non si hanno privilegi a sufficienza per accedere a questa pagina. La navigazione e' stata bloccata"]);
|
|
164
|
-
// Informazioni sulle date
|
|
165
|
-
bl.setToken(bt, "en->it", "getDateMonthPosition", "0", ["1"]);
|
|
166
|
-
bl.setToken(bt, "en->it", "getDisplayDateMonthPosition", "1", ["1"]);
|
|
167
|
-
bl.setToken(bt, "en->it", "getLocale", "en-US", ["it-IT"]);
|
|
168
|
-
bl.setToken(bt, "en->it", "getSmallDateFormat", "MM/DD/YYYY", ["DD/MM/YYYY"]);
|
|
169
|
-
bl.setToken(bt, "en->it", "getDefaultDateFormat", "MM/DD/YYYY", ["MM/DD/YYYY"]);
|
|
170
|
-
bl.setToken(bt, "en->it", "getSmallDateDisplayFormat", "DD/MM/YYYY", ["DD/MM/YYYY"]);
|
|
171
|
-
bl.setToken(bt, "en->it", "getFullDateFormat", "MM/DD/YYYY HH:mm:ss", ["DD/MM/YYYY HH:mm:ss"]);
|
|
172
|
-
bl.setToken(bt, "en->it", "getFullDateDisplayFormat", "DD/MM/YYYY HH:mm:ss", ["DD/MM/YYYY HH:mm:ss"]);
|
|
173
|
-
bl.setToken(bt, "en->it", "getFullDateFormatNoSeconds", "MM/DD/YYYY HH:mm", ["DD/MM/YYYY HH:mm"]);
|
|
174
|
-
bl.setToken(bt, "en->it", "getFullDateDisplayFormatNoSeconds", "DD/MM/YYYY HH:mm", ["DD/MM/YYYY HH:mm"]);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Imposta la localizzazione di un token all'interno della cache scelta
|
|
178
|
-
*
|
|
179
|
-
* @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno della quale inserire l'informazione del token con le localizzazioni
|
|
180
|
-
* @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.
|
|
181
|
-
* Ad esempio, "en->it" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right**
|
|
182
|
-
* è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio "en->it,jp,ecc"
|
|
183
|
-
* @param {string} token Nome del token
|
|
184
|
-
* @param {string} left Valore del token per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**
|
|
185
|
-
* @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**
|
|
186
|
-
*/
|
|
187
|
-
BaseLocalization.setToken = function (locCache, direction, token, left, right) {
|
|
188
|
-
var parsingRegex = /([a-zA-Z]+)[\s]*->[\s]*([a-zA-Z,\s]+)+/g;
|
|
189
|
-
var parsingRes = parsingRegex.exec(direction);
|
|
190
|
-
var from = parsingRes[1];
|
|
191
|
-
var to = parsingRes[2].replace(/\s/g, '').split(',');
|
|
192
|
-
var localeFrom = LocaleDefinitions.getByAlias(from);
|
|
193
|
-
BaseLocalization._set(locCache, token, localeFrom.id, left, true);
|
|
194
|
-
to.forEach(function (t, index) {
|
|
195
|
-
var localeTo = LocaleDefinitions.getByAlias(t);
|
|
196
|
-
BaseLocalization._set(locCache, token, localeTo.id, right[index], true);
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
/**
|
|
200
|
-
* Imposta la localizzazione di una frase all'interno della cache scelta
|
|
201
|
-
*
|
|
202
|
-
* @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno della quale inserire l'informazione della frase con le localizzazioni
|
|
203
|
-
* @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.
|
|
204
|
-
* Ad esempio, "en->it" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right**
|
|
205
|
-
* è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio "en->it,jp,ecc"
|
|
206
|
-
* @param {string} left Valore della frase per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**
|
|
207
|
-
* @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**
|
|
208
|
-
*/
|
|
209
|
-
BaseLocalization.set = function (locCache, direction, left, right) {
|
|
210
|
-
var parsingRegex = /([a-zA-Z]+)[\s]*->[\s]*([a-zA-Z,\s]+)+/g;
|
|
211
|
-
var parsingRes = parsingRegex.exec(direction);
|
|
212
|
-
var from = parsingRes[1];
|
|
213
|
-
var to = parsingRes[2].replace(/\s/g, '').split(',');
|
|
214
|
-
var localeFrom = LocaleDefinitions.getByAlias(from);
|
|
215
|
-
BaseLocalization._set(locCache, left, localeFrom.id, left);
|
|
216
|
-
to.forEach(function (t, index) {
|
|
217
|
-
var localeTo = LocaleDefinitions.getByAlias(t);
|
|
218
|
-
BaseLocalization._set(locCache, left, localeTo.id, right[index]);
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* Imposta all'interno della cache specificata un'unica traduzione partendo da un testo di base
|
|
223
|
-
*
|
|
224
|
-
* @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno della quale inserire l'informazione del testo con le localizzazioni
|
|
225
|
-
* @param {string} text Testo da tradurre
|
|
226
|
-
* @param {string} culture Lingua per cui inserire la traduzione
|
|
227
|
-
* @param {string} translation Traduzione del **text** nella lingua specificata da **culture**
|
|
228
|
-
* @param {boolean} token Indica se il **text** è un token o è una frase normale
|
|
229
|
-
*/
|
|
230
|
-
BaseLocalization._set = function (locCache, text, culture, translation, token) {
|
|
231
|
-
var item = BaseLocalization.findByText(locCache, text, token);
|
|
232
|
-
if (!item) {
|
|
233
|
-
locCache[text] = new ItemLocalization(token, text, [new SpecializedLocalization(culture, translation)]);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
var trs = BaseLocalization.translationByCulture(item, culture);
|
|
237
|
-
if (trs) {
|
|
238
|
-
console.warn("Localization already loaded for sentence '" + text + "' and culture " + culture);
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
item.translations.push(new SpecializedLocalization(culture, translation));
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Partendo da una cache di localizzazione, dato un testo che può essere o meno un token, cerca quell'elemento all'interno della cache
|
|
245
|
-
*
|
|
246
|
-
* @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno del quale cercare il **text**
|
|
247
|
-
* @param {string} text Testo da cercare nella **locCache**
|
|
248
|
-
* @param {boolean} allowtokens Indica se l'elemento cercato può essere un token o se dev'essere per forza una frase (per evitare rari
|
|
249
|
-
* casi di collisione in cui magari un token è uguale a una frase tradotta)
|
|
250
|
-
*
|
|
251
|
-
* @returns {ItemLocalization} Informazioni di localizzazione per il **text** cercato
|
|
252
|
-
*/
|
|
253
|
-
BaseLocalization.findByText = function (locCache, text, allowtokens) {
|
|
254
|
-
var possibleItem = locCache[text];
|
|
255
|
-
if (!possibleItem)
|
|
256
|
-
return null;
|
|
257
|
-
var item = allowtokens || !possibleItem.token ? possibleItem : null;
|
|
258
|
-
return item;
|
|
259
|
-
};
|
|
260
|
-
/**
|
|
261
|
-
* Date le informazioni di localizzazione per un testo cerca e restituisce la traduzione per una lingua specifica
|
|
262
|
-
*
|
|
263
|
-
* @param {ItemLocalization} Informazioni di localizzazione
|
|
264
|
-
* @param {string} culture Lingua della traduzione richiesta
|
|
265
|
-
*
|
|
266
|
-
* @returns {SpecializedLocalization} Informazioni di localizzazione specifiche della lingua richiesta
|
|
267
|
-
*/
|
|
268
|
-
BaseLocalization.translationByCulture = function (item, culture) {
|
|
269
|
-
for (var i = 0; i < item.translations.length; i++) {
|
|
270
|
-
var trl = item.translations[i];
|
|
271
|
-
if (trl.culture == culture)
|
|
272
|
-
return trl;
|
|
273
|
-
}
|
|
274
|
-
return null;
|
|
275
|
-
};
|
|
276
|
-
return BaseLocalization;
|
|
277
|
-
}());
|
|
278
|
-
BaseLocalization.decorators = [
|
|
279
|
-
{ type: core.Injectable }
|
|
280
|
-
];
|
|
281
|
-
BaseLocalization.ctorParameters = function () { return []; };
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Classe di localizzazione estendibile che permette di specificare le proprie localizzazioni e comunque rendere disponibili le localizzazioni globali
|
|
285
|
-
*/
|
|
286
|
-
var LocalizationService = /** @class */ (function () {
|
|
287
|
-
/**
|
|
288
|
-
* Costruttore
|
|
289
|
-
*
|
|
290
|
-
* @param {string} baseLoc Locale da utilizzare nel momento che questo servizio richiede le traduzioni
|
|
291
|
-
* @param {baseLocalization} baseLocalization Classe base di localizzazione già fornita a livello di root dalla libreria stessa.
|
|
292
|
-
* È sufficiente iniettarla nell'eventuale costruttore che estende questa classe e passarla as-is
|
|
293
|
-
*/
|
|
294
|
-
function LocalizationService(baseLoc, baseLocalization) {
|
|
295
|
-
this.baseLoc = baseLoc;
|
|
296
|
-
this.baseLocalization = baseLocalization;
|
|
297
|
-
/**
|
|
298
|
-
* Cache di tutte le localizzazioni disonibili all'interno di questa classe
|
|
299
|
-
*/
|
|
300
|
-
this.TranslationCache = {};
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Imposta la localizzazione di un token all'interno della **TranslationCache**
|
|
304
|
-
*
|
|
305
|
-
* @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.
|
|
306
|
-
* Ad esempio, "en->it" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right**
|
|
307
|
-
* è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio "en->it,jp,ecc"
|
|
308
|
-
* @param {string} token Nome del token
|
|
309
|
-
* @param {string} left Valore del token per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**
|
|
310
|
-
* @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**
|
|
311
|
-
*/
|
|
312
|
-
LocalizationService.prototype.setToken = function (direction, token, left, right) {
|
|
313
|
-
BaseLocalization.setToken(this.TranslationCache, direction, token, left, right);
|
|
314
|
-
};
|
|
315
|
-
/**
|
|
316
|
-
* Imposta la localizzazione di una frase all'interno della **TranslationCache**
|
|
317
|
-
*
|
|
318
|
-
* @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.
|
|
319
|
-
* Ad esempio, "en->it" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right**
|
|
320
|
-
* è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio "en->it,jp,ecc"
|
|
321
|
-
* @param {string} left Valore della frase per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**
|
|
322
|
-
* @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**
|
|
323
|
-
*/
|
|
324
|
-
LocalizationService.prototype.set = function (direction, left, right) {
|
|
325
|
-
BaseLocalization.set(this.TranslationCache, direction, left, right);
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* Localizza un token
|
|
329
|
-
*
|
|
330
|
-
* @param {string} text Il token da localizzare
|
|
331
|
-
*
|
|
332
|
-
* @returns {string} Token localizzato
|
|
333
|
-
*/
|
|
334
|
-
LocalizationService.prototype.token = function (text) {
|
|
335
|
-
return this.loc(text, true);
|
|
336
|
-
};
|
|
337
|
-
/**
|
|
338
|
-
* Localizza una frase
|
|
339
|
-
*
|
|
340
|
-
* @param {string} text Frase da localizzare
|
|
341
|
-
* @param {boolean} allowtokens Indica se la frase **text** potrebbe essere un token o no
|
|
342
|
-
*
|
|
343
|
-
* @returns {string} Frase localizzata
|
|
344
|
-
*/
|
|
345
|
-
LocalizationService.prototype.loc = function (text, allowtokens) {
|
|
346
|
-
if (!text || text == "undefined")
|
|
347
|
-
return "";
|
|
348
|
-
// Questo può succedere solo se qualcuno crea questa service a manazza. In quel caso prendo la classe di default e basta
|
|
349
|
-
if (this.baseLocalization == null)
|
|
350
|
-
this.baseLocalization = new BaseLocalization();
|
|
351
|
-
// Prendo la localizzazione o dalla cache attuale o dalla cache del servizio base
|
|
352
|
-
var item = BaseLocalization.findByText(this.TranslationCache, text, allowtokens) || BaseLocalization.findByText(this.baseLocalization.BaseTranslations, text, allowtokens);
|
|
353
|
-
if (!item) {
|
|
354
|
-
console.error("Couldn't find localization for '" + text + "'");
|
|
355
|
-
return "";
|
|
356
|
-
}
|
|
357
|
-
var loc = BaseLocalization.translationByCulture(item, this.baseLoc);
|
|
358
|
-
if (!loc) {
|
|
359
|
-
console.error("Couldn't find localization for '" + text + "', culture " + this.baseLoc);
|
|
360
|
-
return "";
|
|
361
|
-
}
|
|
362
|
-
return loc.translation;
|
|
363
|
-
};
|
|
364
|
-
/**
|
|
365
|
-
* Localizzazione per Severity classiche (E per errore, W per warning e I per info)
|
|
366
|
-
*
|
|
367
|
-
* @param {string} text Severity da tradurre
|
|
368
|
-
*
|
|
369
|
-
* @returns {string} Severity tradotta
|
|
370
|
-
*/
|
|
371
|
-
LocalizationService.prototype.locSeverity = function (text) {
|
|
372
|
-
if (text == "E")
|
|
373
|
-
return this.loc("Error");
|
|
374
|
-
if (text == "W")
|
|
375
|
-
return this.loc("Warning");
|
|
376
|
-
if (text == "I")
|
|
377
|
-
return this.loc("Information");
|
|
378
|
-
return "";
|
|
379
|
-
};
|
|
380
|
-
return LocalizationService;
|
|
381
|
-
}());
|
|
382
|
-
LocalizationService.decorators = [
|
|
383
|
-
{ type: core.Injectable }
|
|
384
|
-
];
|
|
385
|
-
LocalizationService.ctorParameters = function () { return [
|
|
386
|
-
{ type: String, decorators: [{ type: core.Inject, args: [LOC_LOCALE,] }] },
|
|
387
|
-
{ type: BaseLocalization }
|
|
388
|
-
]; };
|
|
389
|
-
|
|
390
|
-
// Angular
|
|
391
|
-
/**
|
|
392
|
-
* Pipe che permette di formattare una data in base al formato specificato. Utilizza il **DateService** di **@esfaenza/extensions** per ricondurre l'input a una data valida
|
|
393
|
-
*/
|
|
394
|
-
var LocDatePipe = /** @class */ (function () {
|
|
395
|
-
/**
|
|
396
|
-
* @ignore
|
|
397
|
-
*/
|
|
398
|
-
function LocDatePipe(dts) {
|
|
399
|
-
this.dts = dts;
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Trasformazione della data in input in base al formato richiesto
|
|
403
|
-
*
|
|
404
|
-
* @param {any} value Valore da ricondurre ad una data e formattare
|
|
405
|
-
* @param {string} format Formato in output della data da visualizzare
|
|
406
|
-
*
|
|
407
|
-
* @returns {string} Data formattata in base al formato
|
|
408
|
-
*/
|
|
409
|
-
LocDatePipe.prototype.transform = function (value, format) {
|
|
410
|
-
if (format === void 0) { format = "DD/MM/YYY"; }
|
|
411
|
-
if (value == null || value === "")
|
|
412
|
-
return null;
|
|
413
|
-
if (!this.dts) {
|
|
414
|
-
console.error("Tentativo di usare loc_date senza DateService. È possibile importare DateService installando e configurando il pacchetto @esfaenza/extensions");
|
|
415
|
-
return null;
|
|
416
|
-
}
|
|
417
|
-
var detatchedValue = JSON.parse(JSON.stringify(value));
|
|
418
|
-
var dt = this.dts.getDateConvertion(detatchedValue);
|
|
419
|
-
return dt.format(format);
|
|
420
|
-
};
|
|
421
|
-
return LocDatePipe;
|
|
422
|
-
}());
|
|
423
|
-
LocDatePipe.decorators = [
|
|
424
|
-
{ type: core.Pipe, args: [{ name: "loc_date", pure: true },] }
|
|
425
|
-
];
|
|
426
|
-
LocDatePipe.ctorParameters = function () { return [
|
|
427
|
-
{ type: extensions.DateService, decorators: [{ type: core.Optional }] }
|
|
428
|
-
]; };
|
|
429
|
-
|
|
430
|
-
// Angular
|
|
431
|
-
/**
|
|
432
|
-
* Pipe di localizzazione per tradurre direttamente da template
|
|
433
|
-
*/
|
|
434
|
-
var LocalizePipe = /** @class */ (function () {
|
|
435
|
-
/**
|
|
436
|
-
* Costruttore
|
|
437
|
-
*
|
|
438
|
-
* @param {LocalizationService} translationContainer Container delle traduzioni disponibili nel contesto in cui viene usata la pipe.
|
|
439
|
-
*
|
|
440
|
-
* Viene iniettata dal provider dichiarato nel singolo componente che utilizza la traduzione e, se non esiste, viene iniettato dal default
|
|
441
|
-
*/
|
|
442
|
-
function LocalizePipe(translationContainer) {
|
|
443
|
-
this.translationContainer = translationContainer;
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Trasformazione della stringa in input ad una stringa tradotta
|
|
447
|
-
*
|
|
448
|
-
* @param {string} value Testo da tradurre
|
|
449
|
-
* @param {LocalizationService} locContainerOverride Override al contenitore della traduzione iniettato dal costruttore, qualora serva
|
|
450
|
-
*
|
|
451
|
-
* @returns {string} Frase tradotta
|
|
452
|
-
*/
|
|
453
|
-
LocalizePipe.prototype.transform = function (value, locContainerOverride) {
|
|
454
|
-
if (value == null || value === "")
|
|
455
|
-
return "";
|
|
456
|
-
return (locContainerOverride || this.translationContainer).loc(value);
|
|
457
|
-
};
|
|
458
|
-
return LocalizePipe;
|
|
459
|
-
}());
|
|
460
|
-
LocalizePipe.decorators = [
|
|
461
|
-
{ type: core.Pipe, args: [{ name: "localize", pure: true },] }
|
|
462
|
-
];
|
|
463
|
-
LocalizePipe.ctorParameters = function () { return [
|
|
464
|
-
{ type: LocalizationService }
|
|
465
|
-
]; };
|
|
466
|
-
|
|
467
|
-
var LocalizationModule = /** @class */ (function () {
|
|
468
|
-
function LocalizationModule() {
|
|
469
|
-
}
|
|
470
|
-
LocalizationModule.forRoot = function (config) {
|
|
471
|
-
return {
|
|
472
|
-
ngModule: LocalizationModule,
|
|
473
|
-
providers: [
|
|
474
|
-
LocalizationService,
|
|
475
|
-
BaseLocalization,
|
|
476
|
-
{ provide: LOC_LOCALE, useValue: (config === null || config === void 0 ? void 0 : config.locale) || 'it-IT' }
|
|
477
|
-
]
|
|
478
|
-
};
|
|
479
|
-
};
|
|
480
|
-
return LocalizationModule;
|
|
481
|
-
}());
|
|
482
|
-
LocalizationModule.decorators = [
|
|
483
|
-
{ type: core.NgModule, args: [{
|
|
484
|
-
declarations: [LocalizePipe, LocDatePipe],
|
|
485
|
-
exports: [LocalizePipe, LocDatePipe]
|
|
486
|
-
},] }
|
|
487
|
-
];
|
|
488
|
-
|
|
489
|
-
/*
|
|
490
|
-
* Public API Surface of localizations
|
|
491
|
-
*/
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Generated bundle index. Do not edit.
|
|
495
|
-
*/
|
|
496
|
-
|
|
497
|
-
exports.LOC_LOCALE = LOC_LOCALE;
|
|
498
|
-
exports.LocDatePipe = LocDatePipe;
|
|
499
|
-
exports.LocalizationModule = LocalizationModule;
|
|
500
|
-
exports.LocalizationModuleConfig = LocalizationModuleConfig;
|
|
501
|
-
exports.LocalizationService = LocalizationService;
|
|
502
|
-
exports.LocalizePipe = LocalizePipe;
|
|
503
|
-
exports["ɵa"] = BaseLocalization;
|
|
504
|
-
|
|
505
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
506
|
-
|
|
507
|
-
}));
|
|
508
|
-
//# sourceMappingURL=esfaenza-localizations.umd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"esfaenza-localizations.umd.js","sources":["../../../projects/localizations/src/lib/tokens.ts","../../../projects/localizations/src/lib/models/classes/ItemLocalization.ts","../../../projects/localizations/src/lib/models/classes/LocaleObject.ts","../../../projects/localizations/src/lib/models/classes/LocaleDefinitions.ts","../../../projects/localizations/src/lib/models/classes/LocalizationModuleConfig.ts","../../../projects/localizations/src/lib/models/classes/SpecializedLocalization.ts","../../../projects/localizations/src/lib/core/localization.base.ts","../../../projects/localizations/src/lib/localizations.service.ts","../../../projects/localizations/src/lib/pipes/loc_date.pipe.ts","../../../projects/localizations/src/lib/pipes/localize.pipe.ts","../../../projects/localizations/src/lib/localizations.module.ts","../../../projects/localizations/src/public-api.ts","../../../projects/localizations/src/esfaenza-localizations.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\n\r\n/**\r\n * Locale da utilizzare per le traduzioni\r\n */\r\nexport const LOC_LOCALE: InjectionToken<string> = new InjectionToken<string>('LOC_LOCALE');","import { SpecializedLocalization } from \"./SpecializedLocalization\";\r\n\r\n/**\r\n * Contenitore delle localizzazioni collegate ad un testo \"base\", una per ogni linguaggio supportato\r\n */\r\nexport class ItemLocalization {\r\n\r\n /**\r\n * Costruttore\r\n * \r\n * @param {boolean} token Indica se è un token o se è un testo\r\n * @param {string} baseText Testo base che verrà richiesto quando verrà cercata la localizzazione\r\n * @param {SpecializedLocalization[]} translations Lista di traduzioni in base al testo base\r\n */\r\n constructor(public token: boolean, public baseText: string, public translations: SpecializedLocalization[]){ }\r\n}","\r\n/**\r\n * Classe che rappresenta un locale (Es. 'Italiano') con i propri alias (Es. 'it' oppure 'it-IT')\r\n */\r\nexport class LocaleObject {\r\n\r\n /**\r\n * Costruttore\r\n * \r\n * @param {string} id Codice locale\r\n * @param {string} description Descrizione locale\r\n * @param {string[]} aliases Alias con cui quel locale è conosciuto\r\n */\r\n constructor(public id: string, public description: string, public aliases: string[]) { }\r\n}\r\n","import { LocaleObject } from \"./LocaleObject\";\r\n\r\n// VVVVVVVV Tag per evitare che typescript muoia con l'errore \"Error encountered in metadata generated for exported symbol 'LocaleDefinitions'\" (https://github.com/angular/angular/issues/18867#issuecomment-357484102),\r\n// @dynamic\r\n\r\n/**\r\n * Definizione dei locali disponibili\r\n */\r\nexport class LocaleDefinitions {\r\n\r\n /**\r\n * Costruttore\r\n * \r\n * @ignore\r\n */\r\n constructor() { }\r\n\r\n /**\r\n * Lista dei locali disponibili, definiti anche con i vari alias\r\n */\r\n public static AvailableLocales: LocaleObject[] = [\r\n new LocaleObject('it-IT', 'Italiano', ['it', 'it-IT']),\r\n new LocaleObject('en-US', 'English', ['en', 'en-US'])\r\n ];\r\n\r\n /**\r\n * In base a un alias restituisce il locale rappresentato\r\n * \r\n * @param {string} alias Alias in base al quale raccogliere il Locale\r\n * \r\n * @returns {LocaleObject} Locale richiesto dall'alias\r\n */\r\n public static getByAlias(alias: string): LocaleObject {\r\n return this.AvailableLocales.find(t => !!t.aliases.find(a => a == alias));\r\n }\r\n}\r\n","/**\r\n * Classe di configurazione per il modulo di localizzazione\r\n */\r\nexport class LocalizationModuleConfig {\r\n\r\n /**\r\n * Locale utilizzato per richiedere le traduzioni\r\n */\r\n locale: string;\r\n}\r\n","/**\r\n * Classe che rappresenta la localizzazione di un test base per una certa lingua\r\n */\r\nexport class SpecializedLocalization {\r\n\r\n /**\r\n * Costruttore\r\n * \r\n * @param {string} culture Culture della traduzione\r\n * @param {string} translation Traduzione nella lingua specificata dalla **culture**\r\n */\r\n constructor(public culture: string, public translation: string) { }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { ItemLocalization, LocaleDefinitions, SpecializedLocalization } from \"../models\";\r\n\r\n/**\r\n * Classe singleton che contiene le traduzioni di base (per evitare di ripeterle in oggi classe di traduzione) e le funzioni base per \r\n * inserire e leggere traduzioni in/da una cache\r\n */\r\n@Injectable()\r\nexport class BaseLocalization {\r\n\r\n /**\r\n * Cache di tutte le localizzazioni di base\r\n */\r\n public BaseTranslations: { [id: string]: ItemLocalization } = {};\r\n\r\n /**\r\n * Costruttore. Da qui utilizzando il metodo statico **BaseLocalization.set** si va a popolare la cache delle traduzioni **BaseTranslations**\r\n */\r\n constructor() {\r\n // Odio sprecare caratteri... soprattutto quando rischio che non vengano minificati\r\n let bt = this.BaseTranslations;\r\n let bl = BaseLocalization;\r\n\r\n bl.set(bt, \"en->it\", \"Remove\", [\"Elimina\"]);\r\n bl.set(bt, \"en->it\", \"Paging\", [\"Paginazione\"]);\r\n bl.set(bt, \"en->it\", \"Yes\", [\"Si\"]);\r\n bl.set(bt, \"en->it\", \"No\", [\"No\"]);\r\n bl.set(bt, \"en->it\", \"YES\", [\"SI'\"]);\r\n bl.set(bt, \"en->it\", \"NO\", [\"NO\"]);\r\n bl.set(bt, \"en->it\", \"Found objects\", [\"Risultati trovati\"]);\r\n bl.set(bt, \"en->it\", \"Loading data...\", [\"Carico i dati...\"]);\r\n bl.set(bt, \"en->it\", \"Error during save operations\", [\"Errori durante il salvataggio\"]);\r\n bl.set(bt, \"en->it\", \"Error\", [\"Errore\"]);\r\n bl.set(bt, \"en->it\", \"Warning\", [\"Avviso\"]);\r\n bl.set(bt, \"en->it\", \"Information\", [\"Informazione\"]);\r\n bl.set(bt, \"en->it\", \"Save\", [\"Salva\"]);\r\n bl.set(bt, \"en->it\", \"Back\", [\"Indietro\"]);\r\n bl.set(bt, \"en->it\", \"From\", [\"Da\"]);\r\n bl.set(bt, \"en->it\", \"To\", [\"A\"]);\r\n bl.set(bt, \"en->it\", \"View Chart\", [\"Vedi Grafico\"]);\r\n bl.set(bt, \"en->it\", \"View Table\", [\"Vedi Tabella\"]);\r\n bl.set(bt, \"en->it\", \"Notes\", [\"Note\"]);\r\n bl.set(bt, \"en->it\", \"Edit Notes\", [\"Modifica Note\"]);\r\n bl.set(bt, \"en->it\", \"Cancel\", [\"Annulla\"]);\r\n bl.set(bt, \"en->it\", \"Confirm\", [\"Conferma\"]);\r\n bl.set(bt, \"en->it\", \"View\", [\"Visualizza\"]);\r\n bl.set(bt, \"en->it\", \"Close\", [\"Chiudi\"]);\r\n bl.set(bt, \"en->it\", \"Select\", [\"Seleziona\"]);\r\n bl.set(bt, \"en->it\", \"Meter Reading registered successfully\", [\"Lettura registrata correttamente\"]);\r\n bl.set(bt, \"en->it\", \"Validation errors during save operations\", [\"Errori di validazione durante il salvataggio\"]);\r\n bl.set(bt, \"en->it\", \"Can't register reading\", [\"Impossibile registrare la lettura\"]);\r\n bl.set(bt, \"en->it\", \"Electricity\", [\"Elettricita\"]);\r\n bl.set(bt, \"en->it\", \"Gas\", [\"Gas\"]);\r\n bl.set(bt, \"en->it\", \"Water\", [\"Acqua\"]);\r\n bl.set(bt, \"en->it\", \"Delete\", [\"Elimina\"]);\r\n bl.set(bt, \"en->it\", \"This operation cannot be reverted\", [\"Questa operazione non puo' essere annullata\"]);\r\n bl.set(bt, \"en->it\", \"Hide\", [\"Nascondi\"]);\r\n\r\n // Helper validazione\r\n bl.set(bt, \"en->it\", \"Required field\", [\"Campo richiesto\"]);\r\n bl.set(bt, \"en->it\", \"Wrong field format\", [\"Formato campo errato\"]);\r\n bl.set(bt, \"en->it\", \"Wrong field format or field missing\", [\"Formato campo errato o campo mancante\"]);\r\n bl.set(bt, \"en->it\", \"You don't have the required permissions to view this page. The navigation has been blocked\", [\"Non si hanno privilegi a sufficienza per accedere a questa pagina. La navigazione e' stata bloccata\"]);\r\n\r\n // Informazioni sulle date\r\n bl.setToken(bt, \"en->it\", \"getDateMonthPosition\", \"0\", [\"1\"]);\r\n bl.setToken(bt, \"en->it\", \"getDisplayDateMonthPosition\", \"1\", [\"1\"]);\r\n bl.setToken(bt, \"en->it\", \"getLocale\", \"en-US\", [\"it-IT\"]);\r\n bl.setToken(bt, \"en->it\", \"getSmallDateFormat\", \"MM/DD/YYYY\", [\"DD/MM/YYYY\"]);\r\n bl.setToken(bt, \"en->it\", \"getDefaultDateFormat\", \"MM/DD/YYYY\", [\"MM/DD/YYYY\"]);\r\n bl.setToken(bt, \"en->it\", \"getSmallDateDisplayFormat\", \"DD/MM/YYYY\", [\"DD/MM/YYYY\"]);\r\n bl.setToken(bt, \"en->it\", \"getFullDateFormat\", \"MM/DD/YYYY HH:mm:ss\", [\"DD/MM/YYYY HH:mm:ss\"]);\r\n bl.setToken(bt, \"en->it\", \"getFullDateDisplayFormat\", \"DD/MM/YYYY HH:mm:ss\", [\"DD/MM/YYYY HH:mm:ss\"]);\r\n bl.setToken(bt, \"en->it\", \"getFullDateFormatNoSeconds\", \"MM/DD/YYYY HH:mm\", [\"DD/MM/YYYY HH:mm\"]);\r\n bl.setToken(bt, \"en->it\", \"getFullDateDisplayFormatNoSeconds\", \"DD/MM/YYYY HH:mm\", [\"DD/MM/YYYY HH:mm\"]);\r\n }\r\n\r\n /**\r\n * Imposta la localizzazione di un token all'interno della cache scelta\r\n * \r\n * @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno della quale inserire l'informazione del token con le localizzazioni\r\n * @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.\r\n * Ad esempio, \"en->it\" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right** \r\n * è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio \"en->it,jp,ecc\"\r\n * @param {string} token Nome del token\r\n * @param {string} left Valore del token per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**\r\n * @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**\r\n */\r\n public static setToken(locCache: { [id: string]: ItemLocalization }, direction: string, token: string, left: string, right: string[]) {\r\n let parsingRegex = /([a-zA-Z]+)[\\s]*->[\\s]*([a-zA-Z,\\s]+)+/g;\r\n var parsingRes = parsingRegex.exec(direction);\r\n\r\n let from = parsingRes[1];\r\n let to: string[] = parsingRes[2].replace(/\\s/g, '').split(',');\r\n let localeFrom = LocaleDefinitions.getByAlias(from);\r\n BaseLocalization._set(locCache, token, localeFrom.id, left, true);\r\n\r\n to.forEach((t, index) => {\r\n let localeTo = LocaleDefinitions.getByAlias(t);\r\n BaseLocalization._set(locCache, token, localeTo.id, right[index], true);\r\n });\r\n }\r\n\r\n /**\r\n * Imposta la localizzazione di una frase all'interno della cache scelta\r\n * \r\n * @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno della quale inserire l'informazione della frase con le localizzazioni\r\n * @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.\r\n * Ad esempio, \"en->it\" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right** \r\n * è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio \"en->it,jp,ecc\"\r\n * @param {string} left Valore della frase per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**\r\n * @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**\r\n */\r\n public static set(locCache: { [id: string]: ItemLocalization }, direction: string, left: string, right: string[]) {\r\n let parsingRegex = /([a-zA-Z]+)[\\s]*->[\\s]*([a-zA-Z,\\s]+)+/g;\r\n var parsingRes = parsingRegex.exec(direction);\r\n\r\n let from = parsingRes[1];\r\n let to: string[] = parsingRes[2].replace(/\\s/g, '').split(',');\r\n let localeFrom = LocaleDefinitions.getByAlias(from);\r\n BaseLocalization._set(locCache, left, localeFrom.id, left);\r\n\r\n to.forEach((t, index) => {\r\n let localeTo = LocaleDefinitions.getByAlias(t);\r\n BaseLocalization._set(locCache, left, localeTo.id, right[index]);\r\n });\r\n }\r\n\r\n /**\r\n * Imposta all'interno della cache specificata un'unica traduzione partendo da un testo di base\r\n * \r\n * @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno della quale inserire l'informazione del testo con le localizzazioni\r\n * @param {string} text Testo da tradurre\r\n * @param {string} culture Lingua per cui inserire la traduzione\r\n * @param {string} translation Traduzione del **text** nella lingua specificata da **culture**\r\n * @param {boolean} token Indica se il **text** è un token o è una frase normale\r\n */\r\n private static _set(locCache: { [id: string]: ItemLocalization }, text: string, culture: string, translation: string, token?: boolean) {\r\n let item = BaseLocalization.findByText(locCache, text, token);\r\n if (!item) {\r\n locCache[text] = new ItemLocalization(token, text, [new SpecializedLocalization(culture, translation)]);\r\n return;\r\n }\r\n\r\n var trs = BaseLocalization.translationByCulture(item, culture);\r\n if (trs) {\r\n console.warn(\"Localization already loaded for sentence '\" + text + \"' and culture \" + culture);\r\n return;\r\n }\r\n\r\n item.translations.push(new SpecializedLocalization(culture, translation));\r\n }\r\n\r\n /**\r\n * Partendo da una cache di localizzazione, dato un testo che può essere o meno un token, cerca quell'elemento all'interno della cache\r\n * \r\n * @param {{ [id: string]: ItemLocalization }} locCache Cache all'interno del quale cercare il **text**\r\n * @param {string} text Testo da cercare nella **locCache**\r\n * @param {boolean} allowtokens Indica se l'elemento cercato può essere un token o se dev'essere per forza una frase (per evitare rari \r\n * casi di collisione in cui magari un token è uguale a una frase tradotta)\r\n * \r\n * @returns {ItemLocalization} Informazioni di localizzazione per il **text** cercato\r\n */\r\n public static findByText(locCache: { [id: string]: ItemLocalization }, text: string, allowtokens: boolean): ItemLocalization {\r\n let possibleItem: ItemLocalization = locCache[text];\r\n if (!possibleItem)\r\n return null;\r\n\r\n var item = allowtokens || !possibleItem.token ? possibleItem : null;\r\n return item;\r\n }\r\n\r\n /**\r\n * Date le informazioni di localizzazione per un testo cerca e restituisce la traduzione per una lingua specifica\r\n * \r\n * @param {ItemLocalization} Informazioni di localizzazione\r\n * @param {string} culture Lingua della traduzione richiesta\r\n * \r\n * @returns {SpecializedLocalization} Informazioni di localizzazione specifiche della lingua richiesta\r\n */\r\n public static translationByCulture(item: ItemLocalization, culture: string): SpecializedLocalization {\r\n for (let i = 0; i < item.translations.length; i++) {\r\n let trl = item.translations[i];\r\n if (trl.culture == culture)\r\n return trl;\r\n }\r\n\r\n return null;\r\n }\r\n}","import { Injectable, Inject } from '@angular/core';\nimport { LOC_LOCALE } from './tokens';\nimport { BaseLocalization } from './core/localization.base';\nimport { ItemLocalization } from './models';\n\n/**\n * Classe di localizzazione estendibile che permette di specificare le proprie localizzazioni e comunque rendere disponibili le localizzazioni globali\n */\n@Injectable()\nexport class LocalizationService {\n\n /**\n * Cache di tutte le localizzazioni disonibili all'interno di questa classe\n */\n TranslationCache: { [id: string]: ItemLocalization } = {};\n\n /**\n * Costruttore\n * \n * @param {string} baseLoc Locale da utilizzare nel momento che questo servizio richiede le traduzioni\n * @param {baseLocalization} baseLocalization Classe base di localizzazione già fornita a livello di root dalla libreria stessa. \n * È sufficiente iniettarla nell'eventuale costruttore che estende questa classe e passarla as-is\n */\n constructor(@Inject(LOC_LOCALE) private baseLoc: string, private baseLocalization?: BaseLocalization) { }\n\n /**\n * Imposta la localizzazione di un token all'interno della **TranslationCache**\n * \n * @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.\n * Ad esempio, \"en->it\" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right** \n * è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio \"en->it,jp,ecc\"\n * @param {string} token Nome del token\n * @param {string} left Valore del token per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**\n * @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**\n */\n protected setToken(direction: string, token: string, left: string, right: string[]) {\n BaseLocalization.setToken(this.TranslationCache, direction, token, left, right);\n }\n\n /**\n * Imposta la localizzazione di una frase all'interno della **TranslationCache**\n * \n * @param {string} direction Direzione della traduzione, rappresenta la lingua base in cui aspettarsi il testo e le varie lingue in cui viene tradotta.\n * Ad esempio, \"en->it\" indica che il parametro **left** è valido per le localizzazioni in inglese, mentre nell'elemento 0 del parametro **right** \n * è presente l'unica traduzione in italiano, per definire più traduzioni sul lato destro della freccia bisogna concatenarle con la virgola, ad esempio \"en->it,jp,ecc\"\n * @param {string} left Valore della frase per la lingua specificata nel lato immediatamente sinistro alla freccia del parametro **direction**\n * @param {string} right Array con i valori facenti riferimento all'N-esima lingua del lato destro del parametro **direction**\n */\n protected set(direction: string, left: string, right: string[]) {\n BaseLocalization.set(this.TranslationCache, direction, left, right);\n }\n\n /**\n * Localizza un token\n * \n * @param {string} text Il token da localizzare\n * \n * @returns {string} Token localizzato\n */\n public token(text: string): string {\n return this.loc(text, true);\n }\n\n /**\n * Localizza una frase\n * \n * @param {string} text Frase da localizzare\n * @param {boolean} allowtokens Indica se la frase **text** potrebbe essere un token o no\n * \n * @returns {string} Frase localizzata\n */\n public loc(text: string, allowtokens?: boolean): string {\n if (!text || text == \"undefined\")\n return \"\";\n\n // Questo può succedere solo se qualcuno crea questa service a manazza. In quel caso prendo la classe di default e basta\n if(this.baseLocalization == null)\n this.baseLocalization = new BaseLocalization();\n \n // Prendo la localizzazione o dalla cache attuale o dalla cache del servizio base\n var item = BaseLocalization.findByText(this.TranslationCache, text, allowtokens) || BaseLocalization.findByText(this.baseLocalization.BaseTranslations, text, allowtokens);\n if (!item) {\n console.error(\"Couldn't find localization for '\" + text + \"'\");\n return \"\";\n }\n\n var loc = BaseLocalization.translationByCulture(item, this.baseLoc);\n if (!loc) {\n console.error(\"Couldn't find localization for '\" + text + \"', culture \" + this.baseLoc);\n return \"\";\n }\n\n return loc.translation;\n }\n\n /**\n * Localizzazione per Severity classiche (E per errore, W per warning e I per info)\n * \n * @param {string} text Severity da tradurre\n * \n * @returns {string} Severity tradotta\n */\n public locSeverity(text: string): string {\n if (text == \"E\") return this.loc(\"Error\");\n if (text == \"W\") return this.loc(\"Warning\");\n if (text == \"I\") return this.loc(\"Information\");\n return \"\";\n }\n}","// Angular\r\nimport { Pipe, PipeTransform, Optional } from \"@angular/core\";\r\n\r\n// Configurazioni\r\nimport { DateService } from '@esfaenza/extensions';\r\n\r\n/**\r\n * Pipe che permette di formattare una data in base al formato specificato. Utilizza il **DateService** di **@esfaenza/extensions** per ricondurre l'input a una data valida\r\n */\r\n@Pipe({ name: \"loc_date\", pure: true })\r\nexport class LocDatePipe implements PipeTransform {\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(@Optional() private dts: DateService) { }\r\n\r\n /**\r\n * Trasformazione della data in input in base al formato richiesto\r\n * \r\n * @param {any} value Valore da ricondurre ad una data e formattare\r\n * @param {string} format Formato in output della data da visualizzare\r\n * \r\n * @returns {string} Data formattata in base al formato\r\n */\r\n transform(value: any, format: string = \"DD/MM/YYY\"): string {\r\n if (value == null || value === \"\") return null;\r\n\r\n if(!this.dts)\r\n {\r\n console.error(\"Tentativo di usare loc_date senza DateService. È possibile importare DateService installando e configurando il pacchetto @esfaenza/extensions\")\r\n return null;\r\n }\r\n var detatchedValue = JSON.parse(JSON.stringify(value));\r\n var dt = this.dts.getDateConvertion(detatchedValue);\r\n return dt.format(format);\r\n }\r\n}","// Angular\r\nimport { Pipe, PipeTransform } from \"@angular/core\";\r\nimport { LocalizationService } from '../localizations.service';\r\n\r\n/**\r\n * Pipe di localizzazione per tradurre direttamente da template\r\n */\r\n@Pipe({ name: \"localize\", pure: true })\r\nexport class LocalizePipe implements PipeTransform {\r\n\r\n /**\r\n * Costruttore\r\n * \r\n * @param {LocalizationService} translationContainer Container delle traduzioni disponibili nel contesto in cui viene usata la pipe.\r\n * \r\n * Viene iniettata dal provider dichiarato nel singolo componente che utilizza la traduzione e, se non esiste, viene iniettato dal default\r\n */\r\n constructor(private translationContainer: LocalizationService) { }\r\n\r\n /**\r\n * Trasformazione della stringa in input ad una stringa tradotta\r\n * \r\n * @param {string} value Testo da tradurre\r\n * @param {LocalizationService} locContainerOverride Override al contenitore della traduzione iniettato dal costruttore, qualora serva\r\n * \r\n * @returns {string} Frase tradotta\r\n */\r\n transform(value: string, locContainerOverride?: LocalizationService): string {\r\n if (value == null || value === \"\") return \"\";\r\n\r\n return (locContainerOverride || this.translationContainer).loc(value);\r\n }\r\n}","import { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { LOC_LOCALE } from './tokens';\r\nimport { LocalizationService } from './localizations.service';\r\nimport { LocalizationModuleConfig } from './models';\r\nimport { LocDatePipe } from './pipes/loc_date.pipe';\r\nimport { LocalizePipe } from './pipes/localize.pipe';\r\nimport { BaseLocalization } from './core/localization.base';\r\n\r\n@NgModule({\r\n declarations: [LocalizePipe, LocDatePipe],\r\n exports: [LocalizePipe, LocDatePipe]\r\n})\r\nexport class LocalizationModule {\r\n static forRoot(config?: LocalizationModuleConfig): ModuleWithProviders<LocalizationModule> {\r\n return {\r\n ngModule: LocalizationModule,\r\n providers: [\r\n LocalizationService,\r\n BaseLocalization,\r\n { provide: LOC_LOCALE, useValue: config?.locale || 'it-IT' }\r\n ]\r\n };\r\n }\r\n}","/*\r\n * Public API Surface of localizations\r\n */\r\n\r\nexport * from './lib/localizations.module';\r\nexport * from './lib/localizations.service';\r\nexport * from './lib/pipes/localize.pipe';\r\nexport * from './lib/pipes/loc_date.pipe';\r\nexport * from './lib/tokens';\r\nexport * from './lib/models/classes/LocalizationModuleConfig';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {BaseLocalization as ɵa} from './lib/core/localization.base';"],"names":["InjectionToken","Injectable","Inject","Pipe","DateService","Optional","NgModule"],"mappings":";;;;;;IAEA;;;QAGa,UAAU,GAA2B,IAAIA,mBAAc,CAAS,YAAY;;ICHzF;;;IAGA;;;;;;;;QASE,0BAAmB,KAAc,EAAS,QAAgB,EAAS,YAAuC;YAAvF,UAAK,GAAL,KAAK,CAAS;YAAS,aAAQ,GAAR,QAAQ,CAAQ;YAAS,iBAAY,GAAZ,YAAY,CAA2B;SAAI;+BAC/G;KAAA;;ICdD;;;IAGA;;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