cedar-embeddable-editor 1.0.14 → 1.0.16

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/README.md CHANGED
@@ -137,6 +137,7 @@ There are other optional configuration parameters available for controlling vari
137
137
  "showHeader": true,
138
138
  "showFooter": true,
139
139
 
140
+ "languageMapPathPrefix": null,
140
141
  "defaultLanguage": "en",
141
142
  "fallbackLanguage": "en",
142
143
 
@@ -244,6 +245,44 @@ nonNullRequiredFieldValueCount: int
244
245
  isValid: boolean
245
246
  ```
246
247
 
248
+ ### Language Maps / Translations
249
+
250
+ The application currently has two built-in language maps: `en` and `hu`. If you do not specify any language-related config option, the default `English` map will be used.
251
+
252
+ If you wish to change the language to another built-in one (currently the only other language is `Hungarian`), specify the config like below:
253
+
254
+ ```json
255
+ {
256
+ "defaultLanguage": "hu",
257
+ "fallbackLanguage": "en"
258
+ }
259
+ ```
260
+
261
+ You can use external language maps as well. In order to do this, specify a relative path to a folder containing the language file. The file should be named `x.json`, and should have the identical structure of the language map found in the source of the application:
262
+
263
+ https://github.com/metadatacenter/cedar-embeddable-editor/blob/main/src/assets/i18n-cee/en.json
264
+
265
+ In order to use an external language file, specify the config as follows:
266
+
267
+ ```json
268
+ {
269
+ "languageMapPathPrefix": "/assets/i18n-cee/",
270
+ "defaultLanguage": "de",
271
+ "fallbackLanguage": "en"
272
+ }
273
+ ```
274
+
275
+ In the example above we want to use a `German` language file, which is located in the specified directory. Starting the path with `/` makes the path absolute.
276
+
277
+ In our case the `/assets/i18n-cee/de.json` will be loaded if present.
278
+
279
+ If the file is missing, the `/assets/i18n-cee/en.json` will be used.
280
+
281
+ If that file is also missing, the built-in `de` map would be the next. As this does not exist at this moment, the last option, the built-in `en` map will be used.
282
+
283
+ Information about the loading process is logged onto the console with the `CEE TRACE` prefix.
284
+
285
+
247
286
 
248
287
  ## Example Applications
249
288