Last modified: 2010-09-15 08:44:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 24064 - Translate extension should warn translators about common printf formatting errors
Translate extension should warn translators about common printf formatting er...
Product: MediaWiki extensions
Classification: Unclassified
Translate (Other open bugs)
All All
: Normal enhancement (vote)
: ---
Assigned To: Niklas Laxström
Depends on:
  Show dependency treegraph
Reported: 2010-06-21 15:47 UTC by Brion Vibber
Modified: 2010-09-15 08:44 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Brion Vibber 2010-06-21 15:47:50 UTC
It's not uncommon for translators to accidentally drop some printf-style formatting characters from strings, particularly things like ordered parameters:

en "1$s's status on 2$s"

ja "%2$s における %1$ のステータス"

Here, the 's' string specifier got dropped by mistake. This should be fairly easy to detect: make sure we have the same number of params and that we're not missing any explicitly-numbered ones. We could highlight the suspicious parts and prompt the translator to correct it or accept anyway.

Since this particular check is applicable only to programs using printf-style formatting from their strings, it could perhaps be applied only when using gettext (which usually is paired with lots of sprintf fun)
Comment 1 Niklas Laxström 2010-09-11 16:28:27 UTC
I'm not familiar with positional formatting characters. What is the meaning of each letter in %2$s for example? Can there be something else in their place or in addition to?
Comment 2 Siebrand Mazeland 2010-09-12 07:57:58 UTC
%2%s is the second parameter for a message; it's similar to $2 in MediaWiki messages. %2$s can be replaced by %s only. There's also %[n$]d for integers. Basically the gettext products need a Checker for this parameter type.

Note You need to log in before you can comment on or make changes to this bug.