From b7dee77cd1dd6f70e3bfa55df8b61681e9db321e Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 15:39:17 +0200 Subject: Extract admin strings to i18n: dashboard, layout chrome, and the JS bridge --- app/views/admin/_drafts.html.erb | 16 ++--- app/views/admin/_menu.html.erb | 6 +- app/views/admin/conventions.html.erb | 4 +- app/views/admin/index.html.erb | 36 +++++------ app/views/admin/search_results.html.erb | 2 +- app/views/layouts/_flash.html.erb | 17 ++--- app/views/layouts/admin.html.erb | 9 +-- config/locales/de.yml | 111 +++++++++++++++++++++++--------- config/locales/en.yml | 109 ++++++++++++++++++++++--------- public/javascripts/admin_interface.js | 10 ++- 10 files changed, 208 insertions(+), 112 deletions(-) diff --git a/app/views/admin/_drafts.html.erb b/app/views/admin/_drafts.html.erb index 4ef568f8..bfdc00a4 100644 --- a/app/views/admin/_drafts.html.erb +++ b/app/views/admin/_drafts.html.erb @@ -1,11 +1,11 @@ -

Drafts (<%= @drafts.size %>)

+

<%= t(".title", :size => @drafts.size) %>

- - - - + + + + <% @drafts.each do |draft| %> @@ -15,9 +15,9 @@ <% end %> diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index 7270df49..b0e310e9 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -1,5 +1,5 @@ -<%= link_to icon("home", library: "tabler", "aria-hidden": true), admin_path, "aria-label": "Dashboard", title: "Dashboard" %> -<%= icon("search", library: "tabler", "aria-hidden": true) %> -<%= button_to logout_path, method: :delete, aria: { label: "Log out" }, title: "Log out" do %> +<%= link_to icon("home", library: "tabler", "aria-hidden": true), admin_path, "aria-label": t(".dashboard"), title: t(".dashboard") %> +" title="<%= t(".search") %>"><%= icon("search", library: "tabler", "aria-hidden": true) %> +<%= button_to logout_path, method: :delete, aria: { label: t(".log_out") }, title: t(".log_out") do %> <%= icon("logout", library: "tabler", "aria-hidden": true) %> <% end %> diff --git a/app/views/admin/conventions.html.erb b/app/views/admin/conventions.html.erb index 72f6214a..434c2e9c 100644 --- a/app/views/admin/conventions.html.erb +++ b/app/views/admin/conventions.html.erb @@ -1,7 +1,7 @@ -

Node creation conventions

+

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

IDTitlePathauthor<%= t("admin.columns.id") %><%= t("admin.columns.title") %><%= t("admin.columns.path") %><%= t("admin.columns.author") %>
<%= draft.node.unique_name %> <%= draft.user.login rescue "" %> - <%= link_to 'Show', node_path(draft.node) %> - <%= link_to "Revisions", revision_path(draft.node.id) %> - <%= button_to "Publish", publish_node_path(draft.node), method: :put, form: { data: { confirm: "Do you really want to publish?" }, class: 'button_to state_changing' } %> + <%= link_to t("admin.common.show"), node_path(draft.node) %> + <%= link_to t(".revisions"), revision_path(draft.node.id) %> + <%= button_to t("nodes.show.publish"), publish_node_path(draft.node), method: :put, form: { data: { confirm: t("nodes.show.confirm_publish") }, class: 'button_to state_changing' } %>
- + <% @node_kinds.each do |kind, config| %> diff --git a/app/views/admin/index.html.erb b/app/views/admin/index.html.erb index 4d67dd77..25bdbdc6 100644 --- a/app/views/admin/index.html.erb +++ b/app/views/admin/index.html.erb @@ -1,29 +1,29 @@ -

cccms dashboard

+

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

<%= link_to new_node_path, class: "action_button" do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create post + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_post") %> <% end %> <%= link_to chapters_nodes_path, class: "action_button" do %> - <%= icon("map-pin", library: "tabler", "aria-hidden": true) %> Find a chapter + <%= icon("map-pin", library: "tabler", "aria-hidden": true) %> <%= t(".find_chapter") %> <% end %> <%= link_to new_asset_path, class: "action_button" do %> - <%= icon("upload", library: "tabler", "aria-hidden": true) %> Upload asset + <%= icon("upload", library: "tabler", "aria-hidden": true) %> <%= t(".upload_asset") %> <% end %> <%= link_to sitemap_nodes_path, class: "action_button" do %> - <%= icon("list-tree", library: "tabler", "aria-hidden": true) %> Add a page in the page tree + <%= icon("list-tree", library: "tabler", "aria-hidden": true) %> <%= t(".add_in_tree") %> <% end %>
-

Drafts and autosaves

+

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

    <% @drafts.each do |node| %>
  • @@ -37,43 +37,43 @@
  • <% end %>
- <%= link_to "See all drafts →", drafts_nodes_path %> + <%= link_to t(".see_all_drafts"), drafts_nodes_path %>
-

Recent changes

+

<%= t("node_actions.heading") %>

KindWhat happens
<%= t(".kind") %><%= t(".what_happens") %>
<%= kind %>
<%= render partial: "node_actions/action_row", collection: @actions, as: :action %>
- <%= link_to "See all recent changes →", admin_log_path %> + <%= link_to t(".see_all_changes"), admin_log_path %>
-

Housekeeping

+

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

<%= link_to edit_user_path(current_user), class: "action_button" do %> - <%= icon("user-cog", library: "tabler", "aria-hidden": true) %> My account + <%= icon("user-cog", library: "tabler", "aria-hidden": true) %> <%= t(".my_account") %> <% end %> <%= link_to nodes_path, class: "action_button" do %> - <%= icon("list", library: "tabler", "aria-hidden": true) %> Nodes + <%= icon("list", library: "tabler", "aria-hidden": true) %> <%= t("nodes.index.title") %> <% end %> <%= link_to events_path, class: "action_button" do %> - <%= icon("calendar", library: "tabler", "aria-hidden": true) %> Events + <%= icon("calendar", library: "tabler", "aria-hidden": true) %> <%= t("events.index.title") %> <% end %> <%= link_to assets_path, class: "action_button" do %> - <%= icon("folder", library: "tabler", "aria-hidden": true) %> Assets + <%= icon("folder", library: "tabler", "aria-hidden": true) %> <%= t("assets.index.title") %> <% end %> <%= link_to users_path, class: "action_button" do %> - <%= icon("users", library: "tabler", "aria-hidden": true) %> Users + <%= icon("users", library: "tabler", "aria-hidden": true) %> <%= t("users.index.users") %> <% end %> <%= link_to menu_items_path, class: "action_button" do %> - <%= icon("menu-2", library: "tabler", "aria-hidden": true) %> Navigation + <%= icon("menu-2", library: "tabler", "aria-hidden": true) %> <%= t(".navigation") %> <% end %> <% trash_count = Node.trash.children.count %> <%= link_to trashed_nodes_path, class: "action_button" do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Trash<%= " (#{trash_count})" if trash_count > 0 %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("nodes.trashed.title") %><%= " (#{trash_count})" if trash_count > 0 %> <% end %>
diff --git a/app/views/admin/search_results.html.erb b/app/views/admin/search_results.html.erb index a7571977..e3802a03 100644 --- a/app/views/admin/search_results.html.erb +++ b/app/views/admin/search_results.html.erb @@ -1,4 +1,4 @@ -

Search Results

+

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