@eui/base 17.0.2-snapshot-1702481826405 → 17.0.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/docs/dependencies.html +2 -2
- package/docs/interfaces/I18nLoaderConfig.html +46 -1
- package/docs/js/search/search_index.js +2 -2
- package/esm2022/lib/eui-models/eui-config/i18n.config.mjs +1 -1
- package/fesm2022/eui-base.mjs.map +1 -1
- package/lib/eui-models/eui-config/i18n.config.d.ts +47 -4
- package/lib/eui-models/eui-config/i18n.config.d.ts.map +1 -1
- package/package.json +2 -2
package/docs/dependencies.html
CHANGED
|
@@ -309,9 +309,9 @@
|
|
|
309
309
|
<li>
|
|
310
310
|
<b>@stackblitz/sdk</b> : 1.9.0</li>
|
|
311
311
|
<li>
|
|
312
|
-
<b>@eui/styles-base</b> : 17.0.2-snapshot-
|
|
312
|
+
<b>@eui/styles-base</b> : 17.0.2-snapshot-1702484869277</li>
|
|
313
313
|
<li>
|
|
314
|
-
<b>@eui/ecl</b> : 17.0.2-snapshot-
|
|
314
|
+
<b>@eui/ecl</b> : 17.0.2-snapshot-1702484869277</li>
|
|
315
315
|
<li>
|
|
316
316
|
<b>@eui/tools</b> : ^6.0.0</li>
|
|
317
317
|
</ul>
|
|
@@ -210,6 +210,14 @@
|
|
|
210
210
|
|
|
211
211
|
|
|
212
212
|
|
|
213
|
+
<tr>
|
|
214
|
+
<td class="col-md-4">
|
|
215
|
+
<div class="io-description"><p>Those folders will be used to load the translations files from <a href="https://angular.io/guide/workspace-config#extra-build-and-test-options">assets</a>.
|
|
216
|
+
e.g [<code>${environment.apiBaseUrl}translations/</code>, <code>${environment.apiBaseUrl}translations?lang=</code>]
|
|
217
|
+
Important! the language code will be added automatically to the end of the url except if the url ends with a slash.</p>
|
|
218
|
+
</div>
|
|
219
|
+
</td>
|
|
220
|
+
</tr>
|
|
213
221
|
</tbody>
|
|
214
222
|
</table>
|
|
215
223
|
<table class="table table-sm table-bordered">
|
|
@@ -248,6 +256,43 @@
|
|
|
248
256
|
|
|
249
257
|
|
|
250
258
|
|
|
259
|
+
<tr>
|
|
260
|
+
<td class="col-md-4">
|
|
261
|
+
<div class="io-description"><p>It is a set of more customized resources to be loaded. You can provide a function to compile the translations or simply
|
|
262
|
+
provide the prefix and suffix of the resource, or both.</p>
|
|
263
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-html">```typescript
|
|
264
|
+
export function CompileTranslations(translations: any): any {
|
|
265
|
+
const result = {};
|
|
266
|
+
translations.forEach((translation: any) => {
|
|
267
|
+
// extract the key and value from the translation object
|
|
268
|
+
const key = translation['key'];
|
|
269
|
+
const value = translation['value'];
|
|
270
|
+
if (key && value) {
|
|
271
|
+
result[key] = value;
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
export const appConfig: EuiAppConfig = {
|
|
277
|
+
...,
|
|
278
|
+
customHandler: {
|
|
279
|
+
'CompileTranslations_ID': CompileTranslations
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
export const GLOBAL: GlobalConfig = {
|
|
283
|
+
...,
|
|
284
|
+
i18n: {
|
|
285
|
+
i18nLoader: {
|
|
286
|
+
i18nFolders: ['i18n-eui'],
|
|
287
|
+
i18nResources: [{
|
|
288
|
+
prefix: 'api/translations/',
|
|
289
|
+
compileTranslations: 'CompileTranslations_ID',
|
|
290
|
+
}]
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};</code></pre></div></div>
|
|
294
|
+
</td>
|
|
295
|
+
</tr>
|
|
251
296
|
</tbody>
|
|
252
297
|
</table>
|
|
253
298
|
<table class="table table-sm table-bordered">
|
|
@@ -288,7 +333,7 @@
|
|
|
288
333
|
|
|
289
334
|
<tr>
|
|
290
335
|
<td class="col-md-4">
|
|
291
|
-
<div class="io-description"><p>
|
|
336
|
+
<div class="io-description"><p>Array of service urls to translation, don't add the language it will be added e.g. <a href="http://net1/trans/en">http://net1/trans/en</a>
|
|
292
337
|
Keep in mind that the url should be the prefix and not contain any suffix.</p>
|
|
293
338
|
</div>
|
|
294
339
|
</td>
|