Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed unused translations in changesets namespace #5223

Conversation

nenad-vujicic
Copy link
Contributor

PR makes following changes:

  1. Updates i18n-tasks.yml to ignore unused translations for keys from changesets.paging_nav.* (because they are used in pagination mechanism using string interpolation),
  2. Pulls out ?: operator from t() in changesets/show.html.erb so changesets.show.{comment_by_html, hidden_comment_by_html} translation keys are no longer reported as unused and
  3. Removes unused translation keys changesets.{changeset.anonymous, no_such_entry.title} from en.yml because .anonymous was added in fddda4e and was stopped being used in 3e305fb and .title was added in f0764d3 but never used.

@@ -40,9 +40,10 @@
<% next unless comment.visible || current_user&.moderator? %>
<li id="c<%= comment.id %>">
<small class='text-body-secondary'>
<%= t comment.visible ? ".comment_by_html" : ".hidden_comment_by_html",
<% comment_info = comment.visible ? "comment_by_html" : "hidden_comment_by_html" %>
<%= t(".#{comment_info}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like once you do t ".#{comment_info}" i18n-tasks stops reporting changesets.show.-anything as missing.

You could have inserted this line with the same effect:

<% t ".#{'shut up'}" %>

@@ -132,6 +132,7 @@ ignore_unused:
- 'reports.new.categories.*' # double interpolation in reports_helper
- 'shared.pagination.*'
- 'auth.providers.*'
- 'changesets.paging_nav.*' # used by string interpolation in elements pagination
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't be required if #4872 is merged, although it uses the same effect as in https://github.com/openstreetmap/openstreetmap-website/pull/5223/files#r1766713701 to some extent.

@nenad-vujicic nenad-vujicic marked this pull request as draft September 19, 2024 12:41
Removed unused translation keys changesets.{changeset.anonymous, no_such_entry.title} from en.yml. .anonymous was added in fddda4e and was stopped being used in 3e305fb. .title was added in f0764d3 but never used.
@nenad-vujicic nenad-vujicic force-pushed the issue_fix_unused_translations_in_changesets branch from 306d398 to 3f27dc3 Compare September 19, 2024 21:32
@nenad-vujicic
Copy link
Contributor Author

Thanks, I've just made following updates:

  1. Removed 1 in favor of Don't use ?: in "Comment from user" changeset discussion strings #5225
  2. Removed 2 in favor of Show changeset element counts using badges #4872
  3. Rebased

@nenad-vujicic nenad-vujicic marked this pull request as ready for review September 19, 2024 22:52
@tomhughes tomhughes merged commit d711d3c into openstreetmap:master Sep 20, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants