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:
Jonne Haß 2014-02-09 13:01:00 +01:00
parent a132b6c1b5
commit e402a4093d
2 changed files with 11 additions and 1 deletions

View file

@ -11,7 +11,7 @@ module LanguageHelper
defaults = I18n.t(section, :locale => DEFAULT_LANGUAGE)
if language != DEFAULT_LANGUAGE
translations = I18n.t('javascripts', :locale => language)
translations = I18n.t(section, :locale => language)
defaults.deep_merge!(translations)
end

View file

@ -28,6 +28,16 @@ describe("Diaspora", function() {
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() {