diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-25 20:16:32 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-25 20:16:32 +0200 |
| commit | f8ce323663debb22890ad1ed29f385b8b832abc6 (patch) | |
| tree | e872c2d8a6af8de6ad84ef285240f0c130b26bcc /app | |
| parent | fe104aa2c52f61cd8555fbc98c20501f50f4aae8 (diff) | |
Extract public-site strings to i18n
The public views were never part of the admin extraction and were
broken in both directions: German visitors got "Featured", "Calendar"
and "Tags", English visitors got "Suchergebnisse für Suchbegriff:".
Also picks up the unlock-confirm message in link_helper, a straggler
from the revisions/menu_items batch, and drops two raw() calls in the
application layout in favour of link_to blocks.
Diffstat (limited to 'app')
| -rw-r--r-- | app/helpers/link_helper.rb | 6 | ||||
| -rw-r--r-- | app/views/content/_featured_articles.html.erb | 2 | ||||
| -rw-r--r-- | app/views/content/_front_page_calendar.html.erb | 4 | ||||
| -rw-r--r-- | app/views/content/_tags.html.erb | 2 | ||||
| -rw-r--r-- | app/views/layouts/application.html.erb | 8 | ||||
| -rw-r--r-- | app/views/layouts/assets.html.erb | 17 | ||||
| -rw-r--r-- | app/views/layouts/pages.html.erb | 19 | ||||
| -rw-r--r-- | app/views/search/index.html.erb | 2 | ||||
| -rw-r--r-- | app/views/tags/show.html.erb | 2 |
9 files changed, 13 insertions, 49 deletions
diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb index 9b0b4e10..2121133e 100644 --- a/app/helpers/link_helper.rb +++ b/app/helpers/link_helper.rb | |||
| @@ -39,9 +39,9 @@ module LinkHelper | |||
| 39 | end | 39 | end |
| 40 | 40 | ||
| 41 | def unlock_link | 41 | def unlock_link |
| 42 | message = "Are you sure you want to unlock?\n" \ | 42 | message = t("admin.common.unlock_confirm", |
| 43 | "Locked by #{@node.lock_owner.login}\n" \ | 43 | :login => @node.lock_owner.login, |
| 44 | "Last modified #{@page.updated_at.to_fs(:db)}" | 44 | :time => @page.updated_at.to_fs(:db)) |
| 45 | button_to 'Unlock', unlock_node_path(@node), | 45 | button_to 'Unlock', unlock_node_path(@node), |
| 46 | method: :put, | 46 | method: :put, |
| 47 | form: { data: { confirm: message }, class: 'button_to state_changing' } | 47 | form: { data: { confirm: message }, class: 'button_to state_changing' } |
diff --git a/app/views/content/_featured_articles.html.erb b/app/views/content/_featured_articles.html.erb index 6717c51f..2dfc4967 100644 --- a/app/views/content/_featured_articles.html.erb +++ b/app/views/content/_featured_articles.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <div id="featured_articles"> | 1 | <div id="featured_articles"> |
| 2 | <h2>Featured</h2> | 2 | <h2><%= t(".title") %></h2> |
| 3 | 3 | ||
| 4 | <!-- %= link_to( | 4 | <!-- %= link_to( |
| 5 | image_tag( '34c3-tuwat.1e4e25c.png' ), | 5 | image_tag( '34c3-tuwat.1e4e25c.png' ), |
diff --git a/app/views/content/_front_page_calendar.html.erb b/app/views/content/_front_page_calendar.html.erb index e7f46ba5..dc4ba884 100644 --- a/app/views/content/_front_page_calendar.html.erb +++ b/app/views/content/_front_page_calendar.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <div id="frontpage_calendar"> | 1 | <div id="frontpage_calendar"> |
| 2 | <h2>Calendar</h2> | 2 | <h2><%= t(".title") %></h2> |
| 3 | <ul class="teasertext"> | 3 | <ul class="teasertext"> |
| 4 | <% occurrences.each do |occurrence| %> | 4 | <% occurrences.each do |occurrence| %> |
| 5 | <li> | 5 | <li> |
| @@ -8,4 +8,4 @@ | |||
| 8 | </li> | 8 | </li> |
| 9 | <% end %> | 9 | <% end %> |
| 10 | </ul> | 10 | </ul> |
| 11 | </div> \ No newline at end of file | 11 | </div> |
diff --git a/app/views/content/_tags.html.erb b/app/views/content/_tags.html.erb index f0e7210c..cf339b6f 100644 --- a/app/views/content/_tags.html.erb +++ b/app/views/content/_tags.html.erb | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | <% unless @page.nil? || @page.tags.empty? %> | 1 | <% unless @page.nil? || @page.tags.empty? %> |
| 2 | <div id="tags"> | 2 | <div id="tags"> |
| 3 | <h2>Tags</h2> | 3 | <h2><%= t(".title") %></h2> |
| 4 | <ul class="teasertext"> | 4 | <ul class="teasertext"> |
| 5 | <% @page.tags.each do |tag| %> | 5 | <% @page.tags.each do |tag| %> |
| 6 | <li><%= link_to tag.name, tag_path(tag.name) %></li> | 6 | <li><%= link_to tag.name, tag_path(tag.name) %></li> |
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f981fc11..f95ea889 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | <%= render :partial => "content/search" %> | 37 | <%= render :partial => "content/search" %> |
| 38 | </div> | 38 | </div> |
| 39 | <div id="light-mode-div"> | 39 | <div id="light-mode-div"> |
| 40 | <input id="light-mode" type="checkbox" aria-label="Switch between dark and light mode" /><label for="light-mode"><span class="hide-me">lights</span></label> | 40 | <input id="light-mode" type="checkbox" aria-label="<%= t(".light_mode_aria") %>" /><label for="light-mode"><span class="hide-me"><%= t(".light_mode_label") %></span></label> |
| 41 | </div> | 41 | </div> |
| 42 | <div id="burger-div"> | 42 | <div id="burger-div"> |
| 43 | <input type="checkbox" id="menu-toggle" class="menu-checkbox"> | 43 | <input type="checkbox" id="menu-toggle" class="menu-checkbox"> |
| @@ -49,10 +49,10 @@ | |||
| 49 | 49 | ||
| 50 | <% if current_user && @page.node %> | 50 | <% if current_user && @page.node %> |
| 51 | <div class="main_navigation"> | 51 | <div class="main_navigation"> |
| 52 | <h2>Admin</h2> | 52 | <h2><%= t(".admin") %></h2> |
| 53 | <ul> | 53 | <ul> |
| 54 | <li><%= link_to raw('<span class="inactive admin_edit_link">⚙️ Overview</span>'), admin_path %></li> | 54 | <li><%= link_to admin_path do %><span class="inactive admin_edit_link">⚙️ <%= t(".overview") %></span><% end %></li> |
| 55 | <li><%= link_to raw('<span class="inactive admin_edit_link">✎ Edit</span>'), node_path(@page.node) %></li> | 55 | <li><%= link_to node_path(@page.node) do %><span class="inactive admin_edit_link">✎ <%= t(".edit") %></span><% end %></li> |
| 56 | </ul> | 56 | </ul> |
| 57 | </div> | 57 | </div> |
| 58 | <% end %> | 58 | <% end %> |
diff --git a/app/views/layouts/assets.html.erb b/app/views/layouts/assets.html.erb deleted file mode 100644 index 9d629c8d..00000000 --- a/app/views/layouts/assets.html.erb +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
| 5 | <head> | ||
| 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
| 7 | <title>Assets: <%= controller.action_name %></title> | ||
| 8 | <%= stylesheet_link_tag 'scaffold' %> | ||
| 9 | </head> | ||
| 10 | <body> | ||
| 11 | |||
| 12 | <p style="color: green"><%= flash[:notice] %></p> | ||
| 13 | |||
| 14 | <%= yield %> | ||
| 15 | |||
| 16 | </body> | ||
| 17 | </html> | ||
diff --git a/app/views/layouts/pages.html.erb b/app/views/layouts/pages.html.erb deleted file mode 100644 index 70ceece9..00000000 --- a/app/views/layouts/pages.html.erb +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
| 3 | |||
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
| 5 | <head> | ||
| 6 | <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> | ||
| 7 | <meta name="viewport" content="width=device-width,initial-scale=1" /> | ||
| 8 | <meta property="og:image" content="https://www.ccc.de/images/chaosknoten.svg" /> | ||
| 9 | <title>Pages: <%= controller.action_name %></title> | ||
| 10 | <%= stylesheet_link_tag 'scaffold' %> | ||
| 11 | </head> | ||
| 12 | <body> | ||
| 13 | |||
| 14 | <p style="color: green"><%= flash[:notice] %></p> | ||
| 15 | |||
| 16 | <%= yield %> | ||
| 17 | |||
| 18 | </body> | ||
| 19 | </html> | ||
diff --git a/app/views/search/index.html.erb b/app/views/search/index.html.erb index 81ffb0dc..bb8f63b7 100644 --- a/app/views/search/index.html.erb +++ b/app/views/search/index.html.erb | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | <% if params[:search_term] %> | 1 | <% if params[:search_term] %> |
| 2 | <h2>Suchergebnisse für Suchbegriff: <%=h params[:search_term] %></h2> | 2 | <h2><%= t(".results_for", :query => params[:search_term]) %></h2> |
| 3 | <% end %> | 3 | <% end %> |
| 4 | 4 | ||
| 5 | <%= | 5 | <%= |
diff --git a/app/views/tags/show.html.erb b/app/views/tags/show.html.erb index 3a235223..eddf9b88 100644 --- a/app/views/tags/show.html.erb +++ b/app/views/tags/show.html.erb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <h2><%= t(:show_tag_headline) %> »<%=h @tag %>«</h2> | 1 | <h2><%= t(:show_tag_headline) %> »<%=h @tag %>«</h2> |
| 2 | 2 | ||
| 3 | <p class="feed_link"> | 3 | <p class="feed_link"> |
| 4 | <%= link_to "Subscribe to updates tagged »#{@tag}«", | 4 | <%= link_to t(".subscribe", :tag => @tag), |
| 5 | rss_tag_url(:tag => @tag, :format => :xml), | 5 | rss_tag_url(:tag => @tag, :format => :xml), |
| 6 | :type => "application/atom+xml" %> | 6 | :type => "application/atom+xml" %> |
| 7 | </p> | 7 | </p> |
