diff --git a/lib/renderer/extensions/i18n.js b/lib/renderer/extensions/i18n.js index 913bcb26c864..d0279601f43d 100644 --- a/lib/renderer/extensions/i18n.js +++ b/lib/renderer/extensions/i18n.js @@ -18,9 +18,9 @@ const getExtensionMetadata = (extensionId) => { } const getMessagesPath = (extensionId, language) => { - const {srcDirectory, default_locale} = getExtensionMetadata(extensionId) - const defaultLocale = default_locale != null ? default_locale : 'en' - const localesDirectory = path.join(srcDirectory, '_locales') + const metadata = getExtensionMetadata(extensionId) + const defaultLocale = metadata.default_locale || 'en' + const localesDirectory = path.join(metadata.srcDirectory, '_locales') let messagesPath = path.join(localesDirectory, language, 'messages.json') if (!fs.statSyncNoException(messagesPath)) { messagesPath = path.join(localesDirectory, defaultLocale, 'messages.json')