Bug 769471 - Variables to be checked for consistency
Variables to be checked for consistency
Status: CLOSED CURRENTRELEASE
Product: Zanata
Classification: Community
Component: Component-UI (Show other bugs)
1.5
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Alex Eng
Ding-Yi Chen
: UserStory
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2012-04-23 00:33:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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.

http://translate.sourceforge.net/wiki/toolkit/pofilter_tests#variables
http://translate.sourceforge.net/wiki/toolkit/pofilter

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:

gedit:
=====

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"


gconf:
=====

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

See
https://github.com/zanata/zanata/commit/f8eaaa0666357c6fe284d6cf4618650ec3513fc0
https://github.com/zanata/zanata/compare/e69ee68374a74eac8535980bc7dd833ba7795b83...030653ed8063238147f95b7219d0838f75150194

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