@eui/tools 6.16.30 → 6.16.31

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.
@@ -1 +1 @@
1
- 6.16.30
1
+ 6.16.31
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 6.16.31 (2024-07-02)
2
+
3
+ ##### Chores
4
+
5
+ * **other:**
6
+ * added extraLocales option for remote v17 - EUI-7121 [EUI-7121](https://webgate.ec.europa.eu/CITnet/jira/browse/EUI-7121) ([f4c2539f](https://webgate.ec.europa.eu/CITnet/stash/scm/csdr/eui-tools.git/commits/f4c2539f111e3ee8b13a46525b54e1e44102e2a8))
7
+
8
+ * * *
9
+ * * *
1
10
  ## 6.16.30 (2024-06-20)
2
11
 
3
12
  ##### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/tools",
3
- "version": "6.16.30",
3
+ "version": "6.16.31",
4
4
  "tag": "latest",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI common tools and scripts",
@@ -0,0 +1,151 @@
1
+ import { registerLocaleData } from '@angular/common';
2
+
3
+ // import and register locale manually
4
+ import localeEn from '@angular/common/locales/en';
5
+ import localeEN_150 from '@angular/common/locales/en-150';
6
+ import localeEN_AT from '@angular/common/locales/en-AT';
7
+ import localeEN_BE from '@angular/common/locales/en-BE';
8
+ import localeEN_CH from '@angular/common/locales/en-CH';
9
+ import localeEN_CY from '@angular/common/locales/en-CY';
10
+ import localeEN_DE from '@angular/common/locales/en-DE';
11
+ import localeEN_DK from '@angular/common/locales/en-DK';
12
+ import localeEN_FI from '@angular/common/locales/en-FI';
13
+ import localeEN_GG from '@angular/common/locales/en-GG';
14
+ import localeEN_GI from '@angular/common/locales/en-GI';
15
+ import localeEN_IE from '@angular/common/locales/en-IE';
16
+ import localeEN_IM from '@angular/common/locales/en-IM';
17
+ import localeEN_JE from '@angular/common/locales/en-JE';
18
+ import localeEN_MT from '@angular/common/locales/en-MT';
19
+ import localeEN_NL from '@angular/common/locales/en-NL';
20
+ import localeEN_SE from '@angular/common/locales/en-SE';
21
+ import localeEN_SI from '@angular/common/locales/en-SI';
22
+ import localeEnExtra from '@angular/common/locales/extra/en';
23
+ import localeEnExtra_150 from '@angular/common/locales/extra/en-150';
24
+ import localeEnExtra_AT from '@angular/common/locales/extra/en-AT';
25
+ import localeEnExtra_BE from '@angular/common/locales/extra/en-BE';
26
+ import localeEnExtra_CH from '@angular/common/locales/extra/en-CH';
27
+ import localeEnExtra_CY from '@angular/common/locales/extra/en-CY';
28
+ import localeEnExtra_DE from '@angular/common/locales/extra/en-DE';
29
+ import localeEnExtra_DK from '@angular/common/locales/extra/en-DK';
30
+ import localeEnExtra_FI from '@angular/common/locales/extra/en-FI';
31
+ import localeEnExtra_GG from '@angular/common/locales/extra/en-GG';
32
+ import localeEnExtra_GI from '@angular/common/locales/extra/en-GI';
33
+ import localeEnExtra_IE from '@angular/common/locales/extra/en-IE';
34
+ import localeEnExtra_IM from '@angular/common/locales/extra/en-IM';
35
+ import localeEnExtra_JE from '@angular/common/locales/extra/en-JE';
36
+ import localeEnExtra_MT from '@angular/common/locales/extra/en-MT';
37
+ import localeEnExtra_NL from '@angular/common/locales/extra/en-NL';
38
+ import localeEnExtra_SE from '@angular/common/locales/extra/en-SE';
39
+ import localeEnExtra_SI from '@angular/common/locales/extra/en-SI';
40
+ import localeFr from '@angular/common/locales/fr';
41
+ import localeFR_MC from '@angular/common/locales/fr-MC';
42
+ import localeFR_LU from '@angular/common/locales/fr-LU';
43
+ import localeFR_CH from '@angular/common/locales/fr-CH';
44
+ import localeFR_BE from '@angular/common/locales/fr-BE';
45
+ import localeFRExtra_BE from '@angular/common/locales/extra/fr-BE';
46
+ import localeFRExtra_CH from '@angular/common/locales/extra/fr-CH';
47
+ import localeFRExtra_LU from '@angular/common/locales/extra/fr-LU';
48
+ import localeFRExtra_MC from '@angular/common/locales/extra/fr-MC';
49
+ import localeFrExtra from '@angular/common/locales/extra/fr';
50
+
51
+ import { GlobalConfig, I18nConfig, LocaleServiceConfig } from '@eui/core';
52
+
53
+ import * as moment from 'moment';
54
+
55
+ /**
56
+ * import and register locales (currently MWP uses only French and English)
57
+ */
58
+ registerLocaleData(localeEn, 'en', localeEnExtra);
59
+ registerLocaleData(localeFr, 'fr', localeFrExtra);
60
+ registerLocaleData(localeEN_150, localeEnExtra_150);
61
+ registerLocaleData(localeEN_AT, localeEnExtra_AT);
62
+ registerLocaleData(localeEN_BE, localeEnExtra_BE);
63
+ registerLocaleData(localeEN_CH, localeEnExtra_CH);
64
+ registerLocaleData(localeEN_CY, localeEnExtra_CY);
65
+ registerLocaleData(localeEN_DE, localeEnExtra_DE);
66
+ registerLocaleData(localeEN_DK, localeEnExtra_DK);
67
+ registerLocaleData(localeEN_FI, localeEnExtra_FI);
68
+ registerLocaleData(localeEN_GG, localeEnExtra_GG);
69
+ registerLocaleData(localeEN_GI, localeEnExtra_GI);
70
+ registerLocaleData(localeEN_IE, localeEnExtra_IE);
71
+ registerLocaleData(localeEN_IM, localeEnExtra_IM);
72
+ registerLocaleData(localeEN_JE, localeEnExtra_JE);
73
+ registerLocaleData(localeEN_MT, localeEnExtra_MT);
74
+ registerLocaleData(localeEN_NL, localeEnExtra_NL);
75
+ registerLocaleData(localeEN_SE, localeEnExtra_SE);
76
+ registerLocaleData(localeEN_SI, localeEnExtra_SI);
77
+ registerLocaleData(localeFR_MC, localeFRExtra_MC);
78
+ registerLocaleData(localeFR_LU, localeFRExtra_LU);
79
+ registerLocaleData(localeFR_CH, localeFRExtra_CH);
80
+ registerLocaleData(localeFR_BE, localeFRExtra_BE);
81
+
82
+
83
+ moment.defineLocale('en-be', {
84
+ parentLocale: 'en',
85
+ longDateFormat: {
86
+ /** LTS: Specifies the format for displaying time with seconds. */
87
+ LT: 'HH:mm',
88
+ /** LT: Specifies the format for displaying time without seconds. */
89
+ LTS: 'HH:mm:ss',
90
+ /** L: Specifies the format for displaying the date in short format. */
91
+ L: 'DD/MM/YYYY',
92
+ /** LL: Specifies the format for displaying the date in long format. */
93
+ LL: 'D MMMM YYYY',
94
+ /** LLL: Specifies the format for displaying the date and time. */
95
+ LLL: 'D MMMM YYYY HH:mm',
96
+ /** LLLL: Specifies the format for displaying the full date and time with the day of the week. */
97
+ LLLL: 'dddd, D MMMM YYYY HH:mm',
98
+ }
99
+ });
100
+
101
+ moment.defineLocale('en-fr', {
102
+ parentLocale: 'en',
103
+ longDateFormat: {
104
+ LT: 'HH:mm',
105
+ LTS: 'HH:mm:ss',
106
+ L: 'DD/MM/YYYY',
107
+ LL: 'D MMMM YYYY',
108
+ LLL: 'D MMMM YYYY HH:mm',
109
+ LLLL: 'dddd, D MMMM YYYY HH:mm'
110
+ }
111
+ });
112
+
113
+ /**
114
+ * Internationalization Configuration
115
+ */
116
+ const i18nConfig: I18nConfig = {
117
+ i18nLoader: {
118
+ i18nFolders: ['elements/@remote.name@/bundles/assets/i18n-compiled'],
119
+ },
120
+ i18nService: {
121
+ languages: ['en', 'fr'],
122
+ defaultLanguage: 'en',
123
+ },
124
+ };
125
+
126
+ /**
127
+ * Locale Configuration
128
+ */
129
+ const localeConfig: LocaleServiceConfig = {
130
+ id: 'en',
131
+ available: ['en', 'fr'],
132
+ bindWithTranslate: true,
133
+ affectGlobalLocale: true,
134
+ };
135
+
136
+ /**
137
+ * Global Configuration
138
+ */
139
+ export const GLOBAL: GlobalConfig = {
140
+ /* URL that needs to be used in the appRouting of the MWP */
141
+ baseUrl: '@base.url@',
142
+ /* Element tag name that needs to be unique - make sure it doesn't collide with any other MWP element */
143
+ elementName: '@element.name@',
144
+ /* in case you are using NgRx give it a unique name (mostly for debugging) */
145
+ storeName: '@store.name@',
146
+ i18n: i18nConfig,
147
+ locale: localeConfig,
148
+ eui: {
149
+ assetsBaseUrl: 'assets/elements/@remote.name@/bundles/assets',
150
+ },
151
+ };
@@ -169,6 +169,7 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
169
169
 
170
170
  const optionUserReducersPath = path.join(fullOptionsPath, 'user-reducers');
171
171
  const optionAllLocalesPath = path.join(fullOptionsPath, 'all-locales');
172
+ const optionExtraLocalesPath = path.join(fullOptionsPath, 'extra-locales');
172
173
  const optionParticipantPath = path.join(fullOptionsPath, 'participant');
173
174
  const optionAgGridPath = path.join(fullOptionsPath, 'ag-grid');
174
175
  const optionUserReducersDef = tools.getJsonFileContent(path.join(fullOptionsPath, 'definitions', 'user-reducers.json'));
@@ -261,6 +262,11 @@ module.exports.generateVirtualRemote = (remoteName, cloneRemote = true) => {
261
262
  tools.copy(optionAllLocalesPath, remoteSrcPath);
262
263
  }
263
264
 
265
+ // extra-locales specific sources
266
+ if (remote.skeletonConfig.options.extraLocales) {
267
+ tools.copy(optionExtraLocalesPath, remoteSrcPath);
268
+ }
269
+
264
270
  // zipkin
265
271
  if (remote.skeletonConfig.options.zipkin) {
266
272
  pushContent(optionZipkinDef);