No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0171.xml 27KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Language Translation</title>
  10. <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>
  12. <number>0171</number>
  13. <status>Draft</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. <spec>XMPP IM</spec>
  20. <spec>XEP-0030</spec>
  21. </dependencies>
  22. <supersedes/>
  23. <supersededby/>
  24. <shortname>langtrans</shortname>
  25. <schemaloc>
  26. <ns>langtrans</ns>
  27. <url></url>
  28. </schemaloc>
  29. <schemaloc>
  30. <ns>langtrans:items</ns>
  31. <url></url>
  32. </schemaloc>
  33. <author>
  34. <firstname>Boyd</firstname>
  35. <surname>Fletcher</surname>
  36. <email></email>
  37. </author>
  38. <author>
  39. <firstname>Daniel</firstname>
  40. <surname>LaPrade</surname>
  41. <email></email>
  42. </author>
  43. <author>
  44. <firstname>Keith</firstname>
  45. <surname>Lirette</surname>
  46. <email></email>
  47. </author>
  48. <author>
  49. <firstname>Brian</firstname>
  50. <surname>Raymond</surname>
  51. <email></email>
  52. </author>
  53. <revision>
  54. <version>1.1.1</version>
  55. <date>2015-10-15</date>
  56. <initials>XEP Editor (mam)</initials>
  57. <remark><p>Corrected XML schema to note a number of constructs are optional not required (Christian Schudt).</p></remark>
  58. </revision>
  59. <revision>
  60. <version>1.1</version>
  61. <date>2011-06-15</date>
  62. <initials>psa</initials>
  63. <remark><p>With author approval, the XMPP Registrar changed the items namespace from urn:xmpp:langtrans#items to urn:xmpp:langtrans:items because # is not recommended in URN syntax.</p></remark>
  64. </revision>
  65. <revision>
  66. <version>1.0</version>
  67. <date>2008-05-09</date>
  68. <initials>psa</initials>
  69. <remark><p>Per a vote of the XMPP Council, advanced status to Draft.</p></remark>
  70. </revision>
  71. <revision>
  72. <version>0.3</version>
  73. <date>2008-02-01</date>
  74. <initials>kl/bf</initials>
  75. <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>
  76. </revision>
  77. <revision>
  78. <version>0.2</version>
  79. <date>2006-04-24</date>
  80. <initials>psa</initials>
  81. <remark><p>Added text about use of Thread IDs.</p></remark>
  82. </revision>
  83. <revision>
  84. <version>0.1</version>
  85. <date>2006-01-24</date>
  86. <initials>psa</initials>
  87. <remark><p>Initial version.</p></remark>
  88. </revision>
  89. <revision>
  90. <version>0.0.4</version>
  91. <date>2006-01-17</date>
  92. <initials>psa</initials>
  93. <remark><p>Converted to XML format, cleaned up text, modified examples, changed pivotable and reviewed attributes to xs:boolean, corrected schema.</p></remark>
  94. </revision>
  95. <revision>
  96. <version>0.0.3</version>
  97. <date>2006-01-16</date>
  98. <initials>bf</initials>
  99. <remark><p>Changed xml:lang to destination, derived to derived_from; added service discovery identity.</p></remark>
  100. </revision>
  101. <revision>
  102. <version>0.0.2</version>
  103. <date>2005-12-28</date>
  104. <initials>bf</initials>
  105. <remark><p>Miscellaneous edits.</p></remark>
  106. </revision>
  107. <revision>
  108. <version>0.0.1</version>
  109. <date>2005-12-21</date>
  110. <initials>bf</initials>
  111. <remark><p>First draft.</p></remark>
  112. </revision>
  113. </header>
  114. <section1 topic='Introduction' anchor='intro'>
  115. <p>There currently exists no standard for describing language translations over a text chat protocol. While numerous products and services exist to provide translation of text, there exists no standardized protocol extension for requesting a translation and expressing the details of the translation over XMPP (see &xmppcore;). This document describes how to express a translation and its components in an XMPP message as well as a method to request translation.</p>
  116. <p>Direct translation can be realized by either client-side translation before sending or transparent components translating messages on the fly. Discovering XMPP entities capable of translation allows for clients to request translation from them based on their capabilities. The remote XMPP entity could be either an automated translation service or a human providing translation.</p>
  117. </section1>
  118. <section1 topic='Glossary' anchor='glossary'>
  119. <dl>
  120. <di><dt>Original Text</dt><dd>This is the message text that was originally created by the sender. This is the text that is translated.</dd></di>
  121. <di><dt>Translated Text</dt><dd>This is the message text that has been translated by the language translation engines. This also called the destination text. For any given message there can be multiple destination text message bodies.</dd></di>
  122. <di><dt>Pivot Language</dt><dd>Pivoting is the process of using one or more intermediate languages to translate from a given source language to a specific destination language. For example, if you needed to translate from English to Russian but only had translators that went from English to French and French to Russian then you could use French as a pivot language.</dd></di>
  123. <di><dt>Pivot Text</dt><dd>This is the translated text of the original message in a pivot language. For any given destination language, there can be zero or more pivot text bodies. The ordering of pivoting is required to be specified for the destination language.</dd></di>
  124. <di><dt>Language Translation Engine</dt><dd>Since not all language translation engines are the same quality it is important to some classes of users that they know what translation engine was used. It is equally important to also be able to select a specific translation engine for a given language pairing if more than one engine is available.</dd></di>
  125. <di><dt>Language Translation Character Set</dt><dd>Some language translation engines can only translate text between languages if certain character sets (or code pages) are used.</dd></di>
  126. <di><dt>Language Translation Dictionary</dt><dd> In order to enhance the accuracy of translation engines most support the concept of mission specific dictionaries.</dd></di>
  127. </dl>
  128. </section1>
  129. <section1 topic='Requirements' anchor='reqs'>
  130. <p>The protocol defined herein addresses the following requirements:</p>
  131. <ol>
  132. <li><p>Enable an XMPP entity to request a translation from a remote XMPP entity.</p></li>
  133. <li>
  134. <p>Enable an XMPP entity to express the following mandatory elements of a translation for any receiving entities.</p>
  135. <ol style='list-style-type: lower-alpha'>
  136. <li>Identification of Original Text</li>
  137. <li>Identification of Translated Text</li>
  138. <li>Identification of any Pivot Language(s) and Text</li>
  139. <li>Identification of the method and order of translation</li>
  140. </ol>
  141. </li>
  142. <li>
  143. <p>Enable an XMPP entity to express the following optional elements of a translation for any receiving entities.</p>
  144. <ol style='list-style-type: lower-alpha'>
  145. <li>Identification of Language Translation Engines used.</li>
  146. <li>Identification of Location of the translation.</li>
  147. <li>Identification of Sender and Destination language of choice.</li>
  148. <li>Discovery of Server support for translation including which language pair, dictionaries, and engines are available.</li>
  149. <li>Identification of desire to text to be translated or not to be translated.</li>
  150. </ol>
  151. </li>
  152. </ol>
  153. <p>The following methods of translation are supported:</p>
  154. <ol>
  155. <li>Manual or Human</li>
  156. <li>Machine or Automated</li>
  157. <li>Machine with Human Review</li>
  158. </ol>
  159. </section1>
  160. <section1 topic='Use Cases' anchor='usecases'>
  161. <p>The following use cases illustrate simple scenarios for translation of expressions as well as requesting a translation from remote entities.</p>
  162. <section2 topic='Message Delivery' anchor='delivery'>
  163. <p>A message directly translated by the originating XMPP entity or a transparent XMPP entity delivered to a remote entity with only the required elements of source and destination language; this is the simplest case for a translation from one language to another. The source language is known because there is no &lt;translation/&gt; tag describing it. Three translation methods are supported by doing the following:</p>
  164. <ol>
  165. <li>If no 'engine' attribute is present, then manual (or human) translation was performed.</li>
  166. <li>If an 'engine' attribute is present then machine (or automated) translation was performed, where the translation engine is identified by the value of the 'engine' attribute. If the 'engine' attribute is present its value is an empty string, then the name of the translation engine was not available.</li>
  167. <li>If the 'engine' attribute and the 'reviewed' attribute are present, then machine translation was performed but the message text was reviewed and possibly modified by a human.</li>
  168. </ol>
  169. <section3 topic='Direct Translation' anchor='message-direct'>
  170. <example caption='Entity sends a message translated from English to French'><![CDATA[
  171. <message xml:lang='en' from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
  172. <subject xml:lang='en'>Hello</subject>
  173. <subject xml:lang='fr'>Bonjour</subject>
  174. <body xml:lang='en'>How are you?</body>
  175. <body xml:lang='fr'>comment allez-vous?</body>
  176. <x xmlns='urn:xmpp:langtrans'>
  177. <translation destination_lang='fr' source_lang='en'/>
  178. </x>
  179. </message>
  180. ]]></example>
  181. </section3>
  182. <section3 topic='Translation With Pivot' anchor='message-pivot'>
  183. <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 &lt;x/&gt; 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>
  184. <example caption='Entity sends a message translated from French to Russian via English using human translators'><![CDATA[
  185. <message xml:lang='fr' from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
  186. <subject xml:lang='fr'>Bonjour</subject>
  187. <subject xml:lang='en'>Hello</subject>
  188. <subject xml:lang='ru'>x443;&#x43B;&#x442;&#x435;</subject>
  189. <body xml:lang='fr'>comment allez-vous?</body>
  190. <body xml:lang='en'>How are you?</body>
  191. <body xml:lang='ru'>&#x41A;&#x430;&#x43A; &#x432;&#x44B;?</body>
  192. <x xmlns='urn:xmpp:langtrans'>
  193. <translation destination_lang='en' source_lang='fr'/>
  194. <translation destination_lang='ru' source_lang='en'/>
  195. </x>
  196. </message>
  197. ]]></example>
  198. </section3>
  199. <section3 topic='Translation With Pivot Specifying Details' anchor='message-pivot-details'>
  200. <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>
  201. <example caption='Entity sends a message translated from French to Russian via English using a machine translation engine.'><![CDATA[
  202. <message xml:lang='fr' from='bard@shakespeare.lit/globe' to='playwright@marlowe.lit/theatre'>
  203. <subject xml:lang='fr'>Bonjour</subject>
  204. <subject xml:lang='en'>Hello</subject>
  205. <subject xml:lang='ru'>x443;&#x43B;&#x442;&#x435;</subject>
  206. <body xml:lang='fr'>comment allez-vous?</body>
  207. <body xml:lang='en'>How are you?</body>
  208. <body xml:lang='ru'>&#x41A;&#x430;&#x43A; &#x432;&#x44B;?</body>
  209. <x xmlns='urn:xmpp:langtrans'>
  210. <translation destination_lang='en' engine='SYSTRANS' source_lang='fr'/>
  211. <translation destination_lang='ru' engine='SYSTRANS' source_lang='en'/>
  212. </x>
  213. </message>
  214. ]]></example>
  215. </section3>
  216. </section2>
  217. <section2 topic='Discovering Translation Providers' anchor='disco'>
  218. <section3 topic='Discovering Translation Providers On a Server' anchor='disco-items'>
  219. <p>When connected to a server, a XMPP entity can locate translation providers by asking a server which translation providers are attached to the server; this MUST be done using &xep0030;. The server SHOULD return the availability of of translation providers and language pairings for which the user has rights to use.</p>
  220. <example caption='Entity sends discovery request to server'><![CDATA[
  221. <iq type='get' id='disco1' to='shakespeare.lit'>
  222. <query xmlns=''/>
  223. </iq>
  224. ]]></example>
  225. <example caption='Server returns items, including translation providers'><![CDATA[
  226. <iq type='result' id='disco1' from='shakespeare.lit' to='bard@shakespeare.lit/globe'>
  227. <query xmlns=''>
  228. ...
  229. <item jid='towerofbabel@shakespeare.lit'
  230. name='Tower of Babel Translation Bot'/>
  231. <item jid='translation.shakespeare.lit'
  232. name='Translation Provider Service'/>
  233. ...
  234. </query>
  235. </iq>
  236. ]]></example>
  237. </section3>
  238. <section3 topic='Discovering Identity of Providers' anchor='disco-identity'>
  239. <p>Service Discovery is used to determine if a JID provides translation services. The JID can also be a bot (e.g., &lt;towerofbabel@shakespeare.lit&gt;) or a server component (e.g., &lt;translation.shakespeare.lit&gt;).</p>
  240. <example caption='Entity queries service regarding identity'><![CDATA[
  241. <iq type='get' to='translation.shakespeare.lit' from='bard@shakespeare.lit/globe'>
  242. <query xmlns=''/>
  243. </iq>
  244. ]]></example>
  245. <example caption='Service reports identity'><![CDATA[
  246. <iq type='result' to='bard@shakespeare.lit/globe' from='translation.shakespeare.lit'>
  247. <query xmlns=''>
  248. ...
  249. <identity category='automation' type='translation'/>
  250. <feature var='urn:xmpp:langtrans'/>
  251. ...
  252. </query>
  253. </iq>
  254. ]]></example>
  255. </section3>
  256. <section3 topic='Discovering Language Support' anchor='disco-lang'>
  257. <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>
  258. <example caption='Entity queries service for further information'><![CDATA[
  259. <iq type='get' to='translation.shakespeare.lit' from='bard@shakespeare.lit/globe'>
  260. <query xmlns='urn:xmpp:langtrans:items'/>
  261. </iq>
  262. ]]></example>
  263. <example caption='Service replies with language details'><![CDATA[
  264. <iq type='result' to='bard@shakespeare.lit/globe' from=' translation.shakespeare.lit'>
  265. <query xmlns='urn:xmpp:langtrans:items'>
  266. <item source_lang='en' jid='translation.shakespeare.lit' destination_lang='fr'
  267. engine='SYSTRANS 2005 Release 2' pivotable='true'/>
  268. <item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ko'
  269. engine='SYSTRANS 2005 Release 2' pivotable='true'/>
  270. <item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ru'
  271. engine='SYSTRANS 2005 Release 2' pivotable='true'/>
  272. <item source_lang='en' jid='translation.shakespeare.lit' destination_lang='ru'
  273. engine='SYSTRANS 2005 Release 2' pivotable='true' dictionary='medical'/>
  274. <item source_lang='fr' jid='translation.shakespeare.lit' destination_lang='en'
  275. engine='SYSTRANS 2005 Release 2' pivotable='true' dictionary='standard'/>
  276. <item source_lang='ru' jid='translation.shakespeare.lit' destination_lang='en'
  277. engine='SYSTRANS 2005 Release 2' pivotable='true' dictionary='Medical 1.0'/>
  278. <item source_lang='ko' jid='translation.shakespeare.lit' destination_lang='en'
  279. engine='SYSTRANS 2005 Release 2' pivotable='true'/>
  280. </query>
  281. </iq>
  282. ]]></example>
  283. </section3>
  284. </section2>
  285. <section2 topic='Requesting a Translation from a Service' anchor='request'>
  286. <section3 topic='Requesting a Basic Translation' anchor='request-basic'>
  287. <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>
  288. <example caption='Entity requests a translation from English to French'><![CDATA[
  289. <iq from='' id='translationReq_2' to='translation.shakespeare.lit' type='get'>
  290. <x xmlns='urn:xmpp:langtrans'>
  291. <source xml:lang='en'>How are you?</source>
  292. <translation destination_lang='fr'/>
  293. </x>
  294. </iq>
  295. ]]></example>
  296. <example caption='Translation is returned from translation provider'><![CDATA[
  297. <iq type='result' id='translationReq_2' from='translation.shakespeare.lit' to=''>
  298. <x xmlns='urn:xmpp:langtrans'>
  299. <source xml:lang='en'>hello, how are you?</source>
  300. <translation destination_lang='fr' source_lang='en' engine='default'>comment allez-vous?</translation>
  301. </x>
  302. </iq>
  303. ]]></example>
  304. </section3>
  305. <section3 topic='Requesting a Translation With Multiple Destination Languages' anchor='request-multiple'>
  306. <example caption='bard requests a translation from English to Italian and German'><![CDATA[
  307. <iq from='' id='translationReq_4' to='translation.shakespeare.lit' type='get'>
  308. <x xmlns='urn:xmpp:langtrans'>
  309. <source xml:lang='en'>How are you?</source>
  310. <translation destination_lang='it'/>
  311. <translation destination_lang='de'/>
  312. </x>
  313. </iq>
  314. ]]></example>
  315. <example caption='Translation is returned from translation provider'><![CDATA[
  316. <iq type='result' id='translationReq_4' from='translation.shakespeare.lit' to=''>
  317. <x xmlns='urn:xmpp:langtrans'>
  318. <source xml:lang='en'>How are you?</source>
  319. <translation destination_lang='it' source_lang='en' engine='default'>Come siete?</translation>
  320. <translation destination_lang='de' source_lang='en' engine='default'>Wie geht es Ihnen?</translation>
  321. </x>
  322. </iq>
  323. ]]></example>
  324. </section3>
  325. <section3 topic='Requesting a Translation With a Specific Dictionary' anchor='request-dictionary'>
  326. <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>
  327. <example caption='Requests a translation from English to French using the &apos;medical&apos; dictionary'><![CDATA[
  328. <iq from='' id='translationReq_6' to='translation.shakespeare.lit' type='get'>
  329. <x xmlns='urn:xmpp:langtrans'>
  330. <source xml:lang='en'>How are you?</source>
  331. <translation destination_lang='fr' dictionary='medical'/>
  332. </x>
  333. </iq>
  334. ]]></example>
  335. <example caption='Translation provider returns translation with dictionary details'><![CDATA[
  336. <iq type='result' id='translationReq_6' from='translation.shakespeare.lit' to=''>
  337. <x xmlns='urn:xmpp:langtrans'>
  338. <source xml:lang='en'>hello, how are you?</source>
  339. <translation
  340. destination_lang='fr'
  341. dictionary='medical'
  342. engine='default'
  343. source_lang='en'>comment allez-vous?</translation>
  344. </x>
  345. </iq>
  346. ]]></example>
  347. <p>If the translation service cannot complete the translation it SHOULD return a &lt;item-not-found/&gt; 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>
  348. <example caption='Translation could not be completed'><![CDATA[
  349. <iq type='error' id='translationReq_7' from='translation.shakespeare.lit' to=''>
  350. <x xmlns='urn:xmpp:langtrans'>
  351. <source xml:lang='en'>How are you?</source>
  352. <translation destination_lang='dy'/>
  353. </x>
  354. <error type='modify'>
  355. <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  356. </error>
  357. </iq>
  358. ]]></example>
  359. <p>If privacy or security considerations make returning an &lt;item-not-found/&gt; error not feasible it SHOULD return a &lt;service-unavailable/&gt; error.</p>
  360. <example caption='Service unavailable'><![CDATA[
  361. <iq type='error' id='translationReq_7' from='translation.shakespeare.lit' to=''>
  362. <x xmlns='urn:xmpp:langtrans'>
  363. <source xml:lang='en'>How are you?</source>
  364. <translation destination_lang='dy'/>
  365. </x>
  366. <error type='cancel'>
  367. <service-unavailable xmlns='urn:ietf:xml:params:ns:xmpp-stanzas'/>
  368. </error>
  369. </iq>
  370. ]]></example>
  371. </section3>
  372. </section2>
  373. </section1>
  374. <section1 topic='Implementation Notes' anchor='impl'>
  375. <p>In order to reduce user confusion and misunderstanding of a translated message body, it is RECOMMENDED that implementations of langtran implement the following user interface features.</p>
  376. <ol>
  377. <li>Translated messages should be clearly identified as being a translation.</li>
  378. <li>The display of translated message should clearly show how (automated, manual, automated with human review) a messaged was translated.</li>
  379. <li>The display of a message should clearly show if the translation is the destination, original or pivot language.</li>
  380. <li>If pivoting is used, the destination message text should be marked in such a way as to indicate that it was translated on one or more pivot languages, what those language are, in what order they were used, and the actual pivot language text should be accessible to the user.</li>
  381. <li>It is recommended that only one level of pivoting be used as quality of the destination translation degrades significantly after each pivot.</li>
  382. </ol>
  383. <p>Note: The 'reviewed' and 'pivotable' attributes are of type "boolean" and MUST be handled accordingly. &BOOLEANNOTE;</p>
  384. </section1>
  385. <section1 topic='Internationalization Considerations' anchor='i18n'>
  386. <p>In order to properly process multi-language messages, clients MUST implement support for multiple message bodies differentiated by the 'xml:lang' attribute as described in <cite>RFC 6120</cite>.</p>
  387. </section1>
  388. <section1 topic='Security Considerations' anchor='security'>
  389. <p>Potential attacks may be easier against services that implement translation because of the potential disclosure of information regarding language pairings, engines, and dictionaries used however no specific vulnerabilities are introduced.</p>
  390. <p>This possible weakness can be mitigated by not returning specifics to requesting entities and the responding entity MAY perform authorization checks in order to determine how to respond.</p>
  391. </section1>
  392. <section1 topic='IANA Considerations' anchor='iana'>
  393. <p>This document requires no interaction with &IANA;.</p>
  394. </section1>
  395. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  396. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  397. <p>The &REGISTRAR; includes 'urn:xmpp:langtrans' and 'urn:xmpp:langtrans:items' within its registry of protocol namespaces (see &NAMESPACES;).</p>
  398. <p class='box'>Note: Before version 1.1 of this specification, the name of the items namespace was urn:xmpp:langtrans#items, however the '#' character is not recommended in URN syntax (see &rfc2141;) so the name was changed to urn:xmpp:langtrans:items.</p>
  399. </section2>
  400. <section2 topic='Service Discovery Identities' anchor='registrar-identity'>
  401. <p>The XMPP Registrar includes type of "translation" in the "automation" category within its registry of service discovery identities (see &DISCOCATEGORIES;).</p>
  402. </section2>
  403. </section1>
  404. <section1 topic='XML Schema' anchor='schema'>
  405. <section2 topic='langtrans' anchor='schema-langtrans'>
  406. <code><![CDATA[
  407. <?xml version='1.0' encoding='UTF-8'?>
  408. <xs:schema
  409. xmlns='urn:xmpp:langtrans'
  410. xmlns:xs=''
  411. targetNamespace='urn:xmpp:langtrans'
  412. elementFormDefault='qualified'>
  413. <xs:annotation>
  414. <xs:documentation>
  415. The protocol documented by this schema is defined in
  416. XEP-0171:
  417. </xs:documentation>
  418. </xs:annotation>
  419. <xs:element name='x'>
  420. <xs:complexType>
  421. <xs:element ref='source' use='optional'/>
  422. <xs:sequence>
  423. <xs:element ref='translation' use='required' minOccurs='1'/>
  424. </xs:sequence>
  425. </xs:complexType>
  426. </xs:element>
  427. <xs:element name='source'>
  428. <xs:complexType>
  429. <xs:simpleContent>
  430. <xs:extension base='xs:string'>
  431. <xs:attribute ref='xml:lang' use='required'/>
  432. </xs:extension>
  433. </xs:simpleContent>
  434. </xs:complexType>
  435. </xs:element>
  436. <xs:element name='translation'>
  437. <xs:complexType>
  438. <xs:simpleContent>
  439. <xs:extension base='empty'>
  440. <xs:attribute name='charset' type='xs:string' use='optional'/>
  441. <xs:attribute name='source_lang' type='xs:language' use='optional' />
  442. <xs:attribute name='destination_lang' type='xs:language' use='required'/>
  443. <xs:attribute name='dictionary' type='xs:string' use='optional'/>
  444. <xs:attribute name='engine' type='xs:string' use='optional' />
  445. <xs:attribute name='reviewed' type='xs:boolean' use='optional' default='false'/>
  446. </xs:extension>
  447. </xs:simpleContent>
  448. </xs:complexType>
  449. </xs:element>
  450. <xs:simpleType name='empty'>
  451. <xs:restriction base='xs:string'>
  452. <xs:enumeration value=''/>
  453. </xs:restriction>
  454. </xs:simpleType>
  455. </xs:schema>
  456. ]]></code>
  457. </section2>
  458. <section2 topic='langtrans:items' anchor='schema-langtrans-items'>
  459. <code><![CDATA[
  460. <?xml version='1.0' encoding='UTF-8'?>
  461. <xs:schema
  462. xmlns='urn:xmpp:langtrans:items'
  463. xmlns:xs=''
  464. targetNamespace='urn:xmpp:langtrans:items'
  465. elementFormDefault='qualified'>
  466. <xs:annotation>
  467. <xs:documentation>
  468. The protocol documented by this schema is defined in
  469. XEP-0171:
  470. </xs:documentation>
  471. </xs:annotation>
  472. <xs:element name='query'>
  473. <xs:complexType>
  474. <xs:sequence>
  475. <xs:element ref='item' minOccurs='0' maxOccurs='unbounded'/>
  476. </xs:sequence>
  477. </xs:complexType>
  478. </xs:element>
  479. <xs:element name='item'>
  480. <xs:complexType>
  481. <xs:simpleContent>
  482. <xs:extension base='empty'>
  483. <xs:attribute name='dictionary' type='xs:string'/>
  484. <xs:attribute name='destination_lang' type='xs:language'/>
  485. <xs:attribute name='engine' type='xs:string' use='optional'/>
  486. <xs:attribute name='jid' type='xs:string' use='required'/>
  487. <xs:attribute name='name' type='xs:string' use='optional'/>
  488. <xs:attribute name='pivotable' type='xs:boolean' use='optional' default='false'/>
  489. <xs:attribute name='source_lang' type='xs:language' use='required'/>
  490. </xs:extension>
  491. </xs:simpleContent>
  492. </xs:complexType>
  493. </xs:element>
  494. <xs:simpleType name='empty'>
  495. <xs:restriction base='xs:string'>
  496. <xs:enumeration value=''/>
  497. </xs:restriction>
  498. </xs:simpleType>
  499. </xs:schema>
  500. ]]></code>
  501. </section2>
  502. </section1>
  503. </xep>