From 0b409818b99ca5551b01f719b7bf5748a38278e0 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Mon, 21 Jul 2025 12:57:33 +0300 Subject: [PATCH] Gather together i18n strings of role icons --- app/views/users/_role_icons.html.erb | 10 ++++----- config/locales/en.yml | 31 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/app/views/users/_role_icons.html.erb b/app/views/users/_role_icons.html.erb index ed27e2e25..272a78e11 100644 --- a/app/views/users/_role_icons.html.erb +++ b/app/views/users/_role_icons.html.erb @@ -2,19 +2,19 @@ <% if current_user&.administrator? %> <% if @user.role?(role) %> <%= link_to inline_svg_tag("icons/role-star.svg", :class => "role-icon #{role}", - :title => t("users.show.role.revoke.#{role}")), + :title => t(".revoke.#{role}")), user_role_path(@user, role), :method => :delete, - :data => { :confirm => t("user_role.revoke.are_you_sure", :name => @user.display_name, :role => role) } %> + :data => { :confirm => t(".revoke.are_you_sure", :name => @user.display_name, :role => role) } %> <% else %> <%= link_to inline_svg_tag("icons/role-star.svg", :class => "role-icon #{role} inactive", - :title => t("users.show.role.grant.#{role}")), + :title => t(".grant.#{role}")), user_role_path(@user, role), :method => :post, - :data => { :confirm => t("user_role.grant.are_you_sure", :name => @user.display_name, :role => role) } %> + :data => { :confirm => t(".grant.are_you_sure", :name => @user.display_name, :role => role) } %> <% end %> <% elsif @user.role?(role) %> <%= inline_svg_tag "icons/role-star.svg", :class => "role-icon #{role}", - :title => t("users.show.role.#{role}") %> + :title => t(".title.#{role}") %> <% end %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ef6f50598..c50fd3209 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3067,18 +3067,6 @@ en: created from: "Created from:" status: "Status:" spam score: "Spam Score:" - role: - administrator: "This user is an administrator" - moderator: "This user is a moderator" - importer: "This user is a importer" - grant: - administrator: "Grant administrator access" - moderator: "Grant moderator access" - importer: "Grant importer access" - revoke: - administrator: "Revoke administrator access" - moderator: "Revoke moderator access" - importer: "Revoke importer access" block_history: "Active Blocks" moderator_history: "Blocks Given" revoke_all_blocks: "Revoke all blocks" @@ -3198,16 +3186,27 @@ en: If you already have an account, you can log in to your account using your username and password and then associate the account with your ID in your user settings. + role_icons: + title: + administrator: "This user is an administrator" + moderator: "This user is a moderator" + importer: "This user is a importer" + grant: + administrator: "Grant administrator access" + moderator: "Grant moderator access" + importer: "Grant importer access" + are_you_sure: "Are you sure you want to grant the role '%{role}' to the user '%{name}'?" + revoke: + administrator: "Revoke administrator access" + moderator: "Revoke moderator access" + importer: "Revoke importer access" + are_you_sure: "Are you sure you want to revoke the role '%{role}' from the user '%{name}'?" user_role: filter: not_a_role: "The string '%{role}' is not a valid role." already_has_role: "The user already has role %{role}." doesnt_have_role: "The user does not have role %{role}." not_revoke_admin_current_user: "Cannot revoke administrator role from current user." - grant: - are_you_sure: "Are you sure you want to grant the role '%{role}' to the user '%{name}'?" - revoke: - are_you_sure: "Are you sure you want to revoke the role '%{role}' from the user '%{name}'?" user_blocks: model: non_moderator_update: "Must be a moderator to create or update a block." -- 2.39.5