From ed32bc6902ab634451539770bcd910662212e01a Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 02:56:49 +0200 Subject: Extract admin strings to i18n: users and tags clusters --- app/views/tags/index.html.erb | 4 ++-- app/views/users/_user.html.erb | 4 ++-- app/views/users/edit.html.erb | 10 +++++----- app/views/users/index.html.erb | 12 ++++++------ app/views/users/new.html.erb | 14 +++++++------- app/views/users/show.html.erb | 12 ++++++------ 6 files changed, 28 insertions(+), 28 deletions(-) (limited to 'app/views') diff --git a/app/views/tags/index.html.erb b/app/views/tags/index.html.erb index b962b65b..b7b9660b 100644 --- a/app/views/tags/index.html.erb +++ b/app/views/tags/index.html.erb @@ -1,5 +1,5 @@ -

Tags

+

<%= t(".title") %>

<% @tags.each do |tag| %> <%= link_to tag, tag_path(tag.name.parameterize) %> -<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/users/_user.html.erb b/app/views/users/_user.html.erb index 3a88f5e2..9c6466a2 100644 --- a/app/views/users/_user.html.erb +++ b/app/views/users/_user.html.erb @@ -8,8 +8,8 @@ <%= button_to user_path(user), method: :delete, - form: { data: { confirm: "Do you really want to destroy user #{user.login}?" }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy + form: { data: { confirm: t(".confirm_destroy", :login => user.login) }, class: 'button_to destructive' } do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> <% end %> <% end %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index ea5e7dec..4f1a22b8 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -9,20 +9,20 @@
<%= form_for @user do |f| %>
-
<%= t(".login") %>
+
<%= t("users.labels.login") %>
<%= f.text_field :login, :autocomplete => "username" %>
-
<%= t(".email") %>
+
<%= t("users.labels.email") %>
<%= f.text_field :email %>
-
<%= t(".password") %>
+
<%= t("users.labels.password") %>
<%= f.password_field :password, :autocomplete => "new-password" %>
-
<%= t(".confirm") %>
+
<%= t("users.labels.confirm") %>
<%= f.password_field :password_confirmation, :autocomplete => "new-password" %>
<% if current_user.admin? %> -
<%= t(".admin") %>
+
<%= t("users.labels.admin") %>
<%= f.check_box :admin %>
<% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb index 4f5266d8..0a003cb1 100644 --- a/app/views/users/index.html.erb +++ b/app/views/users/index.html.erb @@ -1,10 +1,10 @@ -

Admins

+

<%= t(".admins") %>

<%= link_to new_user_path(admin: true), class: 'action_button' do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create admin user + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_admin") %> <% end %> - + @@ -12,13 +12,13 @@ <%= render :partial => "user", :locals => {:users => @users[:admin] ||= []} %>
Login<%= t("users.labels.login") %>
-

Users

+

<%= t(".users") %>

<%= link_to new_user_path, class: 'action_button' do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create user + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_user") %> <% end %> - + diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 8ae993c5..776e6e96 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,4 +1,4 @@ -

Create new user

+

<%= t(".title") %>

<% if @user.errors.any? %>
@@ -9,23 +9,23 @@
<%= form_for @user do |f| %>
-
Login
+
<%= t("users.labels.login") %>
<%= f.text_field :login %>
-
E-Mail
+
<%= t("users.labels.email") %>
<%= f.text_field :email %>
-
Password
+
<%= t("users.labels.password") %>
<%= f.password_field :password %>
-
Confirm
+
<%= t("users.labels.confirm") %>
<%= f.password_field :password_confirmation %>
-
Admin?
+
<%= t("users.labels.admin") %>
<%= f.check_box :admin %>
-
<%= f.submit "Create" %>
+
<%= f.submit t("admin.common.create") %>
<% end %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 08eb52ec..44976800 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -2,24 +2,24 @@

<%= @user.login %>

-
Actions
+
<%= t("admin.columns.actions") %>
<%= link_to edit_user_path(@user), class: 'action_button' do %> - <%= icon("edit", library: "tabler", "aria-hidden": true) %> Edit + <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.edit") %> <% end %>
-
Login
+
<%= t("users.labels.login") %>
<%= @user.login %>
-
E-Mail
+
<%= t("users.labels.email") %>
<%= @user.email %>
-
Admin?
-
<%= @user.admin ? "yes" : "no" %>
+
<%= t("users.labels.admin") %>
+
<%= @user.admin ? t("admin.common.yes") : t("admin.common.no") %>
-- cgit v1.3
Login<%= t("users.labels.login") %>