From fe104aa2c52f61cd8555fbc98c20501f50f4aae8 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 17:45:34 +0200 Subject: Extract admin strings to i18n: revisions, page_translations, and menu items, --- app/views/page_translations/edit.html.erb | 32 +++++++++++++++---------------- app/views/page_translations/show.html.erb | 18 ++++++++--------- 2 files changed, 24 insertions(+), 26 deletions(-) (limited to 'app/views/page_translations') diff --git a/app/views/page_translations/edit.html.erb b/app/views/page_translations/edit.html.erb index ac91d22c..f398a544 100644 --- a/app/views/page_translations/edit.html.erb +++ b/app/views/page_translations/edit.html.erb @@ -1,22 +1,20 @@
- Editing the <%= @locale.to_s.upcase %> translation of <%= title_for_node(@node) %>. + <%= t(".editing_prefix") %> <%= @locale.to_s.upcase %> <%= t(".translation_of") %> <%= title_for_node(@node) %>.
-

<%= link_to 'View revision history', node_revisions_path(@node, :locale => @locale) %>

+

<%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :locale => @locale) %>

- Metadata such as images, tags, template, and author belong to the page - as a whole, not to a single translation — change those from the - <%= link_to 'default-locale editor', edit_node_path(@node) %>. + <%= t(".metadata_hint_prefix") %> <%= link_to t(".metadata_hint_link"), edit_node_path(@node) %>.

- <%= button_to 'Unlock + Back', unlock_node_path(@node), method: :put, + <%= button_to t("nodes.edit.unlock_back"), unlock_node_path(@node), method: :put, form: { class: 'button_to state_changing' }, disabled: @node.autosave.present? %> - <%= submit_tag "Save #{@locale.to_s.upcase} translation", form: "translation_edit_form" %> - <%= submit_tag "Save + Unlock + Exit", name: "unlock_exit", form: "translation_edit_form" %> - <%= link_to "Preview ↗", preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> + <%= submit_tag t(".save_translation", :lang => @locale.to_s.upcase), form: "translation_edit_form" %> + <%= submit_tag t("nodes.edit.save_unlock_exit"), name: "unlock_exit", form: "translation_edit_form" %> + <%= link_to t("nodes.edit.preview"), preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %>
@@ -32,23 +30,23 @@ <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %>
-
Title
+
<%= Page.human_attribute_name(:title) %>
<%= text_field_tag "page[title]", @translation&.title %>
-
Abstract
+
<%= Page.human_attribute_name(:abstract) %>
<%= text_area_tag "page[abstract]", @translation&.abstract %>
-
Body
+
<%= Page.human_attribute_name(:body) %>
- -
@@ -59,7 +57,7 @@
diff --git a/app/views/page_translations/show.html.erb b/app/views/page_translations/show.html.erb index c4091fc3..0fbcd0b6 100644 --- a/app/views/page_translations/show.html.erb +++ b/app/views/page_translations/show.html.erb @@ -1,29 +1,29 @@ -

Compare — <%= title_for_node(@node) %>

+

<%= t(".title") %> — <%= title_for_node(@node) %>

-

<%= link_to 'View revision history', node_revisions_path(@node, :locale => @locale) %>

+

<%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :locale => @locale) %>

<%= @locale.to_s.upcase %>

-
Title
+
<%= Page.human_attribute_name(:title) %>
<%= @translation&.title %>
-
Abstract
+
<%= Page.human_attribute_name(:abstract) %>
<%= sanitize(@translation&.abstract.to_s) %>
-
Body
+
<%= Page.human_attribute_name(:body) %>
<%= sanitize(@translation&.body.to_s) %>
-

<%= I18n.default_locale.to_s.upcase %> (default)

-
Title
+

<%= I18n.default_locale.to_s.upcase %> (<%= t(".default_marker") %>)

+
<%= Page.human_attribute_name(:title) %>
<%= @default_translation&.title %>
-
Abstract
+
<%= Page.human_attribute_name(:abstract) %>
<%= sanitize(@default_translation&.abstract.to_s) %>
-
Body
+
<%= Page.human_attribute_name(:body) %>
<%= sanitize(@default_translation&.body.to_s) %>
-- cgit v1.3