From david at tilapin.org Tue Nov 8 15:48:01 2011 Content-Type: multipart/mixed; boundary="===============1252313304716463503==" 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 --===============1252313304716463503== 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 --===============1252313304716463503== 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= --===============1252313304716463503==-- From plessy at debian.org Wed Nov 16 23:38:50 2011 Content-Type: multipart/mixed; boundary="===============5409947597108899797==" MIME-Version: 1.0 From: Charles Plessy To: devel at lists.po4a.org Subject: Re: [Po4a-devel] Bug#631874: po4a: [xhtml] Please translate lang attributes. Date: Thu, 17 Nov 2011 08:38:32 +0900 Message-ID: <20111116233832.GA30913@merveille.plessy.net> In-Reply-To: 4EB94F12.5030806@tilapin.org --===============5409947597108899797== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Le Tue, Nov 08, 2011 at 11:47:30AM -0400, David Pr=C3=A9vot a =C3=A9crit : > 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=A9cri= t : > >> > >> 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 defa= ult. > = > 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 src=3D"boring.png" xml:lang=3D"en"/> > Hello everybody, indeed, I was using xml:lang instead of lang for no good reason (=E2=80=98c= argo cult web design=E2=80=99). So to make this email less useless, let me thank you again for providing po= 4a, which was instrumental for having a bilingual website for a french/japanese conference in T=C3=B4ky=C3=B4. Have a nice day, -- = Charles Plessy Tsurumi, Kanagawa, Japan --===============5409947597108899797==-- From david at tilapin.org Wed Nov 16 23:51:49 2011 Content-Type: multipart/mixed; boundary="===============4002340907656314258==" 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: Wed, 16 Nov 2011 19:51:28 -0400 Message-ID: <4EC44C80.4030409@tilapin.org> In-Reply-To: 20111116233832.GA30913@merveille.plessy.net --===============4002340907656314258== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 16/11/2011 19:38, Charles Plessy wrote: > indeed, I was using xml:lang instead of lang for no good reason Alright, so I see no good reason to keep this bug open: the lang = parameter is already translated by default, and the xml:lang parameter = is already (optionally) translatable. Making the xml:lang parameter = translated by default may lead to unwanted corner case, so it is = probably not a good idea to do that (and if someone disagrees, or wants = to discuss this further, the bug can still be reopen). Regards David --===============4002340907656314258==--