OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use `AR#human_attribute_name` for more elegant translations
Kabiru Mwenja51d870866bed
diff --git a/app/forms/my/look_and_feel_form.rb b/app/forms/my/look_and_feel_form.rbindex fce3c53a493..5ce73ac1b41 100644--- a/app/forms/my/look_and_feel_form.rb+++ b/app/forms/my/look_and_feel_form.rb@@ -34,8 +34,8 @@ class My::LookAndFeelForm < ApplicationFormform do |f|f.select_list(name: :theme,- label: I18n.t("activerecord.attributes.user_preference.theme"),- caption: I18n.t("activerecord.attributes.user_preference.mode_guideline"),+ label: attribute_name(:theme),+ caption: attribute_name(:mode_guideline),required: true,include_blank: false,input_width: :small,@@ -49,25 +49,25 @@ class My::LookAndFeelForm < ApplicationFormf.check_box_group(data: { my__look_and_feel_target: "autoThemeContrast" }) do |group|group.check_box name: :enable_auto_light_theme_contrast,- label: I18n.t("activerecord.attributes.user_preference.enable_auto_light_theme_contrast"),+ label: attribute_name(:enable_auto_light_theme_contrast),checked: user_preference.enable_auto_light_theme_contrast?,- caption: I18n.t("activerecord.attributes.user_preference.enable_auto_light_theme_contrast_caption")+ caption: attribute_name(:enable_auto_light_theme_contrast_caption)group.check_box name: :enable_auto_dark_theme_contrast,- label: I18n.t("activerecord.attributes.user_preference.enable_auto_dark_theme_contrast"),+ label: attribute_name(:enable_auto_dark_theme_contrast),checked: user_preference.enable_auto_dark_theme_contrast?,- caption: I18n.t("activerecord.attributes.user_preference.enable_auto_dark_theme_contrast_caption")+ caption: attribute_name(:enable_auto_dark_theme_contrast_caption)endf.check_box_group(data: { my__look_and_feel_target: "singleThemeContrast" }) do |group|group.check_box name: :increase_theme_contrast,- label: I18n.t("activerecord.attributes.user_preference.increase_contrast"),+ label: attribute_name(:increase_contrast),checked: user_preference.increase_theme_contrast?,- caption: I18n.t("activerecord.attributes.user_preference.increase_contrast_caption")+ caption: attribute_name(:increase_contrast_caption)endf.select_list(name: :comments_sorting,- label: I18n.t("activerecord.attributes.user_preference.comments_sorting"),+ label: attribute_name(:comments_sorting),required: true,include_blank: false,input_width: :small@@ -76,12 +76,11 @@ class My::LookAndFeelForm < ApplicationFormendf.check_box name: :disable_keyboard_shortcuts,- label: I18n.t("activerecord.attributes.user_preference.disable_keyboard_shortcuts"),- caption: I18n.t("activerecord.attributes.user_preference.disable_keyboard_shortcuts_caption_html",- href: OpenProject::Static::Links.url_for(:shortcuts)).html_safe+ label: attribute_name(:disable_keyboard_shortcuts),+ caption: disable_keyboard_shortcuts_captionf.submit(name: :submit,- label: I18n.t("activerecord.attributes.user_preference.button_update_look_and_feel"),+ label: attribute_name(:button_update_look_and_feel),scheme: :default)end@@ -90,4 +89,13 @@ class My::LookAndFeelForm < ApplicationFormdef user_preferenceUser.current.prefend++ def disable_keyboard_shortcuts_caption+ attribute_name(:disable_keyboard_shortcuts_caption_html,+ href: OpenProject::Static::Links.url_for(:shortcuts)).html_safe # rubocop:disable Rails/OutputSafety+ end++ def attribute_name(...)+ UserPreference.human_attribute_name(...)+ endend