forked from External/greenlight
send translated strings to javascript
This commit is contained in:
@ -1,2 +1,17 @@
|
||||
module ApplicationHelper
|
||||
def client_translations
|
||||
locale = I18n.locale
|
||||
if locale.length < 4
|
||||
fallback_locale = I18n.fallbacks[locale].second
|
||||
end
|
||||
|
||||
if fallback_locale
|
||||
I18n.locale = fallback_locale
|
||||
translations = I18n.t('.')
|
||||
I18n.locale = locale
|
||||
else
|
||||
translations = I18n.t('.')
|
||||
end
|
||||
translations[:client]
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user