Bug 891166

Summary: localization fails for strings with parameters
Product: [Community] Publican Reporter: Ruediger Landmann <r.landmann>
Component: publicanAssignee: Jeff Fearn <jfearn>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.0CC: rglasz, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.1.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-12 01:01:54 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Ruediger Landmann 2013-01-02 01:02:57 EST
Description of problem:

The update_po action adds an entry to the target languages' Revision_History.xml files: "Translation files synchronised with XML sources <revnumber>"

This entry is added in the language set for the shell in which the command was run, not in the target language. When translators are working on a system on which the locale is set to something other than the language in which they work, the Revision_History.xml file is updated with text in a language different from that of the rest of the book.

Version-Release number of selected component (if applicable):
3.0

How reproducible:
100%

Steps to Reproduce:
1. run publican update_pot on a book
2. run publican update_po --langs and specify a language different from the locale of the shell in which you ran the command
3. look at the contents of <lang>/Revision_History.xml 
  
Actual results:
<lang>/Revision_History.xml contains an entry in the language of the shell locale

Expected results:
<lang>/Revision_History.xml should contain an entry in the target language

Additional info:
Comment 1 Ruediger Landmann 2013-03-06 22:30:20 EST
Actually, I'm mistaken; the "Translation files synchronised with XML sources <revnumber>" entry appears in English regardless of the terminal language:

Given:

$ echo $LANG
it_IT.utf8

the output from:

$ publican update_pot
$ publican update_po --langs it-IT

is still:

<revdescription>
					<simplelist>
						<member>Translation files synchronised with XML sources 8-4</member>
					</simplelist>
				</revdescription>
Comment 2 Jeff Fearn 2013-03-07 22:26:02 EST
This is actually wider that this example.  ALl strings wich contain parameters are not being translated.

e.g.

This works:

maketext("this is a simple string");

This fails:

maketext("this is a string with a parameter [_1]", $variable);

Appears to be a bug in perl-Locale-Maketext-Gettext which does not handle the mo file containing strings with gettext style '%1' instead of maketext style '[_1]'.
Comment 3 Jeff Fearn 2013-03-12 01:01:54 EDT
Hot fix 3.1.4 has been released with a fix for this issue.