Repository navigation
Add ICU-aware parameter completion and inspections for translations - #2918
Merged
Haehnchen merged 1 commit intoNov 13, 2026
Merged
Conversation
Completing `parameters` keys for messages from `+intl-icu` files (Twig `|trans`, `|transchoice`, `|trans_html`, PHP `trans()`, `TranslatableMessage`, `t()`) now suggests the ICU argument names with their type (`number`, `date` or `string`) and the options of a `select`, instead of broken entries like `{sum, number}`. Unquoted Twig keys such as `{total: …}` are completed too.
New weak-warning inspections in PHP and Twig report a parameter that matches no argument of the message in any locale. They stay silent when the message is not ICU, has a syntax error, or the key or domain is not a literal.
Messages are read with a small parser that follows ICU4J's MessageFormat grammar, because ICU4J is not bundled in every IDE (it is missing from PhpStorm 2026.3).
Owner
|
👍 |
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.
Completing
parameterskeys for messages from+intl-icufiles (Twig|trans,|transchoice,|trans_html, PHPtrans(),TranslatableMessage,t()) now suggests the ICU argument names with their type (number,dateorstring) and the options of aselect, instead of broken entries like{sum, number}. Unquoted Twig keys such as{total: …}are completed too.New weak-warning inspections in PHP and Twig report a parameter that matches no argument of the message in any locale. They stay silent when the message is not ICU, has a syntax error, or the key or domain is not a literal.
Messages are read with a small parser that follows ICU4J's MessageFormat grammar, because ICU4J is not bundled in every IDE (it is missing from PhpStorm 2026.3).
Given

home.oss.project_aria_label: '{sum, number} contributions on {label}: {reviews, number} reviews, {prs, number} pull requests'translation: