From david at tilapin.org Tue Nov 8 15:48:01 2011 Content-Type: multipart/mixed; boundary="===============3576831296622387240==" MIME-Version: 1.0 From: =?utf-8?q?David_Pr=C3=A9vot_=3Cdavid_at_tilapin=2Eorg=3E?= To: devel at lists.po4a.org Subject: Re: [Po4a-devel] Bug#631874: po4a: [xhtml] Please translate lang attributes. Date: Tue, 08 Nov 2011 11:47:30 -0400 Message-ID: <4EB94F12.5030806@tilapin.org> In-Reply-To: 20111103024013.GI4954@merveille.plessy.net --===============3576831296622387240== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable retitle 631874 po4a: [xml] Please make xml:lang automatically translated thanks Hi Charles, the po4a upstream developers list, [ Please refer to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D631874 for full context ] Le 02/11/2011 22:40, Charles Plessy a =C3=A9crit : > Le Mon, Oct 31, 2011 at 03:20:30PM -0400, David Pr=C3=A9vot a =C3=A9crit : >> >> The lang attribute is already automatically translated. In order to >> translate the xml:lang one, adding the =E2=80=9Cattributes=3Dxml:lang=E2= =80=9D option is >> enough for your purpose, as documented in Locale::Po4a::Xml(3). >> >> I don't know if we want to make this attribute automatically (i.e. by >> default) translated, any opinion about it? > In the case of the xml:lang, in my (limited) experience, I do not see a > situation where it would cause me problem to have it translated by defaul= t. I don't know the exact rationale of using xml:lang instead of lang, a look at some documentation [0] makes me think that the intended use of xml:lang is to allow the use of several languages in different section of a same page. (Side note: Charles, in your example, why are you using the xml:lang attribute instead of the lang one that already exists for the html tag?) 0: http://docs.oasis-open.org/dita/v1.1/OS/archspec/xmllang.html If xml:lang was translated by default, it may cause harm in the following situation (crappy novice XML inside):

Some translatable text

3D"Image If both lang and xml:lang are translated, since it's the same string, they both will show e.g. fr for a French translation, but the resulting translated file will be wrong:

Du texte traduisible

3D"Image Even if the image still ships English text inside, it will be declared as French content, which is not true. I guess that making xml:lang translated by default may harm in some cases, so I won't be in favor of changing the current default behavior, but someone with more XML experience could enlighten us otherwise, so I keep the bug open for the moment. Regards David --===============3576831296622387240== Content-Type: application/pgp-signature MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuNC4xMSAoR05V L0xpbnV4KQoKaVFJY0JBRUJDQUFHQlFKT3VVOFdBQW9KRUxncUlYcjkvZ255anp3UUFKRGljSFYx aHpaREt1YWllUUs3eFYyUwpUQ0VOdWR3R0J3a0pycEdNNWgwZ0MxZmdTbTNnY295RDJGYzdZOHFh enBSRFJnOFpKbjhpUEJiZ3JJS1RQU09RCnRFWnRmWDFzK2tIandFaVpVZG5PTmVvVk1LbXZZSVlB KytqWUFsUE8vTGs2OERkOFBzd1VvZXFyd0plaTBoVXgKanpPa3E0bFJMcy9ZWG5KU1Q3TmhTS1hy cWU4RlNpTDVpMVhjajhFc0MySzVRdFlyak4zYzFoU1hLUVByYXlrOQpKTkJRRFJTbjZ6REVLMlhZ cjdWOFI0d0FNajVpcm5sNGp6T3hyVHlXSEtLNHQ0RTJxTTllMkU2cG5icHVUQkM5Cm5raHRsVWNm aE1JMDBaY293OGdxNit6cE56amsyaVcyZEcwaVJyQ3hOcGY5UE9Wc2hnNUVTdHU5UHBCVm01bXoK ZXJUQXIrRTZRR3RZZlgweGZHbCtSK2tIVlhPNWtURHR3cVBPNG9qZVBEajByYXFWeTVDSy9Xc2tC Wm5KRCtXcApqSVVBSG1MK3lPY3huYU55K3VqTG5vWjVObHdRMnovUnpoWVpBZE1OQi8wRWlueVFt RDBObXFnZ0ExL3laVmRLCk80TFZ6R0RmMm80OFFpeEoxcUw5YzB3Q2xpbXNjeExPZXRPR1JoMVU1 QVRLcXRUeVArcUVrZzNJNFozVk9WRmcKdXVUTlgzaFJVVmZhWGNaUFYyN3pCSkxpeXMzaUM1cGJu RWJsc1RjemVOY1VxcSt5NjkzTDZ0V09SSkoxMnIvbwpVQTNBd0dFVVIzTkpqMTEyRmRrWk9iMlVI MUlQWVltTnhJSDFlTVVPUXlpV1FGVTNsZG5QS3k4SUhiTlJxdHFiCmc0YTM2bnJvL0hiNkRCUThX L0krCj1uZkFTCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQo= --===============3576831296622387240==--