From f7155becd058d3fde45d2ab548313e1a1f7575f9 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 19 Oct 2022 19:53:47 +0200 Subject: [PATCH 1/3] Fix config/locales-glitch not overriding translation strings (#1871) --- config/initializers/locale.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index fed182a71..b5664b0b0 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -1,7 +1,9 @@ # frozen_string_literal: true -I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s] -I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names', '*.{rb,yml}').to_s] -I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s] -I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s] -I18n.load_path += Dir[Rails.root.join('config', 'locales-glitch', '*.{rb,yml}').to_s] +Rails.application.configure do + I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s] + I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names', '*.{rb,yml}').to_s] + I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s] + I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s] + I18n.load_path += Dir[Rails.root.join('config', 'locales-glitch', '*.{rb,yml}').to_s] +end From 1e772c984b4681f6c036209b45dfa94b38b6ce83 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 19 Oct 2022 22:08:10 +0200 Subject: [PATCH 2/3] Actually fix config/locales-glitch not overriding translation strings (#1872) --- config/initializers/locale.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index b5664b0b0..4bcb1854c 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true Rails.application.configure do - I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s] - I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names', '*.{rb,yml}').to_s] - I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s] - I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s] - I18n.load_path += Dir[Rails.root.join('config', 'locales-glitch', '*.{rb,yml}').to_s] + config.i18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s] + config.i18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names', '*.{rb,yml}').to_s] + config.i18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s] + config.i18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s] + config.i18n.load_path += Dir[Rails.root.join('config', 'locales-glitch', '*.{rb,yml}').to_s] end From b3030187a41b242697d640f14fb1f589201c55e0 Mon Sep 17 00:00:00 2001 From: prplecake Date: Fri, 21 Oct 2022 05:01:37 -0500 Subject: [PATCH 3/3] Use DEFAULT_FIELDS_SIZE/MAX_PROFILE_FIELDS value in settings form hint (#1870) Use `Account::DEFAULT_FIELDS_SIZE` in the hint, which would fallback to 4 if the environment variable isn't set. --- app/views/settings/profiles/show.html.haml | 2 +- config/locales-glitch/simple_form.en.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/settings/profiles/show.html.haml b/app/views/settings/profiles/show.html.haml index b84d06c27..39a508218 100644 --- a/app/views/settings/profiles/show.html.haml +++ b/app/views/settings/profiles/show.html.haml @@ -41,7 +41,7 @@ .fields-row__column.fields-group.fields-row__column-6 .input.with_block_label %label= t('simple_form.labels.defaults.fields') - %span.hint= t('simple_form.hints.defaults.fields') + %span.hint= t('simple_form.hints.defaults.fields', count: Account::DEFAULT_FIELDS_SIZE) = f.simple_fields_for :fields do |fields_f| .row diff --git a/config/locales-glitch/simple_form.en.yml b/config/locales-glitch/simple_form.en.yml index c9ef40996..fd1c64bbb 100644 --- a/config/locales-glitch/simple_form.en.yml +++ b/config/locales-glitch/simple_form.en.yml @@ -3,6 +3,7 @@ en: simple_form: hints: defaults: + fields: You can have up to %{count} items displayed as a table on your profile setting_default_content_type_html: When writing toots, assume they are written in raw HTML, unless specified otherwise setting_default_content_type_markdown: When writing toots, assume they are using Markdown for rich text formatting, unless specified otherwise setting_default_content_type_plain: When writing toots, assume they are plain text with no special formatting, unless specified otherwise (default Mastodon behavior)