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/layouts/_flash.html.erb | 17 +++++++++-------- app/views/layouts/admin.html.erb | 9 +++++---- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'app/views/layouts') diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb index a67fc866..b72c377f 100644 --- a/app/views/layouts/_flash.html.erb +++ b/app/views/layouts/_flash.html.erb @@ -2,20 +2,21 @@
<%= flash[:notice] %> <% if flash[:status_path] %> - <%= link_to 'Go to Status', flash[:status_path] %> + <%= link_to t(".go_to_status"), flash[:status_path] %> <% end %> <% if flash[:stale_locale_path] %> - The <%= flash[:stale_locale] %> translation may be out of date — - <%= link_to 'review it', flash[:stale_locale_path] %> too. + <%= t(".stale_prefix", :lang => flash[:stale_locale]) %> + <%= link_to t(".stale_link"), flash[:stale_locale_path] %><%= t(".stale_suffix") %> <% end %> <% if flash[:locked_node_path] %> - The page is locked by <%= flash[:locked_by] %> — - <%= link_to 'unlock it there', flash[:locked_node_path] %> first, - then attach from this asset's page. + <%= t(".locked_prefix", :login => flash[:locked_by]) %> + <%= link_to t(".locked_link"), flash[:locked_node_path] %><%= t(".locked_suffix") %> + <% end %> <% if flash[:headline_kept_path] %> - The page's existing headline was kept — - <%= link_to 'change it there', flash[:headline_kept_path] %> if needed. + <%= t(".headline_prefix") %> + <%= link_to t(".headline_link"), flash[:headline_kept_path] %><%= t(".headline_suffix") %> + <% end %> <% if flash[:error] %> <%= flash[:error] %> diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 89c9b550..e056489f 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -10,15 +10,16 @@ <%= javascript_include_tag 'admin_bundle' %> <%= tinymce_assets %> - - - <%= javascript_tag nonce: true do %> var ADMIN_SEARCH_URL = "<%= admin_search_path %>"; var ADMIN_MENU_SEARCH_URL = "<%= admin_menu_search_path %>"; + var ADMIN_STRINGS = <%= raw({ :lock_lost_prefix => t(".lock_lost_prefix"), :lock_lost_link => t(".lock_lost_link"), :insert_image => t(".insert_image"), :insert_image_tooltip => t(".insert_image_tooltip") }.to_json) %>; var PARAMETERIZE_PREVIEW_URL = "<%= parameterize_preview_nodes_path %>"; var DASHBOARD_SEARCH_URL = "<%= admin_dashboard_search_path %>"; <% end %> + + + @@ -30,7 +31,7 @@