mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: badges were not localizing correctly
Overrides were not working
This commit is contained in:
parent
b0ae122fd2
commit
44bf69e3a7
2 changed files with 8 additions and 20 deletions
|
@ -3,7 +3,7 @@
|
||||||
<div>
|
<div>
|
||||||
<label for="name">{{i18n 'admin.badges.name'}}</label>
|
<label for="name">{{i18n 'admin.badges.name'}}</label>
|
||||||
{{#if readOnly}}
|
{{#if readOnly}}
|
||||||
{{input type="text" name="name" value=buffered.displayName disabled=true}}
|
{{input type="text" name="name" value=buffered.name disabled=true}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{input type="text" name="name" value=buffered.name}}
|
{{input type="text" name="name" value=buffered.name}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -45,7 +45,7 @@
|
||||||
<div>
|
<div>
|
||||||
<label for="description">{{i18n 'admin.badges.description'}}</label>
|
<label for="description">{{i18n 'admin.badges.description'}}</label>
|
||||||
{{#if buffered.system}}
|
{{#if buffered.system}}
|
||||||
{{textarea name="description" value=buffered.displayDescription disabled=true}}
|
{{textarea name="description" value=buffered.description disabled=true}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{textarea name="description" value=buffered.description}}
|
{{textarea name="description" value=buffered.description}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -158,21 +158,13 @@ SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
def display_name
|
def display_name
|
||||||
if self.system?
|
key = "badges.#{i18n_name}.name"
|
||||||
key = "badges.#{i18n_name}.name"
|
I18n.t(key, default: self.name)
|
||||||
I18n.t(key, default: self.name)
|
|
||||||
else
|
|
||||||
self.name
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def long_description
|
def long_description
|
||||||
if self[:long_description].present?
|
key = "badges.#{i18n_name}.long_description"
|
||||||
self[:long_description]
|
I18n.t(key, default: self[:long_description] || '')
|
||||||
else
|
|
||||||
key = "badges.#{i18n_name}.long_description"
|
|
||||||
I18n.t(key, default: '')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def long_description=(val)
|
def long_description=(val)
|
||||||
|
@ -184,12 +176,8 @@ SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
if self[:description].present?
|
key = "badges.#{i18n_name}.description"
|
||||||
self[:description]
|
I18n.t(key, default: self[:description] || '')
|
||||||
else
|
|
||||||
key = "badges.#{i18n_name}.description"
|
|
||||||
I18n.t(key, default: '')
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def description=(val)
|
def description=(val)
|
||||||
|
|
Loading…
Reference in a new issue