1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-21 08:45:04 -05:00

1.0 DRAFT

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1838 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2008-05-09 21:57:06 +00:00
parent dd00810c0e
commit bc0830c2ba

View File

@ -7,10 +7,10 @@
<xep>
<header>
<title>Language Translation</title>
<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>
<abstract>This specification 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>Proposed</status>
<status>Draft</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
@ -22,6 +22,14 @@
<supersedes/>
<supersededby/>
<shortname>langtrans</shortname>
<schemaloc>
<ns>langtrans</ns>
<url>http://www.xmpp.org/schemas/langtrans.xsd</url>
</schemaloc>
<schemaloc>
<ns>langtrans#items</ns>
<url>http://www.xmpp.org/schemas/langtrans-items.xsd</url>
</schemaloc>
<author>
<firstname>Boyd</firstname>
<surname>Fletcher</surname>
@ -42,47 +50,53 @@
<surname>Raymond</surname>
<email>braymond@echostorm.net</email>
</author>
<revision>
<version>1.0</version>
<date>2008-05-09</date>
<initials>psa</initials>
<remark><p>Per a vote of the XMPP Council, advanced status to Draft.</p></remark>
</revision>
<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; changed destination to destination_lang and derived_from to source_lang.</remark>
<remark><p>Modified semantics to use IQ stanzas for communication with servers; changed dst_lang to destination_lang and src_lang to source_lang; changed destination to destination_lang and derived_from to source_lang.</p></remark>
</revision>
<revision>
<version>0.2</version>
<date>2006-04-24</date>
<initials>psa</initials>
<remark>Added text about use of Thread IDs.</remark>
<remark><p>Added text about use of Thread IDs.</p></remark>
</revision>
<revision>
<version>0.1</version>
<date>2006-01-24</date>
<initials>psa</initials>
<remark>Initial version.</remark>
<remark><p>Initial version.</p></remark>
</revision>
<revision>
<version>0.0.4</version>
<date>2006-01-17</date>
<initials>psa</initials>
<remark>Converted to XML format, cleaned up text, modified examples, changed pivotable and reviewed attributes to xs:boolean, corrected schema.</remark>
<remark><p>Converted to XML format, cleaned up text, modified examples, changed pivotable and reviewed attributes to xs:boolean, corrected schema.</p></remark>
</revision>
<revision>
<version>0.0.3</version>
<date>2006-01-16</date>
<initials>bf</initials>
<remark>Changed xml:lang to destination, derived to derived_from; added service discovery identity.</remark>
<remark><p>Changed xml:lang to destination, derived to derived_from; added service discovery identity.</p></remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2005-12-28</date>
<initials>bf</initials>
<remark>Miscellaneous edits.</remark>
<remark><p>Miscellaneous edits.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2005-12-21</date>
<initials>bf</initials>
<remark>First draft.</remark>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
@ -148,7 +162,7 @@
<subject xml:lang='fr'>Bonjour</subject>
<body xml:lang='en'>How are you?</body>
<body xml:lang='fr'>comment allez-vous?</body>
<x xmlns='urn:xmpp:tmp:langtrans'>
<x xmlns='urn:xmpp:langtrans'>
<translation destination_lang='fr' source_lang='en'/>
</x>
</message>
@ -164,7 +178,7 @@
<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='urn:xmpp:tmp:langtrans'>
<x xmlns='urn:xmpp:langtrans'>
<translation destination_lang='en' source_lang='fr'/>
<translation destination_lang='ru' source_lang='en'/>
</x>
@ -182,9 +196,9 @@
<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='urn:xmpp:tmp:langtrans'>
<translation destination_lang='en' source_lang='fr' engine='SYSTRANS'/>
<translation destination_lang='ru' source_lang='en' engine='SYSTRANS'/>
<x xmlns='urn:xmpp:langtrans'>
<translation destination_lang='en' engine='SYSTRANS' source_lang='fr'/>
<translation destination_lang='ru' engine='SYSTRANS' source_lang='en'/>
</x>
</message>
]]></example>
@ -223,7 +237,7 @@
<query xmlns='http://jabber.org/protocol/disco#info'>
...
<identity category='automation' type='translation'/>
<feature var='urn:xmpp:tmp:langtrans'/>
<feature var='urn:xmpp:langtrans'/>
...
</query>
</iq>
@ -233,12 +247,12 @@
<p>The supported languages and other details for the service must be known to use it. It is permissible for a translation service to provide multiple translation engines for the same language pairing -- if this is done, then a separate &lt;item/&gt; tag MUST be used for each pairing. A 'dictionary' attribute MAY be used to specify the dictionary for a specific &lt;item/&gt;. In order to specify more than one dictionary for a given language pairing then a separate &lt;item/&gt; tag MUST be used for each dictionary specification for that language pairing.</p>
<example caption='Entity queries service for further information'><![CDATA[
<iq type='get' to='translation.shakespeare.lit' from='bard@shakespeare.lit/globe'>
<query xmlns='urn:xmpp:tmp:langtrans#items'/>
<query xmlns='urn:xmpp:langtrans#items'/>
</iq>
]]></example>
<example caption='Service replies with language details'><![CDATA[
<iq type='result' to='bard@shakespeare.lit/globe' from=' translation.shakespeare.lit'>
<query xmlns='urn:xmpp:tmp:langtrans#items'>
<query xmlns='urn:xmpp:langtrans#items'>
<item source_lang='en' jid='translation.shakespeare.lit' destination_lang='fr'
engine='SYSTRANS 2005 Release 2' pivotable='true'/>
<item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ko'
@ -262,39 +276,39 @@
<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 'source_lang' 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[
<iq xmlns="jabber:client" from="bard@shakespeare.lt/globe" id="translationReq_2" to="translation.shakespeare.lit" type="get">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="fr"/>
<iq from='bard@shakespeare.lt/globe' id='translationReq_2' to='translation.shakespeare.lit' type='get'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>How are you?</source>
<translation destination_lang='fr'/>
</x>
</iq>
]]></example>
<example caption='Translation is returned from translation provider'><![CDATA[
<iq type="result" id="translationReq_2" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">hello, how are you?</source>
<translation destination_lang="fr" source_lang="en" engine="default">comment allez-vous?</translation>
<iq type='result' id='translationReq_2' from='translation.shakespeare.lit' to='bard@shakespeare.lt/globe'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>hello, how are you?</source>
<translation destination_lang='fr' source_lang='en' engine='default'>comment allez-vous?</translation>
</x>
</iq>
]]></example>
</section3>
<section3 topic='Requesting a Translation With Multiple Destination Languages' anchor='request-multiple'>
<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="urn:xmpp:tmp:langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="it"/>
<translation destination_lang="de"/>
<iq from='bard@shakespeare.lt/globe' id='translationReq_4' to='translation.shakespeare.lit' type='get'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>How are you?</source>
<translation destination_lang='it'/>
<translation destination_lang='de'/>
</x>
</iq>
]]></example>
<example caption='Translation is returned from translation provider'><![CDATA[
<iq type="result" id="translationReq_4" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="it" source_lang="en" engine="default">Come siete?</translation>
<translation destination_lang="de" source_lang="en" engine="default">Wie geht es Ihnen?</translation>
<iq type='result' id='translationReq_4' from='translation.shakespeare.lit' to='bard@shakespeare.lt/globe'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>How are you?</source>
<translation destination_lang='it' source_lang='en' engine='default'>Come siete?</translation>
<translation destination_lang='de' source_lang='en' engine='default'>Wie geht es Ihnen?</translation>
</x>
</iq>
]]></example>
@ -302,41 +316,45 @@
<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[
<iq xmlns="jabber:client" from="bard@shakespeare.lt/globe" id="translationReq_6" to="translation.shakespeare.lit" type="get">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="fr" dictionary="medical"/>
<iq from='bard@shakespeare.lt/globe' id='translationReq_6' to='translation.shakespeare.lit' type='get'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>How are you?</source>
<translation destination_lang='fr' dictionary='medical'/>
</x>
</iq>
]]></example>
<example caption='Translation provider returns translation with dictionary details'><![CDATA[
<iq type="result" id="translationReq_6" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">hello, how are you?</source>
<translation destination_lang="fr" source_lang="en" dictionary="medical" engine="default">comment allez-vous?</translation>
<iq type='result' id='translationReq_6' from='translation.shakespeare.lit' to='bard@shakespeare.lt/globe'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>hello, how are you?</source>
<translation
destination_lang='fr'
dictionary='medical'
engine='default'
source_lang='en'>comment allez-vous?</translation>
</x>
</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[
<iq type="error" id="translationReq_7" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="dy"/>
<iq type='error' id='translationReq_7' from='translation.shakespeare.lit' to='bard@shakespeare.lt/globe'>
<x xmlns='urn:xmpp: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 type='modify'>
<bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error>
</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[
<iq type="error" id="translationReq_7" from="translation.shakespeare.lit" to="bard@shakespeare.lt/globe">
<x xmlns="urn:xmpp:tmp:langtrans">
<source xml:lang="en">How are you?</source>
<translation destination_lang="dy"/>
<iq type='error' id='translationReq_7' from='translation.shakespeare.lit' to='bard@shakespeare.lt/globe'>
<x xmlns='urn:xmpp:langtrans'>
<source xml:lang='en'>How are you?</source>
<translation destination_lang='dy'/>
</x>
<error code='503' type='cancel'>
<error type='cancel'>
<service-unavailable xmlns='urn:ietf:xml:params:ns:xmpp-stanzas'/>
</error>
</iq>
@ -367,10 +385,10 @@
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>The &REGISTRAR; shall include 'urn:xmpp:tmp:langtrans' and 'urn:xmpp:tmp:langtrans#items' in its registry of protocol namespaces.</p>
<p>The &REGISTRAR; includes 'urn:xmpp:langtrans' and 'urn:xmpp:langtrans#items' within its registry of protocol namespaces (see &NAMESPACES;).</p>
</section2>
<section2 topic='Service Discovery Identities' anchor='registrar-identity'>
<p>The XMPP Registrar shall add a type of "translation" to the "automation" category in its registry of service discovery identities.</p>
<p>The XMPP Registrar includes type of "translation" in the "automation" category within its registry of service discovery identities (see &DISCOCATEGORIES;).</p>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
@ -378,11 +396,18 @@
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns='urn:xmpp:tmp:langtrans'
xmlns='urn:xmpp:langtrans'
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:tmp:langtrans'
targetNamespace='urn:xmpp:langtrans'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0171: http://www.xmpp.org/extensions/xep-0171.html
</xs:documentation>
</xs:annotation>
<xs:element name='x'>
<xs:complexType>
<xs:element ref='source' use='required'/>
@ -430,11 +455,18 @@
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns='urn:xmpp:tmp:langtrans#items'
xmlns='urn:xmpp:langtrans#items'
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:tmp:langtrans#items'
targetNamespace='urn:xmpp:langtrans#items'
elementFormDefault='qualified'>
<xs:annotation>
<xs:documentation>
The protocol documented by this schema is defined in
XEP-0171: http://www.xmpp.org/extensions/xep-0171.html
</xs:documentation>
</xs:annotation>
<xs:element name='query'>
<xs:complexType>
<xs:sequence>