[Standards] XEP-0301 0.5 comments -xml:lang

Gunnar Hellström gunnar.hellstrom at omnitor.se
Fri Jul 27 06:11:12 UTC 2012


I see a need to deal with the 'xml:lang' attribute in XEP-0301.

This attribute can introduce alternative language variants of the text 
in messages and other elements.
The use is described in RFC 6221. For us it is of interest to study its 
use for the <body/> element:

----copy from RFC 6221 section 5.2.3 Body element--------------------------
There are no attributes defined for the <body/> element, with the 
exception of the 'xml:lang' attribute. Multiple instances of the <body/> 
element MAY be included in a message stanza for the purpose of providing 
alternate versions of the same body, but only if each instance possesses 
an 'xml:lang' attribute with a distinct language value (either 
explicitly or by inheritance from the 'xml:lang' value of an element 
farther up in the XML hierarchy, which from the sender's perspective can 
include the XML stream header as described in [XMPP-CORE 
<#ref-XMPP-CORE>]).

<message from='juliet at example.com/balcony'
  id='z94nb37h' to='romeo at example.net' type='chat' xml:lang='en'>
   <body>Wherefore art thou, Romeo?</body>
   <body xml:lang='cs'> Pro&#x010D;e&#x017D; jsi ty, Romeo? </body>
  </message>

-----------end of copy---------------------------------

For XEP-0301 it would be natural to either offer the same opportunity to 
provide the alternative languages in the same message, or explicitly say 
that alternative languages are not supported.

This would at least go into section 4.2 RTT attributes and 4.5.3.1 <t/> 
element

Each language will have its own editing elements and values, so the 
xml:lang attribute should be on the <rtt/> level.

I propose insertion a new subsection in 4.2
-----------------------------------------------------------------------------------------------------------------------------------------------
4.2.4 Language
Multiple instances of the <rtt/> element MAY be included in a message 
stanza for the purpose of providing alternate versions of the same 
real-time text, but only if each instance possesses an 'xml:lang' 
attribute with a distinct language value (either explicitly or by 
inheritance from the 'xml:lang' value of an element farther up in the 
XML hierarchy, which from the sender's perspective can include the XML 
stream header as described in RFC 6220 [   ]). The support for language 
variants SHALL follow the principles of support for language variants in 
message bodies specified in RFC 6221[   ].

This example provides a small part of real-time text in the default 
language English and the alternative language Check.

<message from='juliet at example.com/balcony'
  id='z94nb37h' to='romeo at example.net' type='chat' xml:lang='en'>
   <rtt xmlns='urn:xmpp:rtt:0' seq='89002'><t>tho</t></rtt>
   <rtt xmlns='urn:xmpp:rtt:0' seq='32304'xml:lang='cs'> <t>ty</t></rtt>
  </message>

--------------------------------------------------------------------------------------------------------------------------------------------------
The second line from the bottom of 4.1 should be changed from
"There MUST NOT be more than one <rtt/> element per <message/> stanza."
to
"There MUST NOT be more than one <rtt/> element per language variant in 
each <message/> stanza."

-----------------------------------------------------
Gunnar







-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20120727/0c13c6c4/attachment.html>


More information about the Standards mailing list