Skip to content

yarn merge-i18n script always unquotes the "title" key #2309

@alanorth

Description

@alanorth

Describe the bug
The yarn merge-i18n script unquotes the title key, which results in an invalid json5 file (at least according to our eslint rules).

To Reproduce
Steps to reproduce the behavior:

  1. Run the yarn merge-i18n script against the default custom theme:
$ yarn merge-i18n -s src/themes/custom/assets/i18n
yarn run v1.22.19
$ ts-node --project ./tsconfig.ts-node.json scripts/merge-i18n-files.ts -s src/themes/custom/assets/i18n
Merging: /home/aorth/src/git/dspace-angular/src/assets/i18n/en.json5 with src/themes/custom/assets/i18n/en.json5
 ████████████████████████████████████████ 100% | ETA: 0s | 100/100
Done in 0.75s.
  1. Check the resulting src/assets/i18n/en.json5 and see the title key is unquoted:
diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5
index 480bf8834..7ffc7b61a 100644
--- a/src/assets/i18n/en.json5
+++ b/src/assets/i18n/en.json5
@@ -2786,7 +2786,7 @@
 
   "menu.section.browse_community_by_title": "By Title",
 
-  "menu.section.browse_global": "All of DSpace",
+  "menu.section.browse_global": "Browse DSpace",
 
   "menu.section.browse_global_by_author": "By Author",
 
@@ -3464,7 +3464,7 @@
 
   "repository.title": "DSpace Repository",
 
-  "repository.title.prefix": "DSpace Repository :: ",
+  "repository.title.prefix": "DSpace :: ",
 
   "resource-policies.add.button": "Add",
 
@@ -4696,7 +4696,7 @@
 
   "thumbnail.person.placeholder": "No Profile Picture Available",
 
-  "title": "DSpace",
+  title: "DSpace",
 
   "vocabulary-treeview.header": "Hierarchical tree view",
 

Expected behavior
According to our ESLint rules, json5 keys must be quoted, though it doesn't seem this is a requirement from the json5 spec.

This issue might be related: json5/json5#32

Metadata

Metadata

Assignees

Labels

bugi18n / l10nInternationalisation and localisation, related to message catalogslow priority

Type

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions