Extract frontend_translations
helper to support module (#34400)
This commit is contained in:
parent
4c2f64907b
commit
de19af3650
5 changed files with 19 additions and 32 deletions
|
@ -1,6 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SystemHelpers
|
||||
FRONTEND_TRANSLATIONS = JSON.parse Rails.root.join('app', 'javascript', 'mastodon', 'locales', 'en.json').read
|
||||
|
||||
def submit_button
|
||||
I18n.t('generic.save_changes')
|
||||
end
|
||||
|
@ -16,4 +18,8 @@ module SystemHelpers
|
|||
def css_id(record)
|
||||
"##{dom_id(record)}"
|
||||
end
|
||||
|
||||
def frontend_translations(key)
|
||||
FRONTEND_TRANSLATIONS[key]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue