ubuntu-developer-manual team mailing list archive
-
ubuntu-developer-manual team
-
Mailing list archive
-
Message #00136
Re: language issue: "fr_CA" (French Canada) doesn't work
I have put together a fix for this and will commit it.
The Problem:
If a translation is inserted into a tex file that contains a latex special
character that is not escaped with a preceding backslash, xelatex cannot convert
the tex file into a pdf and the make fails to complete.
Currently, to produce all localized PDFs, we rely on three pieces:
* LINGUAS file to list target locales
* po file for target locale must be present
* ./lang_pdfs script to iterate through valid target locales and for each run
"make langpdf LANG=<target>", thus producing localized pdfs for each valid lingua
As noted, the current method dies when unescaped special chars are present.
The Solution:
* I've written a python script that checks each valid po file (that is in
LINGUAS and is present) for such unescaped special chars in the translations
(the msgstr fields)
* if it finds any, it reports them to stdout and returns with exit status 1
* lang_pdfs script now runs the python script first and if errors are found,
doesn't proceed with the localized builds and errors are reported to stdout.
So this enables us to identify errors automatically before localized building.
Will push to trunk soon.
Cheers,
Kyle
On 01/06/2011 10:18 AM, Kyle Nitzsche wrote:
Yes, underscore is a special character requiring escaping by this doc
toolchain. from the ubuntu-manual style-guide:
"
Special characters. There are a few characters that LATEX considers special
(used for its own syntax). To typeset these characters, precede the character
with a backslash (\). The special characters are:
$
%
_
{
}
&
#
"
The consequence is that unless post processing is done to check & fix po files
exported from LP for these special characters, we may have build failures
since I don't think Ubuntu Translators are aware that these special characters
are not allowed in translations.
Cheers,
Kyle
On 01/06/2011 10:10 AM, Kyle Nitzsche wrote:
Moving right along, it is xelatex (which creates the pdf) that is dying on
unescaped underscores which can be inserted by applying po files
I'm drilling in.
cheers,
Kyle
On 01/06/2011 09:35 AM, Kyle Nitzsche wrote:
I was not quite correct about this
It turns out that I can add fr_CA (French Canada (which is not defined in
the .cls file) and pt_BR (which is).
However, building a pdf fails when I inserted those codes into a po file's
msgstr, for example like this:
msgid "Introduction to Launchpad"
msgstr "fr_CA: Intro"
The underscore has to be escaped, like this, and all is well:
msgid "Introduction to Launchpad"
msgstr "fr\\_CA: Intro"
I have never encountered the requirement that underscores be escaped in po
translations before and wonder if this is an artifact of po4a. I also wonder
whether translations done through the normal LP & Ubuntu Translators process
will potentially break this. I will determine these answers.
Cheers,
Kyle
On 01/06/2011 12:15 AM, Kyle Nitzsche wrote:
It *seems* that adding a simple iso locale ("lingua") that wasn't
previously configured for ubuntu manual (from which this project inherits)
doesn't work because (I think) the toolchain uses tex & polyglossia, which
has it's own set of supported languages and different language codes than
Ubuntu and ISO.
See https://wiki.ubuntu.com/DesktopTeam/10.10/DeveloperManual/BuildPDFs,
section: "This (fr_CA) Doesn't Work Yet"
(However "de" works just by adding the po file and adding "de" to LINGUAS,
because that *is* an Ubuntu & ISO standard code and a polyglossia lingua
code and was configured in ubuntu manual, from which we inherit)
So the configuration of a new lingua requires specific (and not entirely
known ;) configurations.
Perhaps one of the Ubuntu Manual/texlive experts can show what is needed to
add two or three generic linguas, like French Canada (fr_CA), that are not
already configured?
Cheers,
Kyle
_______________________________________________
Mailing list:https://launchpad.net/~ubuntu-developer-manual
Post to :ubuntu-developer-manual@xxxxxxxxxxxxxxxxxxx
Unsubscribe :https://launchpad.net/~ubuntu-developer-manual
More help :https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list:https://launchpad.net/~ubuntu-developer-manual
Post to :ubuntu-developer-manual@xxxxxxxxxxxxxxxxxxx
Unsubscribe :https://launchpad.net/~ubuntu-developer-manual
More help :https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list:https://launchpad.net/~ubuntu-developer-manual
Post to :ubuntu-developer-manual@xxxxxxxxxxxxxxxxxxx
Unsubscribe :https://launchpad.net/~ubuntu-developer-manual
More help :https://help.launchpad.net/ListHelp
_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-developer-manual
Post to : ubuntu-developer-manual@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~ubuntu-developer-manual
More help : https://help.launchpad.net/ListHelp
Follow ups
References