From 0a80e31f6f029b68f0e6c61351f7a45f6da7dd64 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Fri, 28 Oct 2022 21:16:05 +0200 Subject: [PATCH] Sort the keys in order to be more predictable (#164920) sort the keys in order to be more predictable --- build/lib/i18n.js | 2 +- build/lib/i18n.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 24e622bc7a8..95338e5befe 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -684,7 +684,7 @@ function createI18nFile(name, messages) { const i18nPackVersion = '1.0.0'; function getRecordFromL10nJsonFormat(l10nJsonFormat) { const record = {}; - for (const key of Object.keys(l10nJsonFormat)) { + for (const key of Object.keys(l10nJsonFormat).sort()) { const value = l10nJsonFormat[key]; record[key] = typeof value === 'string' ? value : value.message; } diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 1962ba98926..8f1eaf9fe0e 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -787,7 +787,7 @@ export interface TranslationPath { function getRecordFromL10nJsonFormat(l10nJsonFormat: l10nJsonFormat): Record { const record: Record = {}; - for (const key of Object.keys(l10nJsonFormat)) { + for (const key of Object.keys(l10nJsonFormat).sort()) { const value = l10nJsonFormat[key]; record[key] = typeof value === 'string' ? value : value.message; }