Actually load a different section when requested in get_javascript_strings_for, add spec for changes in JS i18n helper
This commit is contained in:
parent
a132b6c1b5
commit
e402a4093d
2 changed files with 11 additions and 1 deletions
|
|
@ -11,7 +11,7 @@ module LanguageHelper
|
||||||
defaults = I18n.t(section, :locale => DEFAULT_LANGUAGE)
|
defaults = I18n.t(section, :locale => DEFAULT_LANGUAGE)
|
||||||
|
|
||||||
if language != DEFAULT_LANGUAGE
|
if language != DEFAULT_LANGUAGE
|
||||||
translations = I18n.t('javascripts', :locale => language)
|
translations = I18n.t(section, :locale => language)
|
||||||
defaults.deep_merge!(translations)
|
defaults.deep_merge!(translations)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,16 @@ describe("Diaspora", function() {
|
||||||
|
|
||||||
expect(Diaspora.I18n.locale).toEqual(locale);
|
expect(Diaspora.I18n.locale).toEqual(locale);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("extends the class's locale variable on multiple calls", function() {
|
||||||
|
var data = {another: 'section'},
|
||||||
|
extended = $.extend(locale, data);
|
||||||
|
|
||||||
|
Diaspora.I18n.loadLocale(locale);
|
||||||
|
Diaspora.I18n.loadLocale(data;
|
||||||
|
|
||||||
|
expect(Diaspora.I18n.locale).toEqual(extended);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("t", function() {
|
describe("t", function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue