Skip to content

Commit

Permalink
Prefer Rails built-in t helper over ts
Browse files Browse the repository at this point in the history
  • Loading branch information
metallicity committed Jan 18, 2025
1 parent 7adab14 commit bbe047d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
28 changes: 14 additions & 14 deletions app/views/tags/_search_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
<fieldset>
<dl>
<dt>
<%= f.label :name, ts("Tag name") %>
<%= f.label :name, t(".tag_name") %>
<%= link_to_help "tag-search-text-help" %>
</dt>
<dd>
<%= f.text_field :name %>
</dd>
<dt>
<%= f.label :fandoms, ts("Fandoms") %>
<%= f.label :fandoms, t(".fandoms") %>
</dt>
<dd>
<%= f.text_field :fandoms, autocomplete_options("fandom", "aria-describedby" => "fandom-field-description") %>
<p class="footnote" id="fandom-field-description">
<%= ts("Find tags wrangled to specific canonical fandoms.") %>
<%= t(".fandoms_footnote") %>
</p>
</dd>
<dt><%= ts("Type") %></dt>
<dt><%= t(".type") %></dt>
<dd>
<fieldset>
<ul>
Expand All @@ -35,51 +35,51 @@
</ul>
</fieldset>
</dd>
<dt><%= ts("Wrangling status") %></dt>
<dt><%= t(".wrangling_status") %></dt>
<dd>
<fieldset>
<ul>
<li>
<%= f.radio_button :wrangling_status, "canonical" %>
<%= f.label :wrangling_status, ts("Canonical"), value: "canonical" %>
<%= f.label :wrangling_status, t(".status_option.canonical"), value: "canonical" %>
</li>
<li>
<%= f.radio_button :wrangling_status, "noncanonical" %>
<%= f.label :wrangling_status, ts("Non-canonical"), value: "noncanonical" %>
<%= f.label :wrangling_status, t(".status_option.noncanonical"), value: "noncanonical" %>
</li>
<li>
<%= f.radio_button :wrangling_status, "synonymous" %>
<%= f.label :wrangling_status, ts("Synonymous"), value: "synonymous" %>
<%= f.label :wrangling_status, t(".status_option.synonymous"), value: "synonymous" %>
</li>
<li>
<%= f.radio_button :wrangling_status, "canonical_synonymous" %>
<%= f.label :wrangling_status, ts("Canonical or synonymous"), value: "canonical_synonymous" %>
<%= f.label :wrangling_status, t(".status_option.canonical_or_synonymous"), value: "canonical_synonymous" %>
</li>
<li>
<%= f.radio_button :wrangling_status, "noncanonical_nonsynonymous" %>
<%= f.label :wrangling_status, ts("Non-canonical and non-synonymous"), value: "noncanonical_nonsynonymous" %>
<%= f.label :wrangling_status, t(".status_option.noncanonical_and_nonsynonymous"), value: "noncanonical_nonsynonymous" %>
</li>
<li>
<%= f.radio_button :wrangling_status, "" %>
<%= f.label :wrangling_status, ts("Any status"), value: "" %>
<%= f.label :wrangling_status, t(".status_option.any_status"), value: "" %>
</li>
</ul>
</fieldset>
</dd>
<dt>
<%= f.label :sort_column, ts("Sort by") %>
<%= f.label :sort_column, t(".sort_by") %>
</dt>
<dd>
<%= f.select :sort_column, options_for_select(@search.sort_options, @search.sort_column) %>
</dd>
<dt>
<%= f.label :sort_direction, ts("Sort direction") %>
<%= f.label :sort_direction, t(".sort_direction") %>
</dt>
<dd>
<%= f.select :sort_direction,
options_for_select([["Ascending", "asc"], ["Descending", "desc"]], @search.sort_direction) %>
</dd>
</dl>
<p class="submit actions"><%= f.submit ts("Search Tags") %></p>
<p class="submit actions"><%= f.submit t(".search_tags") %></p>
</fieldset>
<% end %>
16 changes: 16 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,22 @@ en:
filter_bookmarks: filter bookmarks
filter_works: filter works
list_fandom_tags_html: You can also access a list of %{fandom_relationship_tags_link}.
search_form:
tag_name: Tag name
fandoms: Fandoms
fandoms_footnote: Find tags wrangled to specific canonical fandoms.
type: Type
wrangling_status: Wrangling status
status_option:
canonical: Canonical
noncanonical: Non-canonical
synonymous: Synonymous
canonical_or_synonymous: Canonical or synonymous
noncanonical_and_nonsynonymous: Non-canonical and non-synonymous
any_status: Any status
sort_by: Sort by
sort_direction: Sort direction
search_tags: Search Tags
time:
formats:
date_short_html: <abbr class="day" title="%A">%a</abbr> <span class="date">%d</span> <abbr class="month" title="%B">%b</abbr> <span class="year">%Y</span>
Expand Down

0 comments on commit bbe047d

Please sign in to comment.