View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0036832 | mantisbt | administration | public | 2026-01-21 11:35 | 2026-02-08 22:46 |
| Reporter | raspopov | Assigned To | dregad | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 2.28.0 | ||||
| Target Version | 2.29.0 | Fixed in Version | 2.29.0 | ||
| Summary | 0036832: Strict verification of parameters in translation strings is required | ||||
| Description | MantisBT uses language strings that may contain parameters, such as "%1$s." These parameters may be set incorrectly in translated languages, resulting in PHP errors when attempting to display them. It is quite difficult for translators to check for such errors. | ||||
| Additional Information | Strict verification of translation files on the | ||||
| Tags | No tags attached. | ||||
|
Thanks for your contribution. I have reviewed the PR. |
|
|
@raspopov despite my earlier comment, I ended up implementing a check for invalid placeholders in English language strings after all, as I made a stupid typo when "fixing" the 2 invalid strings detected by your improved test_langs,php. |
|
|
Yes, let a digital computer check for errors, not an analog human being. :-) |
|
|
MantisBT: master 81dd07f9 2026-01-21 11:41 Committer: dregad Details Diff |
Add translations strict validation - Added the argument format check - Added the argument count and type check - Added missed translation check - Added direct links to translations Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master c13d3825 2026-01-23 09:33 Committer: dregad Details Diff |
Make checks optional Added a line with links for selecting options, just like in the "Check Installation" section. Also optimized retrieval of language code from global variable $g_language_auto_map in a PHP-way. Added page title. Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master 59c7b943 2026-01-23 10:08 Committer: dregad Details Diff |
Simplify regexp Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master 518baeb7 2026-01-24 09:44 Committer: dregad Details Diff |
Add detection of translations driven by TranslateWiki Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master cca6447c 2026-01-27 10:52 Committer: dregad Details Diff |
Add argument number and order validation The code is consolidated in two new functions: checkInvalidArgs() and checkUntranslated(). Optimized checkInvalidTags() function, enabled the target="_blank" attribute of the <a> tag found in some plugins. Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master 937c3212 2026-02-07 17:40 Details Diff |
Don't link English strings to translatewiki.net It's the base language, so there's no translation to fix there. Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master b871d674 2026-02-07 17:50 Details Diff |
Change test_langs.php's page title Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
| mod - core/html_api.php | Diff File | ||
|
MantisBT: master 6440da97 2026-02-07 17:54 Details Diff |
Fix errors in language strings Detected via the improved test_langs.php script from issue 0036832 |
Affected Issues 0036832 |
|
| mod - lang/strings_english.txt | Diff File | ||
| mod - plugins/MantisCoreFormatting/lang/strings_english.txt | Diff File | ||
|
MantisBT: master 2c0deb6c 2026-02-08 11:05 Details Diff |
Improve English language string errors detection Run the strings through sprintf(), capture any errors and report them to the user. Fixes 0036832 |
Affected Issues 0036832 |
|
| mod - admin/test_langs.php | Diff File | ||
|
MantisBT: master b8fddb37 2026-02-08 11:07 Details Diff |
Fix errors in language strings (take 2) Follow-up on 6440da975fc9bfccdcd0c61885f71db4c6873207, I made a silly typo when updating the placeholder: `%$2d` instead of `%2$d`. Thanks @siebrand for catching it ! Issue 0036832 |
Affected Issues 0036832 |
|
| mod - lang/strings_english.txt | Diff File | ||
| mod - plugins/MantisCoreFormatting/lang/strings_english.txt | Diff File | ||