Extract frontend_translations helper to support module (#34400)

This commit is contained in:
Matt Jankowski 2025-04-10 09:51:17 -04:00 committed by GitHub
parent 4c2f64907b
commit de19af3650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 32 deletions

View file

@ -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