Skip to content

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

[#65403] Rename Settings to Language and Region

Alexander Brandon Coles3757b2288083
diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb
index f1cef66d096..69b881e023f 100644
--- a/app/controllers/my_controller.rb
+++ b/app/controllers/my_controller.rb
@@ -43,7 +43,7 @@ class MyController < ApplicationController
no_authorization_required! :account,
:update_account,
- :settings,
+ :locale,
:interface,
:update_settings,
:password,
@@ -52,7 +52,7 @@ class MyController < ApplicationController
:reminders
menu_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 < ApplicationController
write_settings
end
- def settings; end
+ def locale; end
def update_settings
write_settings
diff --git a/app/views/my/settings.html.erb b/app/views/my/locale.html.erb
similarity index 90%
rename from app/views/my/settings.html.erb
rename to app/views/my/locale.html.erb
index 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.rb
index 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.yml
index 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.rb
index 4338d070c9a..65db9f6ca83 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -905,7 +905,7 @@ Rails.application.routes.draw do
post "/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.rb
index 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 < ApplicationController
text = 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')}"
end
flash[:notice] = text.html_safe # rubocop:disable Rails/OutputSafety
diff --git a/spec/components/my/locale_component_spec.rb b/spec/components/my/locale_component_spec.rb
index 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 do
subject(:rendered_component) do
with_controller_class(MyController) do
- with_request_url("/my/settings") do
+ with_request_url("/my/locale") do
render_component(user)
end
end
diff --git a/spec/controllers/my_controller_spec.rb b/spec/controllers/my_controller_spec.rb
index 838bb54382b..c3c63df2d93 100644
--- a/spec/controllers/my_controller_spec.rb
+++ b/spec/controllers/my_controller_spec.rb
@@ -156,6 +156,17 @@ RSpec.describe MyController do
end
end
+ 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" do
describe "PATCH" do
let(:language) { "en" }
diff --git a/spec/features/users/my_spec.rb b/spec/features/users/my_spec.rb
index 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 do
end
shared_examples "common tests for normal and LDAP user" do
- describe "settings" do
+ describe "Language and Region" do
before do
- visit my_settings_path
+ visit my_locale_path
end
context "with a default time zone", with_settings: { user_default_timezone: "Asia/Tokyo" } do
it "override user time zone" do
expect(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 do
it "updates user language" do
expect(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 do
it "updates user language with change visible on navigating to other settings (regression #66951)" do
expect(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.rb
index 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 do
context "for the my_menu" do
it "includes the expected items" do
expect(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)
end
end
diff --git a/spec/routing/my_spec.rb b/spec/routing/my_spec.rb
index 63b230a4c45..159421b6310 100644
--- a/spec/routing/my_spec.rb
+++ b/spec/routing/my_spec.rb
@@ -39,12 +39,8 @@ RSpec.describe "my routes" do
expect(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")
end
it "/my/interface GET routes to my#interface" do
@@ -64,6 +60,10 @@ RSpec.describe "my routes" do
action: "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" do
it "/my/access_tokens GET routes to my/access_tokens#index" do
expect(get("/my/access_tokens")).to route_to("my/access_tokens#index")