mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 15:17:53 -05:00
Apply english strings as default translations
This fixes #1303 by ensuring that, if a language does not have a string, the default will be applied.
This commit is contained in:
parent
d33cd6cf4b
commit
3a27b1d2e2
1 changed files with 5 additions and 3 deletions
|
@ -32,12 +32,13 @@
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
*/
|
*/
|
||||||
var fs = require('fs');
|
|
||||||
var path = require('path');
|
|
||||||
var merge = require('lodash.merge');
|
|
||||||
var async = require('async');
|
var async = require('async');
|
||||||
|
var fs = require('fs');
|
||||||
var languages = require('../languages.json');
|
var languages = require('../languages.json');
|
||||||
var localizedUrls = require('./lib/localized-urls');
|
var localizedUrls = require('./lib/localized-urls');
|
||||||
|
var merge = require('lodash.merge');
|
||||||
|
var defaults = require('lodash.defaults');
|
||||||
|
var path = require('path');
|
||||||
var routes = require('../src/routes.json');
|
var routes = require('../src/routes.json');
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
@ -215,6 +216,7 @@ async.forEachLimit(views, 5, function (view, cb) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
viewLocales[isoCode] = merge({}, generalLocales[isoCode], JSON.parse(data));
|
viewLocales[isoCode] = merge({}, generalLocales[isoCode], JSON.parse(data));
|
||||||
|
defaults(viewLocales[isoCode], viewLocales['en']);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return cb(e);
|
return cb(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue