Default locale to en

This commit is contained in:
Kevin Sawicki 2016-06-09 14:00:53 -07:00
parent 0ed10658a3
commit 01f96fe6af

View file

@ -19,10 +19,11 @@ 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')
let messagesPath = path.join(localesDirectory, language, 'messages.json')
if (!fs.statSyncNoException(messagesPath)) {
messagesPath = path.join(localesDirectory, default_locale, 'messages.json')
messagesPath = path.join(localesDirectory, defaultLocale, 'messages.json')
}
return messagesPath
}