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
[#65403] Rename Settings to Language and Region
Alexander Brandon Coles3757b2288083
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rbindex f1cef66d096..69b881e023f 100644--- a/app/controllers/my_controller.rb+++ b/app/controllers/my_controller.rb@@ -43,7 +43,7 @@ class MyController < ApplicationControllerno_authorization_required! :account,:update_account,- :settings,+ :locale,:interface,:update_settings,:password,@@ -52,7 +52,7 @@ class MyController < ApplicationController:remindersmenu_item :account, only: [:account]- menu_item :settings, only: [:settings]+ menu_item :locale, only: [:locale]menu_item :interface, only: [:interface]menu_item :password, only: [:password]menu_item :notifications, only: [:notifications]@@ -64,7 +64,7 @@ class MyController < ApplicationControllerwrite_settingsend- def settings; end+ def locale; enddef update_settingswrite_settingsdiff --git a/app/views/my/settings.html.erb b/app/views/my/locale.html.erbsimilarity index 90%rename from app/views/my/settings.html.erbrename to app/views/my/locale.html.erbindex 1788638d178..5e3b1a58790 100644--- a/app/views/my/settings.html.erb+++ b/app/views/my/locale.html.erb@@ -27,14 +27,14 @@ See COPYRIGHT and LICENSE files for more details.++#%>-<% html_title(t(:label_my_account), t(:label_setting_plural)) %>+<% html_title(t(:label_my_account), t(:label_locale)) %><%=render(Primer::OpenProject::PageHeader.new) do |header|- header.with_title { t(:label_setting_plural) }+ header.with_title { t(:label_locale) }header.with_breadcrumbs([{ href: my_account_path, text: t(:label_my_account) },- t(:label_setting_plural)]+ t(:label_locale)])end%>diff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex 678fc709324..22126ab20e2 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -229,10 +229,10 @@ Redmine::MenuManager.map :my_menu do |menu|{ controller: "/my", action: "account" },caption: :label_profile,icon: "person-fill"- menu.push :settings,- { controller: "/my", action: "settings" },- caption: :label_setting_plural,- icon: "gear"+ menu.push :locale,+ { controller: "/my", action: "locale" },+ caption: :label_locale,+ icon: "globe"menu.push :interface,{ controller: "/my", action: "interface" },caption: :label_interface,diff --git a/config/locales/en.yml b/config/locales/en.ymlindex ac15005985b..60706b75443 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -3079,6 +3079,7 @@ en:label_journal_diff: "Description Comparison"label_language: "Language"label_languages: "Languages"+ label_locale: "Language and Region"label_jump_to_a_project: "Jump to a project..."label_keyword_plural: "Keywords"label_language_based: "Based on user's language"diff --git a/config/routes.rb b/config/routes.rbindex 4338d070c9a..65db9f6ca83 100644--- a/config/routes.rb+++ b/config/routes.rb@@ -905,7 +905,7 @@ Rails.application.routes.draw dopost "/my/change_password", action: "change_password"get "/my/account", action: "account"- get "/my/settings", action: "settings"+ get "/my/locale", action: "locale"get "/my/interface", action: "interface"get "/my/notifications", action: "notifications"get "/my/reminders", action: "reminders"diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rbindex dc44342dd65..53b55153d01 100644--- a/modules/meeting/app/controllers/meetings_controller.rb+++ b/modules/meeting/app/controllers/meetings_controller.rb@@ -106,7 +106,7 @@ class MeetingsController < ApplicationControllertext = I18n.t(:notice_successful_create)unless User.current.pref.time_zone?link = I18n.t(:notice_timezone_missing, zone: formatted_time_zone_offset)- text += " #{view_context.link_to(link, { controller: '/my', action: :settings, anchor: 'pref_time_zone' },+ text += " #{view_context.link_to(link, { controller: '/my', action: :locale, anchor: 'pref_time_zone' },class: 'link_to_profile')}"endflash[:notice] = text.html_safe # rubocop:disable Rails/OutputSafetydiff --git a/spec/components/my/locale_component_spec.rb b/spec/components/my/locale_component_spec.rbindex 18804755444..1be4380c853 100644--- a/spec/components/my/locale_component_spec.rb+++ b/spec/components/my/locale_component_spec.rb@@ -41,7 +41,7 @@ RSpec.describe My::LocaleComponent, type: :component dosubject(:rendered_component) dowith_controller_class(MyController) do- with_request_url("/my/settings") do+ with_request_url("/my/locale") dorender_component(user)endenddiff --git a/spec/controllers/my_controller_spec.rb b/spec/controllers/my_controller_spec.rbindex 838bb54382b..c3c63df2d93 100644--- a/spec/controllers/my_controller_spec.rb+++ b/spec/controllers/my_controller_spec.rb@@ -156,6 +156,17 @@ RSpec.describe MyController doendend+ describe "locale" do+ it "renders the locale template" do+ as_logged_in_user user do+ get :locale+ end++ expect(response).to be_successful+ expect(response).to render_template "locale"+ end+ end+describe "settings" dodescribe "PATCH" dolet(:language) { "en" }diff --git a/spec/features/users/my_spec.rb b/spec/features/users/my_spec.rbindex 13047d14b9e..ce3570753aa 100644--- a/spec/features/users/my_spec.rb+++ b/spec/features/users/my_spec.rb@@ -66,14 +66,15 @@ RSpec.describe "my", :js doendshared_examples "common tests for normal and LDAP user" do- describe "settings" do+ describe "Language and Region" dobefore do- visit my_settings_path+ visit my_locale_pathendcontext "with a default time zone", with_settings: { user_default_timezone: "Asia/Tokyo" } doit "override user time zone" doexpect(user.pref.time_zone).to eq "Asia/Tokyo"+ expect(page).to have_heading "Language and Region"expect(page).to have_select "Time zone", selected: "(UTC+09:00) Tokyo"select "(UTC+01:00) Paris", from: "Time zone"@@ -88,6 +89,7 @@ RSpec.describe "my", :js doit "updates user language" doexpect(user.language).to eq "en"+ expect(page).to have_heading "Language and Region"expect(page).to have_select "Language", selected: "English"select "Español", from: "Language"@@ -101,6 +103,7 @@ RSpec.describe "my", :js doit "updates user language with change visible on navigating to other settings (regression #66951)" doexpect(user.language).to eq "en"+ expect(page).to have_heading "Language and Region"expect(page).to have_select "Language", selected: "English"select "Português do brasil", from: "Language"diff --git a/spec/lib/redmine/menu_manager_spec.rb b/spec/lib/redmine/menu_manager_spec.rbindex 92a8098b16d..878af54543b 100644--- a/spec/lib/redmine/menu_manager_spec.rb+++ b/spec/lib/redmine/menu_manager_spec.rb@@ -107,7 +107,7 @@ RSpec.describe Redmine::MenuManager docontext "for the my_menu" doit "includes the expected items" doexpect(described_class.items(:my_menu).map(&:name))- .to include(:account, :settings, :password, :access_tokens, :notifications, :reminders, :delete_account)+ .to include(:account, :locale, :password, :access_tokens, :notifications, :reminders, :delete_account)endenddiff --git a/spec/routing/my_spec.rb b/spec/routing/my_spec.rbindex 63b230a4c45..159421b6310 100644--- a/spec/routing/my_spec.rb+++ b/spec/routing/my_spec.rb@@ -39,12 +39,8 @@ RSpec.describe "my routes" doexpect(patch("/my/account")).to route_to("my#update_account")end- it "/my/settings GET routes to my#settings" do- expect(get("/my/settings")).to route_to("my#settings")- end-- it "/my/settings PATCH routes to my#update_account" do- expect(patch("/my/settings")).to route_to("my#update_settings")+ it "/my/locale GET routes to my#locale" do+ expect(get("/my/locale")).to route_to("my#locale")endit "/my/interface GET routes to my#interface" do@@ -64,6 +60,10 @@ RSpec.describe "my routes" doaction: "deletion_info")end+ it "/my/settings PATCH routes to my#update_account" do+ expect(patch("/my/settings")).to route_to("my#update_settings")+ end+context "for access tokens controller" doit "/my/access_tokens GET routes to my/access_tokens#index" doexpect(get("/my/access_tokens")).to route_to("my/access_tokens#index")