@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.
@@ -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-1702478232432</li>
312
+ <b>@eui/styles-base</b> : 17.0.2-snapshot-1702484869277</li>
313
313
  <li>
314
- <b>@eui/ecl</b> : 17.0.2-snapshot-1702478232432</li>
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) =&gt; {
267
+ // extract the key and value from the translation object
268
+ const key = translation[&#39;key&#39;];
269
+ const value = translation[&#39;value&#39;];
270
+ if (key &amp;&amp; value) {
271
+ result[key] = value;
272
+ }
273
+ });
274
+ return result;
275
+ }
276
+ export const appConfig: EuiAppConfig = {
277
+ ...,
278
+ customHandler: {
279
+ &#39;CompileTranslations_ID&#39;: CompileTranslations
280
+ }
281
+ };
282
+ export const GLOBAL: GlobalConfig = {
283
+ ...,
284
+ i18n: {
285
+ i18nLoader: {
286
+ i18nFolders: [&#39;i18n-eui&#39;],
287
+ i18nResources: [{
288
+ prefix: &#39;api/translations/&#39;,
289
+ compileTranslations: &#39;CompileTranslations_ID&#39;,
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>array of service urls to translation, don&#39;t add the language it will be added e.g. <a href="http://net1/trans/en">http://net1/trans/en</a>
336
+ <div class="io-description"><p>Array of service urls to translation, don&#39;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>