mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: I18n Fallbacks were not applying correctly
This commit is contained in:
parent
47410f1b99
commit
d1ebb9d0b5
5 changed files with 42 additions and 28 deletions
|
@ -118,18 +118,18 @@ describe I18n::Backend::DiscourseI18n do
|
|||
|
||||
describe "client json" do
|
||||
it "is empty by default" do
|
||||
expect(I18n.client_overrides_json).to eq("{}")
|
||||
expect(I18n.client_overrides_json('en')).to eq("{}")
|
||||
end
|
||||
|
||||
it "doesn't return server overrides" do
|
||||
TranslationOverride.upsert!('en', 'foo', 'bar')
|
||||
expect(I18n.client_overrides_json).to eq("{}")
|
||||
expect(I18n.client_overrides_json('en')).to eq("{}")
|
||||
end
|
||||
|
||||
it "returns client overrides" do
|
||||
TranslationOverride.upsert!('en', 'js.foo', 'bar')
|
||||
TranslationOverride.upsert!('en', 'admin_js.beep', 'boop')
|
||||
json = ::JSON.parse(I18n.client_overrides_json)
|
||||
json = ::JSON.parse(I18n.client_overrides_json('en'))
|
||||
|
||||
expect(json).to be_present
|
||||
expect(json['js.foo']).to eq('bar')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue