fix(i18n): resolve translation warnings in make-pot#4323
Open
faisalahammad wants to merge 1 commit into
Open
Conversation
- Unify translator comments for %1 and %2 in feature control.js - Add translator comment for Page %d in pagination.js - Improve translator comments for %d placeholders in synonyms settings Fixes 10up#4313
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Running
wp i18n make-potproduced two warnings in the JS files: one duplicate translator comment on the string%1$s and %2$sand one missing translator comment onPage %d. This change unifies the comments and adds the missing ones so the POT file builds cleanly.Fixes #4313
Changes
assets/js/features/components/control.jsBefore:
After:
Why: The same string literal had two different translator comments, which triggers a make-pot warning. A single comment describing both placeholders works for both call sites.
assets/js/instant-results/components/results/pagination.jsBefore:
After:
Why:
%dneeds a translator comment to explain it is the page number.assets/js/synonyms/apps/synonyms-settings.jsBefore:
After:
Why: The
%dplaceholder is clearer for translators when the comment references it directly. Same change applied to hyponyms and replacements tabs.Testing
Test 1: Generate POT file
wp i18n make-pot . lang/elasticpress.pot.Result: No warnings. POT file builds successfully.
Screenshots
Before:

After:
