1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-24 18:22:24 -05:00
git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1649 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2008-02-02 00:02:22 +00:00
parent 83f72eabfc
commit bfd0204c0d

View File

@ -10,7 +10,7 @@
<abstract>This document defines an XMPP protocol extension for providing language translation facilities over XMPP. It supports human, machine, client-based, and server-based translations.</abstract>
&LEGALNOTICE;
<number>0171</number>
<status>Deferred</status>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
@ -30,18 +30,24 @@
<author>
<firstname>Daniel</firstname>
<surname>LaPrade</surname>
<email>daniel.laprade@je.jfcom.mil</email>
<email>dlaprade@echostorm.net</email>
</author>
<author>
<firstname>Keith</firstname>
<surname>Lirette</surname>
<email>keith.lirette@je.jfcom.mil</email>
<email>keith.lirette@gd-ais.com</email>
</author>
<author>
<firstname>Brian</firstname>
<surname>Raymond</surname>
<email>brian.raymond@je.jfcom.mil</email>
<email>braymond@echostorm.net</email>
</author>
<revision>
<version>0.3</version>
<date>2008-02-01</date>
<initials>kl/bf</initials>
<remark>Modified semantics to use IQ stanzas for communication with servers; changed dst_lang to destination_lang and src_lang to source_lang.</remark>
</revision>
<revision>
<version>0.2</version>
<date>2006-04-24</date>
@ -137,7 +143,7 @@
</ol>
<section3 topic='Direct Translation' anchor='message-direct'>
<example caption='Entity sends a message translated from English to French'><![CDATA[
<message from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
<message xml:lang='en' from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
<subject xml:lang='en'>Hello</subject>
<subject xml:lang='fr'>Bonjour</subject>
<body xml:lang='en'>How are you?</body>
@ -151,7 +157,7 @@
<section3 topic='Translation With Pivot' anchor='message-pivot'>
<p>A message translated by the originating XMPP entity or a transparent XMPP entity delivered to a remote entity with the pivot languages used to accomplish the translation. The source language is known because there is no <x/> translation tag describing it. When a translation is done via a pivot language, the pivot languages and their order of use MUST be specified.</p>
<example caption='Entity sends a message translated from French to Russian via English using human translators'><![CDATA[
<message from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
<message xml:lang='fr' from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
<subject xml:lang='fr'>Bonjour</subject>
<subject xml:lang='en'>Hello</subject>
<subject xml:lang='ru'>x443;&#x43B;&#x442;&#x435;</subject>
@ -169,7 +175,7 @@
<p>A message translated by the originating XMPP entity or a transparent XMPP entity delivered to a remote entity using pivot languages and machine translation. The source language is known because there is no &X; translation tag describing it.</p>
<example caption='Entity sends a message translated from French to Russian via English using a machine translation engine.'><![CDATA[
<message from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
<message xml:lang='fr' from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
<subject xml:lang='fr'>Bonjour</subject>
<subject xml:lang='en'>Hello</subject>
<subject xml:lang='ru'>x443;&#x43B;&#x442;&#x435;</subject>
@ -233,19 +239,19 @@
<example caption='Service replies with language details'><![CDATA[
<iq type='result' to='bard@shakespeare.lit/globe' from=' translation.shakespeare.lit'>
<query xmlns=' http://jabber.org/protocol/langtrans#items'>
<item src_lang='en' jid='translation.shakespeare.lit' dst_lang='fr'
<item source_lang='en' jid='translation.shakespeare.lit' destination_lang='fr'
engine='SYSTRANS 2005 Release 2' pivotable='true'/>
<item src_lang='en' jid='translation.shakespeare.lit' dst_lang='ko'
<item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ko'
engine='SYSTRANS 2005 Release 2' pivotable='true'/>
<item src_lang='en' jid='translation.shakespeare.lit' dst_lang='ru'
<item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ru'
engine='SYSTRANS 2005 Release 2' pivotable='true'/>
<item src_lang='en' jid='translation.shakespeare.lit' dst_lang='ru'
<item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ru'
engine='SYSTRANS 2005 Release 2' pivotable='true' dictionary='medical'/>
<item src_lang='fr' jid='translation.shakespeare.lit' dst_lang='en'
<item source_lang='fr' jid='translation.shakespeare.lit' destination_lang='en'
engine='SYSTRANS 2005 Release 2' pivotable='true' dictionary='standard'/>
<item src_lang='ru' jid='translation.shakespeare.lit' dst_lang='en'
<item source_lang='ru' jid='translation.shakespeare.lit' destination_lang='en'
engine='SYSTRANS 2005 Release 2' pivotable='true' dictionary='Medical 1.0'/>
<item src_lang='ko' jid='translation.shakespeare.lit' dst_lang='en'
<item source_lang='ko' jid='translation.shakespeare.lit' destination_lang='en'
engine='SYSTRANS 2005 Release 2' pivotable='true'/>
</query>
</iq>
@ -254,98 +260,86 @@
</section2>
<section2 topic='Requesting a Translation from a Service' anchor='request'>
<section3 topic='Requesting a Basic Translation' anchor='request-basic'>
<p>To request service from a translation provider you can send a message to a provider requesting translations. The lack of a 'derived_from' attribute in the &lt;translation/&gt; element indicates a request for a translation. The request SHOULD include an XMPP &THREAD; element for tracking purposes.</p>
<p>To request service from a translation provider you can send a message to a provider requesting translations. The lack of a 'derived_from' attribute in the &lt;translation/&gt; element indicates a request for a translation.</p>
<example caption='Entity requests a translation from English to French'><![CDATA[
<message from='bard@shakespeare.lit/globe' to='translation.shakespeare.lit'>
<thread>5f3ea6f710337db2388e965e837fcc96334361e4</thread>
<subject xml:lang='en'>Hello</subject>
<body xml:lang='en'>How are you?</body>
<x xmlns='http://jabber.org/protocol/langtrans'>
<translation destination='fr'/>
<iq xmlns="jabber:client" from="bard@shakespeare.lt/globe" id="translationReq_2" to="translation.shakespeare.lit" type="get">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="fr"/>
</x>
</message>
</iq>
]]></example>
<p>If the translation request included a Thread ID, the translation provider MUST echo that thread in its response so that the requesting entity can keep associate the response with the request.</p>
<example caption='Translation is returned from translation provider'><![CDATA[
<message from='translation.shakespeare.lit' to='bard@shakespeare.lit/globe'>
<thread>5f3ea6f710337db2388e965e837fcc96334361e4</thread>
<subject xml:lang='fr'>Bonjour</subject>
<subject xml:lang='en'>Hello</subject>
<body xml:lang='fr'>comment allez-vous?</body>
<body xml:lang='en'>How are you?</body>
<x xmlns='http://jabber.org/protocol/langtrans'>
<translation destination='fr' derived_from='en'/>
<iq type="result" id="translationReq_2" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">hello, how are you?</source>
<translation destination_lang="fr" derived_from="en" engine="default">comment allez-vous?</translation>
</x>
</message>
</iq>
]]></example>
</section3>
<section3 topic='Requesting a Translation With Multiple Destination Languages' anchor='request-multiple'>
<example caption='bard requests a translation from English to French and Russian'><![CDATA[
<message from='bard@shakespeare.lit/globe' to='translation.shakespeare.lit'>
<thread>5f3ea6f710337db2388e965e837fcc96334361e4</thread>
<subject xml:lang='en'>Hello</subject>
<body xml:lang='en'>How are you?</body>
<x xmlns='http://jabber.org/protocol/langtrans'>
<translation destination='fr'/>
<translation destination='ru'/>
<example caption='bard requests a translation from English to Italian and German'><![CDATA[
<iq xmlns="jabber:client" from="bard@shakespeare.lt/globe" id="translationReq_4" to="translation.shakespeare.lit" type="get">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="it"/>
<translation destination_lang="de"/>
</x>
</message>
</iq>
]]></example>
<example caption='Translation is returned from translation provider'><![CDATA[
<message from='translation.shakespeare.lit' to='bard@shakespeare.lit/globe'>
<thread>5f3ea6f710337db2388e965e837fcc96334361e4</thread>
<subject xml:lang='en'>Hello</subject>
<subject xml:lang='fr'>Bonjour</subject>
<subject xml:lang='ru'>x443;&#x43B;&#x442;&#x435;</subject>
<body xml:lang='fr'>comment allez-vous?</body>
<body xml:lang='en'>How are you?</body>
<body xml:lang='ru'>&#x41A;&#x430;&#x43A; &#x432;&#x44B;?</body>
<x xmlns='http://jabber.org/protocol/langtrans'>
<translation destination='fr' derived_from='en'/>
<translation destination='ru' derived_from='en'/>
<iq type="result" id="translationReq_4" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="it" derived_from="en" engine="default">Come siete?</translation>
<translation destination_lang="de" derived_from="en" engine="default">Wie geht es Ihnen?</translation>
</x>
</message>
</iq>
]]></example>
</section3>
<section3 topic='Requesting a Translation With a Specific Dictionary' anchor='request-dictionary'>
<p>If a specific dictionary is required you MAY request a dictionary. This SHOULD have been returned when discoing the server although a dictionary MAY be requested which was not. The dictionaries are translation engine specific and are free form text.</p>
<example caption='Requests a translation from English to French using the &apos;medical&apos; dictionary'><![CDATA[
<message from='bard@shakespeare.lit/globe' to='translation.shakespeare.lit'>
<thread>5f3ea6f710337db2388e965e837fcc96334361e4</thread>
<subject xml:lang='en'>Hello</subject>
<body xml:lang='en'>How are you?</body>
<x xmlns='http://jabber.org/protocol/langtrans'>
<translation destination='fr' dictionary='medical'/>
<iq xmlns="jabber:client" from="bard@shakespeare.lt/globe" id="translationReq_6" to="translation.shakespeare.lit" type="get">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="fr" dictionary="medical"/>
</x>
</message>
</iq>
]]></example>
<example caption='Translation provider returns translation with dictionary details'><![CDATA[
<message from='translation.shakespeare.lit' to='bard@shakespeare.lit/globe'>
<thread>5f3ea6f710337db2388e965e837fcc96334361e4</thread>
<subject xml:lang='fr'>Bonjour</subject>
<subject xml:lang='en'>Hello</subject>
<body xml:lang='fr'>comment allez-vous?</body>
<body xml:lang='en'>How are you?</body>
<x xmlns='http://jabber.org/protocol/langtrans'>
<translation destination='fr' derived_from='en' dictionary='medical'/>
<iq type="result" id="translationReq_6" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">hello, how are you?</source>
<translation destination_lang="fr" derived_from="en" dictionary="medical" engine="default">comment allez-vous?</translation>
</x>
</message>
</iq>
]]></example>
<p>If the translation service cannot complete the translation it SHOULD return a <item-not-found/> error indicating some part of the translation request was problematic, unless doing so would violate the privacy and security considerations in XMPP Core and XMPP IM, or local security and privacy policies.</p>
<example caption='Translation could not be completed'><![CDATA[
<message from='translation.shakespeare.lit' to='bard@shakespeare.lit/globe' type='error'>
<error code='404' type='cancel'>
<item-not-found xmlns='urn:ietf:xml:params:ns:xmpp-stanzas'/>
<iq type="error" id="translationReq_7" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="dy"/>
</x>
<error code="400" type="modify">
<bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</message>
</iq>
]]></example>
<p>If privacy or security considerations make returning an <item-not-found/> error not feasible it SHOULD return a <service-unavailable/> error.</p>
<example caption='Service unavailable'><![CDATA[
<message from='translation.shakespeare.lit' to='bard@shakespeare.lit/globe' type='error'>
<error code='503' type='cancel'>
<iq type="error" id="translationReq_7" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="http://jabber.org/protocol/langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="dy"/>
</x>
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:xml:params:ns:xmpp-stanzas'/>
</error>
</message>
</iq>
]]></example>
</section3>
</section2>
@ -391,12 +385,23 @@
<xs:element name='x'>
<xs:complexType>
<xs:element ref='source' use='required'/>
<xs:sequence>
<xs:element ref='translation'/>
<xs:element ref='translation' use='required' minOccurs='1'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='source'>
<xs:complexType>
<xs:simpleContent>
<xs:extension base='xs:string'>
<xs:attribute ref='xml:lang' use='required'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name='translation'>
<xs:complexType>
<xs:simpleContent>
@ -443,12 +448,12 @@
<xs:simpleContent>
<xs:extension base='empty'>
<xs:attribute name='dictionary' type='xs:string'/>
<xs:attribute name='dst_lang' type='xs:language'/>
<xs:attribute name='destination_lang' type='xs:language'/>
<xs:attribute name='engine' type='xs:string' use='optional'/>
<xs:attribute name='jid' type='xs:string' use='required'/>
<xs:attribute name='name' type='xs:string' use='optional'/>
<xs:attribute name='pivotable' type='xs:boolean' use='optional' default='false'/>
<xs:attribute name='src_lang' type='xs:language' use='required'/>
<xs:attribute name='source_lang' type='xs:language' use='required'/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>