[3.0] Fall back when a language string is missing - #9398
Merged
Sesquipedalian merged 1 commit intoAug 14, 2026
Merged
Conversation
Lang::getTxt() returns an empty string for a key it cannot find, never null, so ?? never fires after it. Six calls pair it with a fallback that therefore cannot be reached, and take the empty string instead. Eight of the twenty two smileys SMF ships are affected: the tooltip is looked up as icon_ plus the lowercased description, and the descriptions "Huh?", "Roll Eyes" and "Lips Sealed" do not match the keys icon_huh, icon_rolleyes and icon_lips, while Evil, Azn, Afro, Police and Angel have no icon_ string at all. Their buttons in the editor's emoticon drop-down carry an empty tooltip rather than the smiley's own description. Any smiley an admin adds has the same problem, since nothing writes an icon_ string for it. The others are a theme variant or colour mode with no translated name, which loses its name rather than falling back to the identifier, and the installer and upgrader emitting <meta charset=""> because lang_character_set is not a 3.0 string at all. Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This was referenced Aug 8, 2026
Closed
Sesquipedalian
approved these changes
Aug 14, 2026
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
Lang::getTxt()returns''for a key it cannot find — nevernull:So
??never fires after it. Six calls pairgetTxt()with a fallback that cannot be reached, and take the empty string instead.?:is what was meant.The smiley tooltips are the visible one
Sources/Editor.phplooks a tooltip up asicon_plus the lowercased description, and falls back to the description. Eight of the twenty two smileys SMF ships have no matching key, so eight buttons in the editor's emoticon drop-down carry an empty tooltip:General.phpicon_huh?icon_huhicon_roll eyesicon_rolleyesicon_lips sealedicon_lipsicon_evil, …Straight off the reply page on a stock install, before and after:
Any smiley an admin adds through Admin → Smileys has the same problem, since nothing writes an
icon_string for it — that is the case the fallback exists for.The rest
Actions/Admin/Themes.phpandActions/Profile/ThemeOptions.php, ×2 each: a theme variant or colour mode with no translated name loses its name entirely instead of falling back to its identifier. Not reachable on a stock install, since the default theme sets neithertheme_variantsnorhas_dark_mode.Themes/default/MaintenanceTemplate.php: the installer and upgrader emit<meta charset="">, becauselang_character_setis not a 3.0 string at all.index.template.phpwritesUTF-8literally; I kept the fallback rather than hard-coding it, sinceActions/Admin/Languages.phpstill treatslang_character_setas an editable setting for older language packs.I left the two
getTxt(…) ?? ''inParser.phpandUnicode/Utf8String.phpalone — they are the same mistake, but the fallback and the actual result are both'', so changing them would be noise.Found while splitting #7933; not part of the theme, so it goes straight to
release-3.0. Related to #9397, which fixes the calls that name the wrong language file — same sweep, different defect.Issues References (Fixes|Related|Closes)
Related to #7933