FIX: badges were not localizing correctly

Overrides were not working
This commit is contained in:
Sam 2016-04-08 17:52:50 +10:00
parent b0ae122fd2
commit 44bf69e3a7
2 changed files with 8 additions and 20 deletions

View file

@ -3,7 +3,7 @@
<div>
<label for="name">{{i18n 'admin.badges.name'}}</label>
{{#if readOnly}}
{{input type="text" name="name" value=buffered.displayName disabled=true}}
{{input type="text" name="name" value=buffered.name disabled=true}}
{{else}}
{{input type="text" name="name" value=buffered.name}}
{{/if}}
@ -45,7 +45,7 @@
<div>
<label for="description">{{i18n 'admin.badges.description'}}</label>
{{#if buffered.system}}
{{textarea name="description" value=buffered.displayDescription disabled=true}}
{{textarea name="description" value=buffered.description disabled=true}}
{{else}}
{{textarea name="description" value=buffered.description}}
{{/if}}

View file

@ -158,21 +158,13 @@ SQL
end
def display_name
if self.system?
key = "badges.#{i18n_name}.name"
I18n.t(key, default: self.name)
else
self.name
end
key = "badges.#{i18n_name}.name"
I18n.t(key, default: self.name)
end
def long_description
if self[:long_description].present?
self[:long_description]
else
key = "badges.#{i18n_name}.long_description"
I18n.t(key, default: '')
end
key = "badges.#{i18n_name}.long_description"
I18n.t(key, default: self[:long_description] || '')
end
def long_description=(val)
@ -184,12 +176,8 @@ SQL
end
def description
if self[:description].present?
self[:description]
else
key = "badges.#{i18n_name}.description"
I18n.t(key, default: '')
end
key = "badges.#{i18n_name}.description"
I18n.t(key, default: self[:description] || '')
end
def description=(val)