diff options
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 15 | ||||
-rw-r--r-- | app/helpers/stream_entries_helper.rb | 6 |
2 files changed, 13 insertions, 8 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 327901e4e..6b41fd36e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -27,11 +27,6 @@ module ApplicationHelper Setting.open_deletion end - def add_rtl_body_class(other_classes) - other_classes = "#{other_classes} rtl" if locale_direction == 'rtl' - other_classes - end - def locale_direction if [:ar, :fa, :he].include?(I18n.locale) 'rtl' @@ -77,4 +72,14 @@ module ApplicationHelper def react_component(name, props = {}) content_tag(:div, nil, data: { component: name.to_s.camelcase, props: Oj.dump(props) }) end + + def body_classes + output = (@body_classes || '').split(' ') + output << "flavour-#{current_flavour.parameterize}" + output << "skin-#{current_skin.parameterize}" + output << 'system-font' if current_account&.user&.setting_system_font_ui + output << (current_account&.user&.setting_reduce_motion ? 'reduce-motion' : 'no-reduce-motion') + output << 'rtl' if locale_direction == 'rtl' + output.reject(&:blank?).join(' ') + end end diff --git a/app/helpers/stream_entries_helper.rb b/app/helpers/stream_entries_helper.rb index 9ded69436..187bfe4a0 100644 --- a/app/helpers/stream_entries_helper.rb +++ b/app/helpers/stream_entries_helper.rb @@ -62,17 +62,17 @@ module StreamEntriesHelper prepend_str = [ [ number_to_human(account.statuses_count, strip_insignificant_zeros: true), - I18n.t('accounts.posts'), + I18n.t('accounts.posts', count: account.statuses_count), ].join(' '), [ number_to_human(account.following_count, strip_insignificant_zeros: true), - I18n.t('accounts.following'), + I18n.t('accounts.following', count: account.following_count), ].join(' '), [ number_to_human(account.followers_count, strip_insignificant_zeros: true), - I18n.t('accounts.followers'), + I18n.t('accounts.followers', count: account.followers_count), ].join(' '), ].join(', ') |