🌐(app-desk) order translations asc

When we pull the translations from crowdin we
get lot of git diff noise with the json file.
We order the keys in the json file to make the
diffs more readable.
This commit is contained in:
Anthony LC
2024-03-20 12:44:02 +01:00
committed by Anthony LC
parent e4a6b33366
commit f21966cca9
2 changed files with 54 additions and 56 deletions

View File

@@ -35,9 +35,12 @@ fs.readdirSync(folderPath).map((language) => {
// Transform the json file to the format expected by i18next
const jsonKeyMessage = {};
Object.keys(json).forEach((key) => {
jsonKeyMessage[key] = json[key].message;
});
Object.keys(json)
.sort()
.forEach((key) => {
jsonKeyMessage[key] = json[key].message;
});
jsonI18n[language] = {
translation: jsonKeyMessage,
};