diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-25 17:45:34 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-25 17:45:34 +0200 |
| commit | fe104aa2c52f61cd8555fbc98c20501f50f4aae8 (patch) | |
| tree | 4596bfa52d316c05096e176b88fc004409cabbf9 /app/views/page_translations | |
| parent | 22c690749e154a5426c4f190fbbc08a5dee2eeee (diff) | |
Extract admin strings to i18n: revisions, page_translations, and menu items,
Diffstat (limited to 'app/views/page_translations')
| -rw-r--r-- | app/views/page_translations/edit.html.erb | 32 | ||||
| -rw-r--r-- | app/views/page_translations/show.html.erb | 18 |
2 files changed, 24 insertions, 26 deletions
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 @@ | |||
| 1 | <div class="translation_banner"> | 1 | <div class="translation_banner"> |
| 2 | Editing the <strong><%= @locale.to_s.upcase %></strong> translation of <strong><%= title_for_node(@node) %></strong>. | 2 | <%= t(".editing_prefix") %> <strong><%= @locale.to_s.upcase %></strong> <%= t(".translation_of") %> <strong><%= title_for_node(@node) %></strong>. |
| 3 | </div> | 3 | </div> |
| 4 | 4 | ||
| 5 | <p class="node_action_bar standalone_action_bar"><%= link_to 'View revision history', node_revisions_path(@node, :locale => @locale) %></p> | 5 | <p class="node_action_bar standalone_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :locale => @locale) %></p> |
| 6 | 6 | ||
| 7 | <p class="field_hint"> | 7 | <p class="field_hint"> |
| 8 | Metadata such as images, tags, template, and author belong to the page | 8 | <%= t(".metadata_hint_prefix") %> <%= link_to t(".metadata_hint_link"), edit_node_path(@node) %>. |
| 9 | as a whole, not to a single translation — change those from the | ||
| 10 | <%= link_to 'default-locale editor', edit_node_path(@node) %>. | ||
| 11 | </p> | 9 | </p> |
| 12 | 10 | ||
| 13 | <div class="node_action_bar"> | 11 | <div class="node_action_bar"> |
| 14 | <%= button_to 'Unlock + Back', unlock_node_path(@node), method: :put, | 12 | <%= button_to t("nodes.edit.unlock_back"), unlock_node_path(@node), method: :put, |
| 15 | form: { class: 'button_to state_changing' }, | 13 | form: { class: 'button_to state_changing' }, |
| 16 | disabled: @node.autosave.present? %> | 14 | disabled: @node.autosave.present? %> |
| 17 | <%= submit_tag "Save #{@locale.to_s.upcase} translation", form: "translation_edit_form" %> | 15 | <%= submit_tag t(".save_translation", :lang => @locale.to_s.upcase), form: "translation_edit_form" %> |
| 18 | <%= submit_tag "Save + Unlock + Exit", name: "unlock_exit", form: "translation_edit_form" %> | 16 | <%= submit_tag t("nodes.edit.save_unlock_exit"), name: "unlock_exit", form: "translation_edit_form" %> |
| 19 | <%= link_to "Preview ↗", preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> | 17 | <%= link_to t("nodes.edit.preview"), preview_page_path(@page, :locale => @locale), target: "_blank", rel: "noopener", class: "preview_link" %> |
| 20 | </div> | 18 | </div> |
| 21 | 19 | ||
| 22 | <div id="admin_layout"> | 20 | <div id="admin_layout"> |
| @@ -32,23 +30,23 @@ | |||
| 32 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", | 30 | <%= form_with url: node_translation_path(@node, @locale), method: :patch, local: true, id: "translation_edit_form", |
| 33 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> | 31 | data: { autosave_url: autosave_node_translation_path(@node, @locale), show_url: node_path(@node) } do |f| %> |
| 34 | <div id="content"> | 32 | <div id="content"> |
| 35 | <div class="layout_row_label">Title</div> | 33 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 36 | <div class="layout_row_content"> | 34 | <div class="layout_row_content"> |
| 37 | <%= text_field_tag "page[title]", @translation&.title %> | 35 | <%= text_field_tag "page[title]", @translation&.title %> |
| 38 | </div> | 36 | </div> |
| 39 | 37 | ||
| 40 | <div class="layout_row_label">Abstract</div> | 38 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 41 | <div class="layout_row_content"> | 39 | <div class="layout_row_content"> |
| 42 | <%= text_area_tag "page[abstract]", @translation&.abstract %> | 40 | <%= text_area_tag "page[abstract]", @translation&.abstract %> |
| 43 | </div> | 41 | </div> |
| 44 | 42 | ||
| 45 | <div class="layout_row_label">Body</div> | 43 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 46 | <div class="body_toolbar_row"> | 44 | <div class="body_toolbar_row"> |
| 47 | <button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="Toggle live preview" title="Toggle live preview"> | 45 | <button type="button" id="preview_toggle" class="view_toggle" aria-pressed="false" aria-label="<%= t("admin.common.toggle_preview") %>" title="<%= t("admin.common.toggle_preview") %>"> |
| 48 | <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span>Live preview</span> | 46 | <%= icon("layout-sidebar-right", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.live_preview") %></span> |
| 49 | </button> | 47 | </button> |
| 50 | <button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="Force preview render" title="Force preview render"> | 48 | <button type="button" id="preview_force_render" class="view_toggle" style="display:none" aria-label="<%= t("admin.common.force_render") %>" title="<%= t("admin.common.force_render") %>"> |
| 51 | <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span>Force refresh</span> | 49 | <%= icon("refresh", library: "tabler", "aria-hidden": true) %> <span><%= t("nodes.edit.force_refresh") %></span> |
| 52 | </button> | 50 | </button> |
| 53 | </div> | 51 | </div> |
| 54 | 52 | ||
| @@ -59,7 +57,7 @@ | |||
| 59 | </div> | 57 | </div> |
| 60 | </div> | 58 | </div> |
| 61 | <div id="preview_panel" style="display:none"> | 59 | <div id="preview_panel" style="display:none"> |
| 62 | <iframe id="live_preview_iframe" title="Live preview" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe> | 60 | <iframe id="live_preview_iframe" title="<%= t("nodes.edit.live_preview") %>" data-src="<%= preview_page_path(@page, :locale => @locale) %>"></iframe> |
| 63 | </div> | 61 | </div> |
| 64 | </div> | 62 | </div> |
| 65 | </div> | 63 | </div> |
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 @@ | |||
| 1 | <h1>Compare — <%= title_for_node(@node) %></h1> | 1 | <h1><%= t(".title") %> — <%= title_for_node(@node) %></h1> |
| 2 | 2 | ||
| 3 | <p class="node_action_bar standalone_action_bar"><%= link_to 'View revision history', node_revisions_path(@node, :locale => @locale) %></p> | 3 | <p class="node_action_bar standalone_action_bar"><%= link_to t("page_translations.revision_history_link"), node_revisions_path(@node, :locale => @locale) %></p> |
| 4 | 4 | ||
| 5 | <div class="translation_compare"> | 5 | <div class="translation_compare"> |
| 6 | <div class="translation_compare_column"> | 6 | <div class="translation_compare_column"> |
| 7 | <h2><%= @locale.to_s.upcase %></h2> | 7 | <h2><%= @locale.to_s.upcase %></h2> |
| 8 | <div class="layout_row_label">Title</div> | 8 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 9 | <div class="layout_row_content"><%= @translation&.title %></div> | 9 | <div class="layout_row_content"><%= @translation&.title %></div> |
| 10 | 10 | ||
| 11 | <div class="layout_row_label">Abstract</div> | 11 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 12 | <div class="layout_row_content"><%= sanitize(@translation&.abstract.to_s) %></div> | 12 | <div class="layout_row_content"><%= sanitize(@translation&.abstract.to_s) %></div> |
| 13 | 13 | ||
| 14 | <div class="layout_row_label">Body</div> | 14 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 15 | <div class="layout_row_content"><%= sanitize(@translation&.body.to_s) %></div> | 15 | <div class="layout_row_content"><%= sanitize(@translation&.body.to_s) %></div> |
| 16 | </div> | 16 | </div> |
| 17 | 17 | ||
| 18 | <div class="translation_compare_column"> | 18 | <div class="translation_compare_column"> |
| 19 | <h2><%= I18n.default_locale.to_s.upcase %> (default)</h2> | 19 | <h2><%= I18n.default_locale.to_s.upcase %> (<%= t(".default_marker") %>)</h2> |
| 20 | <div class="layout_row_label">Title</div> | 20 | <div class="layout_row_label"><%= Page.human_attribute_name(:title) %></div> |
| 21 | <div class="layout_row_content"><%= @default_translation&.title %></div> | 21 | <div class="layout_row_content"><%= @default_translation&.title %></div> |
| 22 | 22 | ||
| 23 | <div class="layout_row_label">Abstract</div> | 23 | <div class="layout_row_label"><%= Page.human_attribute_name(:abstract) %></div> |
| 24 | <div class="layout_row_content"><%= sanitize(@default_translation&.abstract.to_s) %></div> | 24 | <div class="layout_row_content"><%= sanitize(@default_translation&.abstract.to_s) %></div> |
| 25 | 25 | ||
| 26 | <div class="layout_row_label">Body</div> | 26 | <div class="layout_row_label"><%= Page.human_attribute_name(:body) %></div> |
| 27 | <div class="layout_row_content"><%= sanitize(@default_translation&.body.to_s) %></div> | 27 | <div class="layout_row_content"><%= sanitize(@default_translation&.body.to_s) %></div> |
| 28 | </div> | 28 | </div> |
| 29 | </div> | 29 | </div> |
