Bug 769471 - Variables to be checked for consistency
Variables to be checked for consistency
Product: Zanata
Classification: Community
Component: Component-UI (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Alex Eng
Ding-Yi Chen
: UserStory
Depends On:
  Show dependency treegraph
Reported: 2011-12-20 18:15 EST by Alex Eng
Modified: 2012-04-23 00:33 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-23 00:33:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Alex Eng 2011-12-20 18:15:26 EST
Variables like %s or %d are included in strings and any discrepancy in them may generate an error for the translation. Common errors include mismatch in their number or if these are translated.


This will include a number of different validation checks that can be enabled independently for different source document types.

NB Python printf  (checked for order) and Java MessageFormat only

Examples of some strings with variables:


msgid "Loading %d file…"
msgid_plural "Loading %d files…"
msgstr[0] ""
msgstr[1] ""

msgid "Loading file '%s'…"

msgid "Changes made to the document in the last hour and %d minute will be  permanently lost."

msgid "Found and replaced %d occurrences"


msgid "Root node of '%s' must be <evoldap>, not <%s>"

msgid "Contacting LDAP server: host '%s', port '%d', base DN '%s'"

msgid "Error saving GConf tree to '%s': %s\n"

msgid "Failed to give up lock on XML directory \"%s\": %s"

msgid "Could not stat `%s': %s"
Comment 1 Alex Eng 2012-01-02 17:10:14 EST
Implementation should detect any variables that starts with % follow by variable name.
Comment 2 Alex Eng 2012-01-02 18:06:49 EST
Implemented in 1.5 branch. See https://github.com/zanata/zanata/commit/942b44ce93e958e02afe03bd0e4b31cd95b91a1b
Comment 4 David Mason 2012-01-19 02:39:08 EST
 - updated to use localisable message strings
 - updated printf matching regex to match most standard variable patterns


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