From ec25972a5cf0e829e7c3fa60e95927e6d606b9f4 Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 6 Sep 2023 08:33:17 +0000 Subject: [PATCH] rename path as key --- bin/util/transifex.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/util/transifex.js b/bin/util/transifex.js index 7a3ac4313..9cf81b4de 100644 --- a/bin/util/transifex.js +++ b/bin/util/transifex.js @@ -72,7 +72,7 @@ const parseVars = (pluralForm) => { class PluralForms { static empty(length) { return new PluralForms(new Array(length).fill('')); } - static fromVueI18n(path, message) { + static fromVueI18n(key, message) { const forms = message.split(' | '); if (forms.length > 2) logThenThrow(message, 'a pluralized message must have exactly two forms'); @@ -83,10 +83,10 @@ class PluralForms { const badWhitespace = form.match(/^\s+|\s+$|\s\s+/); if (badWhitespace) { const badLength = badWhitespace[0].length; - console.error(`unexpected white space in translation string '${path}':`); // eslint-disable-line no-console + console.error(`unexpected white space in translation string '${key}':`); // eslint-disable-line no-console console.error(` [${message}]`); // eslint-disable-line no-console console.error(` [${''.padStart(badLength, '^').padStart(badWhitespace.index + badLength, ' ').padEnd(message.length, ' ')}]`); // eslint-disable-line no-console - throw new Error(`unexpected whitespace in message '${path}' at index ${badWhitespace.index} ("${message}")`); + throw new Error(`unexpected whitespace in message '${key}' at index ${badWhitespace.index} ("${message}")`); } } @@ -670,8 +670,8 @@ const rekeyTranslations = (source, translated, transifexPaths) => { // Returns the Vue I18n messages for the source locale after converting them to // PluralForms objects. const readSourceMessages = (localesDir, filenamesByComponent) => { - const reviver = (path, value) => - (typeof value === 'string' ? PluralForms.fromVueI18n(path, value) : value); + const reviver = (key, value) => + (typeof value === 'string' ? PluralForms.fromVueI18n(key, value) : value); // Read the root messages. const messages = parse(