i18n: merge-strings: fix issues with only one locale

This commit is contained in:
liushuyu 2020-05-29 14:33:32 -06:00 committed by James
parent 34fd140a9e
commit c7628c1474

View file

@ -11,6 +11,10 @@ glob('src/locales/!(messages).json', {}, (e, files) => {
messages.push(locale_messages) messages.push(locale_messages)
} }
console.log('Merging messages...') console.log('Merging messages...')
messages = merge.all(messages) if (messages && messages.length > 1) {
messages = merge.all(messages)
} else {
messages = messages[0] // single locale mode
}
fs.writeFileSync('src/locales/messages.json', JSON.stringify(messages), {}) fs.writeFileSync('src/locales/messages.json', JSON.stringify(messages), {})
}) })