mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
fix i18n handling for ja-JP locale on Safari/MacOS
This commit is contained in:
@@ -91,6 +91,30 @@ describe("api/editor/locales", function() {
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('returns for locale defined only with primary tag ', function(done) {
|
||||
var orig = i18n.i.getResourceBundle;
|
||||
i18n.i.getResourceBundle = function (lang, ns) {
|
||||
if (lang === "ja-JP") {
|
||||
return undefined;
|
||||
}
|
||||
return orig(lang, ns);
|
||||
};
|
||||
request(app)
|
||||
// returns `ja` instead of `ja-JP`
|
||||
.get("/locales/message-catalog?lng=ja-JP")
|
||||
.expect(200)
|
||||
.end(function(err,res) {
|
||||
i18n.i.getResourceBundle = orig;
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
res.body.should.have.property('namespace','message-catalog');
|
||||
res.body.should.have.property('lang','ja');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// describe('get all node resource catalogs',function() {
|
||||
|
Reference in New Issue
Block a user