[3.0] Give these strings the named arguments they ask for - #9408
Open
albertlast wants to merge 1 commit into
Open
[3.0] Give these strings the named arguments they ask for#9408albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
A getTxt() call passes either a positional list or a named map, and the
string decides which is right: {0} wants a list, {name} wants a map. Five
calls pass a list to a string with named placeholders, so nothing is
substituted and the placeholder is printed as is.
Move a board and every destination in the list reads the same:
Before {name} instead of Before General Discussion
After {name} After General Discussion
Sub-board of {name} Sub-board of General Discussion
The same file already gets this right a hundred lines further down, in
mboards_order_after for the board order drop down, which passes
['name' => $tree->name].
The other two are the error log's description, which tells you to "click the
{remove} button", and the ban notice, which says a ban expires {datetime}.
Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 8, 2026
Closed
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.
Description
A
Lang::getTxt()call passes either a positional list or a named map, and the string decides which is right:{0}wants a list,{name}wants a map. Five calls pass a list to a string with named placeholders, so nothing is substituted and the placeholder is printed as written.Moving a board is the worst of them
Every destination in the list reads the same, so there is no way to tell them apart. Admin → Boards → Move, before and after:
Four calls in
Actions/Admin/Boards.phpare affected. The same file already gets it right about a hundred lines further down, for the board order drop-down:The other two
Actions/Admin/Logs.php— the error log's own description tells you to "click the {remove} button at the bottom of the page".Languages/en_US/Admin.phpeven carries a translator note above the string: "Do not translate '{remove}'. It will be automatically replaced with the value of $txt['remove']." It was not being replaced. Now reads "click the Remove button".Sources/User.php— the ban notice says "This ban is set to expire {datetime}." By inspection; I did not stage a ban with an expiry to watch it.How these were found
A sweep matching each
getTxt('key', [ … ])call against the placeholders in the string it names, and comparing the shape of the literal array — top-level=>or not — against whether the string wants named or positional arguments. Eight hits, three of them false:ordinal_spelloutandguest_plural(twice) are ICUselectordinal/pluralpatterns whose branch bodies (=1 {first},one {guest}) look like placeholders to a regex but are not.This is the same family as #9400, where an ICU plural argument was given HTML and read as zero. If the unimported-class sweep offered in #9395 is of interest as a CI step, this one and the language-file sweep in #9397 belong with it — none of the three is visible to
phplintorphp-cs-fixer, and all three fail silently.Issues References (Fixes|Related|Closes)
Related to #7933