From de9a3a5591d4b17c0e0f17abc0ee8ffe85de50e6 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 14:24:03 +0200 Subject: Extract admin strings to i18n: assets and events clusters --- app/views/assets/edit.html.erb | 32 +++++++++++++-------------- app/views/assets/index.html.erb | 18 +++++++-------- app/views/assets/new.html.erb | 28 +++++++++++------------ app/views/assets/show.html.erb | 30 ++++++++++++------------- app/views/events/_rrule_builder.html.erb | 22 +++++++++--------- app/views/events/edit.html.erb | 38 ++++++++++++++++---------------- app/views/events/index.html.erb | 24 ++++++++++---------- app/views/events/new.html.erb | 30 ++++++++++++------------- app/views/events/show.html.erb | 32 +++++++++++++-------------- app/views/events/without_node.html.erb | 20 ++++++++--------- 10 files changed, 137 insertions(+), 137 deletions(-) (limited to 'app/views') diff --git a/app/views/assets/edit.html.erb b/app/views/assets/edit.html.erb index 46f8ed9f..5214e082 100644 --- a/app/views/assets/edit.html.erb +++ b/app/views/assets/edit.html.erb @@ -1,5 +1,5 @@
-

Editing asset

+

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

<%= form_for(@asset, html: { multipart: true }) do |f| %> <%= form_error_messages(f) %> @@ -9,56 +9,56 @@
<%= f.text_field :name %>
<% if @asset.upload.present? %> -
Current File
+
<%= t(".current_file") %>
<%= @asset.upload.url %> (<%= number_to_human_size(@asset.upload.size) %>)
<% end %> -
<%= f.label :upload, "Replace file" %>
+
<%= f.label :upload, t(".replace_file") %>
<%= f.file_field :upload %> -

…or drop a file here.

+

<%= t("assets.form.drop_hint") %>

<%= f.label :creator %>
<%= f.text_field :creator %>
-
<%= f.label :source_url, "Source URL" %>
+
<%= f.label :source_url %>
<%= f.text_field :source_url %>
-
<%= f.label :license_key, "License" %>
+
<%= f.label :license_key %>
<%= f.select :license_key, options_for_select( - [["— none —", ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, + [[t("assets.form.none_option"), ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, @asset.license_key ) %>
-
attach to page
+
<%= t("assets.form.attach_to_page") %>
<%= text_field_tag :asset_node_search_term, @attach_node&.title, - :placeholder => "Search for a page…", :autocomplete => "off" %> + :placeholder => t("assets.form.attach_search_placeholder"), :autocomplete => "off" %>
<%= hidden_field_tag :node_id, @attach_node&.id %> - Optional — attaches this asset to that page, all pending versions included. + <%= t("assets.form.attach_hint") %>
- - Applies only if the page has no headline yet. + + <%= t("assets.form.headline_hint") %>
-
Actions
+
<%= t("admin.columns.actions") %>
-
<%= f.submit 'Update' %>
-
<%= link_to 'Show', @asset %>
-
<%= link_to 'Back', assets_path %>
+
<%= f.submit t("admin.common.update") %>
+
<%= link_to t("admin.common.show"), @asset %>
+
<%= link_to t("admin.common.back"), assets_path %>
diff --git a/app/views/assets/index.html.erb b/app/views/assets/index.html.erb index ff1300a2..81d2686a 100644 --- a/app/views/assets/index.html.erb +++ b/app/views/assets/index.html.erb @@ -1,16 +1,16 @@ -

Assets

+

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

<%= link_to new_asset_path, class: 'action_button' do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create asset + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_asset") %> <% end %> <%= will_paginate @assets %> - - - + + + @@ -20,10 +20,10 @@ - - - + + <% end %> diff --git a/app/views/assets/new.html.erb b/app/views/assets/new.html.erb index 7bb8a9ce..51e66cd2 100644 --- a/app/views/assets/new.html.erb +++ b/app/views/assets/new.html.erb @@ -1,5 +1,5 @@
-

New asset

+

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

<%= form_for(@asset, :html => { :multipart => true }) do |f| %> <%= form_error_messages(f) %> @@ -8,51 +8,51 @@
<%= f.label :name %>
<%= f.text_field :name %>
-
<%= f.label :upload, "File" %>
+
<%= f.label :upload %>
<%= f.file_field :upload %> -

…or drop a file here.

+

<%= t("assets.form.drop_hint") %>

<%= f.label :creator %>
<%= f.text_field :creator %>
-
<%= f.label :source_url, "Source URL" %>
+
<%= f.label :source_url %>
<%= f.text_field :source_url %>
-
<%= f.label :license_key, "License" %>
+
<%= f.label :license_key %>
<%= f.select :license_key, options_for_select( - [["— none —", ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, + [[t("assets.form.none_option"), ""]] + AssetLicense.keys.map { |key| [t("asset_licenses.#{key}"), key] }, @asset.license_key ) %>
-
attach to page
+
<%= t("assets.form.attach_to_page") %>
<%= text_field_tag :asset_node_search_term, @attach_node&.title, - :placeholder => "Search for a page…", :autocomplete => "off" %> + :placeholder => t("assets.form.attach_search_placeholder"), :autocomplete => "off" %>
<%= hidden_field_tag :node_id, @attach_node&.id %> - Optional — attaches this asset to that page, all pending versions included. + <%= t("assets.form.attach_hint") %>
- - Applies only if the page has no headline yet. + + <%= t("assets.form.headline_hint") %>
-
Actions
+
<%= t("admin.columns.actions") %>
-
<%= f.submit 'Create' %>
-
<%= link_to 'Back', assets_path %>
+
<%= f.submit f.submit t("admin.common.create") %>
+
<%= link_to link_to t("admin.common.back"), assets_path %>
diff --git a/app/views/assets/show.html.erb b/app/views/assets/show.html.erb index 4ec77dff..f5a7e055 100644 --- a/app/views/assets/show.html.erb +++ b/app/views/assets/show.html.erb @@ -2,16 +2,16 @@

<%= @asset.name %>

-
Actions
+
<%= t("admin.columns.actions") %>
<%= link_to edit_asset_path(@asset), class: 'action_button' do %> - <%= icon("edit", library: "tabler", "aria-hidden": true) %> Edit + <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.edit") %> <% end %>
- <%= link_to 'Back', assets_path %> + <%= link_to link_to t("admin.common.back"), assets_path %>
<%= link_to admin_log_path(:asset_id => @asset.id), :class => "action_button" do %> <%= icon("history", library: "tabler", "aria-hidden": true) %> <%= t("node_actions.asset_history") %> @@ -20,11 +20,11 @@
<% if @asset.has_variant?(:medium) %> -
Thumbnail
+
<%= t(".thumbnail") %>
<%= image_tag @asset.upload.url(:medium), style: "max-width: 300px; max-height: 300px;" %>
<% end %> -
Attached to
+
<%= t(".attached_to") %>
<% nodes = @asset.attached_nodes %> <% if nodes.any? %> @@ -36,34 +36,34 @@ <%= icon("star", library: "tabler", "aria-hidden": true) %> <% end %> <% unless node.head && node.head.related_assets.exists?(:asset_id => @asset.id) %> - pending versions only + <%= t(".pending_only") %> <% end %> <% end %> <% else %> - — not attached to any page — + <%= t(".not_attached") %> <% end %> <%= link_to new_node_path(:asset_id => @asset.id), :class => "action_button" do %> - <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> New page with this attachment + <%= icon("file-plus", library: "tabler", "aria-hidden": true) %> <%= t(".new_page_with_attachment") %> <% end %>
-
Public Path
+
<%= t(".public_path") %>
<% public_path = @asset.upload.url.sub(/\?\d+$/, "") %> <%= link_to public_path, public_path, target: "_blank", rel: "noopener" %>
-
Creator
+
<%= t(".creator") %>
<%= @asset.creator.presence || "—" %>
-
Source
+
<%= t(".source") %>
<% if @asset.source_url.present? %> <%= link_to @asset.source_url, @asset.source_url %> @@ -72,7 +72,7 @@ <% end %>
-
License
+
<%= t(".license") %>
<% if (license = AssetLicense.find(@asset.license_key)) %> <%= t("asset_licenses.#{license.key}") %> @@ -81,10 +81,10 @@ <% end %>
-
Content Type
+
<%= t(".content_type") %>
<%= @asset.upload.content_type %>
-
Size
+
<%= t(".size") %>
<%= "#{@asset.upload.size/1024} KB" %>
diff --git a/app/views/events/_rrule_builder.html.erb b/app/views/events/_rrule_builder.html.erb index 1ffec0a2..3cffb782 100644 --- a/app/views/events/_rrule_builder.html.erb +++ b/app/views/events/_rrule_builder.html.erb @@ -1,33 +1,33 @@

- - + +

-

+

<% %w[MO TU WE TH FR SA SU].each do |code| %> - + <% end %>

- - <%= select_tag "rrule_excluded_month", options_for_select((1..12).map { |m| [RruleHumanizer::MONTH_NAMES[:de][m-1], m] }), style: "display: none;" %> + + <%= select_tag "rrule_excluded_month", options_for_select((1..12).map { |m| [RruleHumanizer::MONTH_NAMES[I18n.locale][m-1], m] }), style: "display: none;" %>

- Builds the field below automatically. If your pattern is more complex than this covers, just edit it directly below - these controls won't touch it unless you use them. + <%= t(".hint") %>
<%= f.text_field :rrule, id: "event_rrule" %> diff --git a/app/views/events/edit.html.erb b/app/views/events/edit.html.erb index 5d7f613e..f3bf5339 100644 --- a/app/views/events/edit.html.erb +++ b/app/views/events/edit.html.erb @@ -1,10 +1,10 @@ -

Editing event

+

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

- <%= link_to 'Back', safe_return_to(params[:return_to] || events_path) %> + <%= link_to t("admin.common.back"), safe_return_to(params[:return_to] || events_path) %> <%= button_to event_path(@event), method: :delete, - form: { data: { confirm: 'Delete this event?' }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy + form: { data: { confirm: t("events.confirm_delete") }, class: 'button_to destructive' } do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> <% end %>
@@ -14,58 +14,58 @@
-
Node
+
<%= Event.human_attribute_name(:node) %>
<% if @event.node %> <%= link_to @event.node.title, node_path(@event.node) %>
- Change node + <%= t(".change_node") %> <%= text_field_tag :event_node_search_term %>
- This will re-link the event to a different node — rarely needed. + <%= t(".change_node_hint") %>
<% else %> <%= text_field_tag :event_node_search_term %>
- Optional — search and pick a node to associate this event with a page. + <%= t("events.form.node_hint") %> <% end %> <%= f.hidden_field :node_id %>
-
Start time
+
<%= Event.human_attribute_name(:start_time) %>
<%= f.datetime_select :start_time %>
-
End time
+
<%= Event.human_attribute_name(:end_time) %>
<%= f.datetime_select :end_time %>
-
Recurrence
+
<%= t("events.form.recurrence") %>
<%= render "rrule_builder", f: f %>
-
Title
+
<%= Event.human_attribute_name(:title) %>
<%= f.text_field :title %> - Optional — if left blank, the associated node's title is used. + <%= t("events.form.title_hint") %>
-
Tags
+
<%= Event.human_attribute_name(:tags) %>
<%= f.text_field :tag_list %>
-
Allday
+
<%= Event.human_attribute_name(:allday) %>
<%= f.check_box :allday %>
-
Url
+
<%= Event.human_attribute_name(:url) %>
<%= f.text_field :url %>
-
Latitude
+
<%= Event.human_attribute_name(:latitude) %>
<%= f.text_field :latitude %>
-
Longitude
+
<%= Event.human_attribute_name(:longitude) %>
<%= f.text_field :longitude %>
-
<%= f.submit 'Update' %>
+
<%= f.submit t("admin.common.update") %>
<% end %> diff --git a/app/views/events/index.html.erb b/app/views/events/index.html.erb index dde897ee..138a02ec 100644 --- a/app/views/events/index.html.erb +++ b/app/views/events/index.html.erb @@ -1,23 +1,23 @@ -

Events

+

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

<%= link_to new_event_path, class: 'action_button' do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create event + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t(".create_event") %> <% end %> - <%= link_to 'View events without a page →', without_node_events_path %> + <%= link_to t(".without_page_link"), without_node_events_path %>
<%= will_paginate @events %>
PreviewNameType<%= t("admin.columns.preview") %><%= t("admin.columns.name") %><%= t("admin.columns.type") %> <% if asset.has_variant?(:thumb) %><%= image_tag asset.upload.url(:thumb), style: "max-width: 100px; max-height: 100px;" %><% end %> <%= link_to asset.name, asset.upload.url %> <%= asset.upload.content_type %><%= link_to 'Show', asset %><%= link_to 'Edit', edit_asset_path(asset) %><%= button_to asset, method: :delete, form: { data: { confirm: 'Are you sure?' }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy + <%= link_to t("admin.common.show"), asset %><%= link_to t("admin.common.edit"), edit_asset_path(asset) %><%= button_to asset, method: :delete, form: { data: { confirm: t("admin.common.confirm_sure") }, class: 'button_to destructive' } do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> <% end %>
- - - - - - - + + + + + + + @@ -27,14 +27,14 @@ - + - + <% end %>
TitleStart timeEnd timeRruleAlldayUrlNode<%= t("admin.columns.title") %><%= Event.human_attribute_name(:start_time) %><%= Event.human_attribute_name(:end_time) %><%= Event.human_attribute_name(:rrule) %><%= Event.human_attribute_name(:allday) %><%= Event.human_attribute_name(:url) %><%= Event.human_attribute_name(:start_node) %>
<%=h event.start_time %> <%=h event.end_time %> <%= rrule_with_break_opportunities(event.rrule) %><%=h event.allday %><%=h event.allday %> → <%= event.allday ? t("admin.common.yes") : t("admin.common.no") %> <% if event.url.present? %> <%= link_to event.url, event.url %> <% end %> <%= event.node ? link_to(event.node_id, node_path(event.node)) : '' %><%= link_to 'edit', edit_event_path(event) %><%= link_to t(".edit_link"), edit_event_path(event) %>
diff --git a/app/views/events/new.html.erb b/app/views/events/new.html.erb index 6472f207..3eaf7e7d 100644 --- a/app/views/events/new.html.erb +++ b/app/views/events/new.html.erb @@ -1,55 +1,55 @@ -

New event

+

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

-<%= link_to 'Back', safe_return_to(params[:return_to] || events_path) %> +<%= link_to t("admin.common.back"), safe_return_to(params[:return_to] || events_path) %> <%= form_for(@event) do |f| %> <%= form_error_messages(f) %>
-
Node
+
<%= Event.human_attribute_name(:node) %>
<%= text_field_tag :event_node_search_term %>
<%= f.hidden_field :node_id %> - Optional — search and pick a node to associate this event with a page. + <%= t("events.form.node_hint") %>
-
Start time
+
<%= Event.human_attribute_name(:start_time) %>
<%= f.datetime_select :start_time %>
-
End time
+
<%= Event.human_attribute_name(:end_time) %>
<%= f.datetime_select :end_time %>
-
Recurrence
+
<%= t("events.form.recurrence") %>
<%= render "rrule_builder", f: f %>
-
Title
+
<%= Event.human_attribute_name(:title) %>
<%= f.text_field :title %> - Optional — if left blank, the associated node's title is used. + <%= t("events.form.title_hint") %>
-
Tags
+
<%= Event.human_attribute_name(:tag_list) %>
<%= f.text_field :tag_list %>
-
Allday
+
<%= Event.human_attribute_name(:allday) %>
<%= f.check_box :allday %>
-
Url
+
<%= Event.human_attribute_name(:url) %>
<%= f.text_field :url %>
-
Latitude
+
<%= Event.human_attribute_name(:latitude) %>
<%= f.text_field :latitude %>
-
Longitude
+
<%= Event.human_attribute_name(:longitude) %>
<%= f.text_field :longitude %>
<%= hidden_field_tag :return_to, params[:return_to] %>
-
<%= f.submit 'Create' %>
+
<%= f.submit t("admin.common.create") %>
<% end %> diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index 0bf14e8b..98e972c6 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -1,55 +1,55 @@
-

<%= @event.node ? "Event for node #{@event.node.unique_name}" : "Event" %>

+

<%= @event.node ? t(".title_for_node", :path => @event.node.unique_name) : t(".title") %>

-
Actions
+
<%= t("admin.columns.actions") %>
<% if @event.node %>
- <%= link_to 'Node', node_path(@event.node) %> + <%= link_to t(".node_link"), node_path(@event.node) %>
<% end %>
<%= link_to edit_event_path(@event, return_to: request.path), class: 'action_button' do %> - <%= icon("edit", library: "tabler", "aria-hidden": true) %> Edit + <%= icon("edit", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.edit") %> <% end %>
- <%= button_to event_path(@event), method: :delete, form: { data: { confirm: 'Delete this event?' }, class: 'button_to destructive' } do %> - <%= icon("trash", library: "tabler", "aria-hidden": true) %> Destroy + <%= button_to event_path(@event), method: :delete, form: { data: { confirm: t("events.confirm_delete") }, class: 'button_to destructive' } do %> + <%= icon("trash", library: "tabler", "aria-hidden": true) %> <%= t("admin.common.destroy") %> <% end %>
-
Start time
+
<%= Event.human_attribute_name(:start_time) %>
<%=h @event.start_time %>
-
End time
+
<%= Event.human_attribute_name(:end_time) %>
<%=h @event.end_time %>
-
Rrule
+
<%= Event.human_attribute_name(:rrule) %>
<%=h @event.rrule %>
<% if (human = @event.humanize_rrule(I18n.locale)) %> -
Recurrence
+
<%= t(".recurrence") %>
<%= human %>
<% end %> -
Tags
+
<%= Event.human_attribute_name(:tag_list) %>
<%=h @event.tag_list %>
-
Allday
-
<%=h @event.allday %>
+
<%= Event.human_attribute_name(:allday) %>
+
<%= @event.allday ? t("admin.common.yes") : t("admin.common.no") %>
-
Url
+
<%= Event.human_attribute_name(:url) %>
<%=h @event.url %>
-
Latitude
+
<%= Event.human_attribute_name(:latitude) %>
<%=h @event.latitude %>
-
Longitude
+
<%= Event.human_attribute_name(:longitude) %>
<%=h @event.longitude %>
diff --git a/app/views/events/without_node.html.erb b/app/views/events/without_node.html.erb index bb27173b..c610b560 100644 --- a/app/views/events/without_node.html.erb +++ b/app/views/events/without_node.html.erb @@ -1,19 +1,19 @@ -

Events without a node

+

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

-<%= link_to '← All events', events_path %> +<%= link_to t(".all_events_link"), events_path %> <%= link_to new_event_path, class: 'action_button' do %> - <%= icon("plus", library: "tabler", "aria-hidden": true) %> Create event + <%= icon("plus", library: "tabler", "aria-hidden": true) %> <%= t("events.index.create_event") %> <% end %> <%= will_paginate @events %> - - - - - + + + + + @@ -22,9 +22,9 @@ - + - + <% end %>
TitleStart timeEnd timeAlldayUrl<%= t("admin.columns.title") %><%= Event.human_attribute_name(:start_time) %><%= Event.human_attribute_name(:end_time) %><%= Event.human_attribute_name(:allday) %><%= Event.human_attribute_name(:url) %>
<%= link_to event.display_title, event %> <%=h event.start_time %> <%=h event.end_time %><%=h event.allday %><%=h event.allday %> → <%= event.allday ? t("admin.common.yes") : t("admin.common.no") %> <%=h event.url %><%= link_to 'edit', edit_event_path(event) %><%= link_to t("events.index.edit_link"), edit_event_path(event) %>
-- cgit v1.3