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/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 ++++++++--------- 6 files changed, 83 insertions(+), 83 deletions(-) (limited to 'app/views/events') 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 %> - - - - - - - + + + + + + + @@ -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