Extract frontend_translations helper to support module (#34400)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user