Skip to content

Fix the page placeholder in the Croatian info_tag.no_count - #937

Merged
ddnexus merged 1 commit into
ddnexus:devfrom
ChandraChaan:fix/hr-placeholder-pr
Nov 6, 2026
Merged

ddnexus merged 1 commit into
ddnexus:devfrom
ChandraChaan:fix/hr-placeholder-pr

Conversation

@ChandraChaan

Copy link
Copy Markdown
Contributor

In gem/locales/hr.yml, info_tag.no_count uses %{page_input}:

no_count: "Stranica %{page_input} od %{pages}"

info_tag only passes page and pages for that key (en.yml has "Page %{page} of %{pages}"), and %{page_input} belongs to input_nav_js. Pagy's i18n leaves unknown placeholders in place, so the Croatian text renders with a literal %{page_input}. This changes it to %{page}.

I also added a test to locales_test.rb that checks, for every locale file, that info_tag.no_count only uses the placeholders it is given. It fails only for hr.yml.

I couldn't run Ruby locally, so I ran the checks on a fork:

  • Test only, without the fix: API Test fails on Ruby 3.3, 3.4 and 4.0 with locales::locale file hr.yml#test_0002_uses only the placeholders that info_tag.no_count is given and Expected ["page_input"] to be empty.
  • Test with the fix: API Test passes on all three Rubies, including Rubocop and the 100% coverage check (648 tests, 1859 assertions, 0 failures).

The commit in this PR is the squashed form of the fix branch (identical tree). It is based on master as CONTRIBUTING.md asks; I saw recent PRs end up on dev, so please retarget it if that is where it belongs.

@ddnexus
ddnexus changed the base branch from master to dev November 6, 2026 05:11
hr.yml used %{page_input} in info_tag.no_count, but info_tag only
passes page and pages for that key (as the other locales' %{page}
shows), so the Croatian text rendered with the literal "%{page_input}".

Use %{page}, and add a locales test that checks info_tag.no_count only
uses the placeholders it is given.
@ddnexus
ddnexus force-pushed the fix/hr-placeholder-pr branch from 36cc2e5 to 3f12bee Compare November 6, 2026 05:12
@ddnexus
ddnexus merged commit aad5376 into ddnexus:dev Nov 6, 2026
3 checks passed
@ddnexus

ddnexus commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thank you @ChandraChaan for spotting this and for the careful write-up: Croatian was indeed rendering the raw placeholder. Merged on dev, it will be in the next release.

Your test will be followed on dev by a general one, which checks the placeholders of every key of every locale against the en dictionary, so the same mistake cannot slip into any other key.

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.

2 participants