Skip to content

Commit

Permalink
Plugin defaultLang defaults to en-GB
Browse files Browse the repository at this point in the history
  • Loading branch information
pitaj committed Jan 20, 2017
1 parent 7c88a55 commit df77890
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/meta/languages.js
Expand Up @@ -143,12 +143,13 @@ function getTranslationTree(callback) {
// 4. old plugin defaultLang (en_US)
async.eachLimit(plugins, 10, function (pluginData, call) {
var pluginLanguages = path.join(__dirname, '../../node_modules/', pluginData.id, pluginData.languages);
var defaultLang = pluginData.defaultLang || 'en-GB';

async.some([
lang,
lang.replace('-', '_').replace('-x-', '@'),
pluginData.defaultLang.replace('_', '-').replace('@', '-x-'),
pluginData.defaultLang.replace('-', '_').replace('-x-', '@'),
defaultLang.replace('_', '-').replace('@', '-x-'),
defaultLang.replace('-', '_').replace('-x-', '@'),
], function (language, next) {
fs.readFile(path.join(pluginLanguages, language, ns + '.json'), function (err, buffer) {
if (err) {
Expand Down

0 comments on commit df77890

Please sign in to comment.