JEP-01xx: Translation Service

Defines a translation service that provides translation from one language to another for Jabber users.

WARNING: This Standards-Track JEP is Experimental. Publication as a Jabber Enhancement Proposal does not imply acceptance or approval of this proposal by the Jabber Software Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, although production systems should not deploy implementations of this protocol until it advances to a status of Draft.

Author Information

Nolan Eakins

Email: sneakin@semanticgap.com
JID: sneakin@semanticgap.com

JEP Information

Status: Experimental
Type: Standards Track
Number: 01xx
Version: 0.1
Last Updated: 2004-09-15
JIG: Standards JIG
Dependencies: XMPP Core, JEP-0033
Supersedes: None
Superseded By: None
Short Name: Not yet assigned

Legal Notice

This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined herein have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.

Discussion Venue

The preferred venue for discussion of this document is the Standards-JIG mailing list: <https://jabberstudio.org/mailman/listinfo/standards-jig>.


Table of Contents:
1. Introduction
2. Terminology
3. Requirements
4. Addressing
5. Use Cases
5.1. Discovering If a JID Is a Translation Service
5.2. Discovering Language Support
5.3. Messages
5.3.1. Message Without Extended Addressing
5.3.2. Message With Extended Addressing
5.4. Presence
5.5. Translating Into Multple Languages
5.6. Multicasting A Translated Message
6. Errors
7. Business Rules
8. Implementation Notes
9. Security Considerations
10. IANA Considerations
11. Jabber Registrar Considerations
12. XML Schema
13. Acknowledgements
Notes
Revision History


1. Introduction

Science fiction writers like to fantasize about automatically translating foreign languages into one's native language. They need not fantasize anymore. This JEP defines a translation service that provides seamless translation for users of Jabber.

An example scenario, taken from Shakespeare's King John would be:

King Philip of France wants to send a message to King John of England. King Philip doesn't speak English, but he has a translation service available at 'translator@shakespeare.lit' and a client that can make use of it.

So King Philip prepares a message in French. He tells his client to send it to the translation service to translate it into English and forward it on to King John.

King John receives the message from King Philip. He can read it in either French or English. He doesn't know French, and his client prefers English so he reads the English translation.

2. Terminology

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [1].

From language -- the original language.

To language -- the language to translate into.

Translation service -- a node on the Jabber network that implements this JEP.

3. Requirements

This JEP describes a means to allow one Jabber user to communicate with another Jabber user who does not speak the same language. This JEP addresses the following requirements:

4. Addressing

A translation service is either a component or a regular node on the Jabber network. Languages are specified by the resource component of the service's JID. The resource component of the JID is split into two parts. A translation service's resource MUST be of the form "from/to". The "from" part specifies the original language, and the "to" part specifies the to language.

A hypothetical translation service's JID will look like "translator@shakespeare.lit/en/jp". "en" specifies that English is the original language, and "jp" specifies that it translates into Japanese. "translator.shakespeare.lit/en/jp" is also a possible address if the service is a component.

That alone does not provide seamless translation, merely translation. Extended Stanza Addressing [4] is used to specify the recipient(s) of the stanza. Stanzas are sent to the translation service which uses the "to" address type to find out who to send the result to. The "replyto" address type is used in place of the stanza's "from" attribute since it will be the translation service's JID. The translation service MUST add the "replyto" address to translated stanzas.

5. Use Cases

The context of the following use cases are the various scenes that make use of a messenger in Shakespeare's King John. The actors are:

Table 1: Actors

translator@shakespeare.lit The translation service. This could very well have been 'translator.shakespeare.lit' if the service was written as a component.
philip@aristocracy.fr King Philip
john@royalfamily.en King John

5.1 Discovering If a JID Is a Translation Service

Example 1. Disco request to determine if a JID is a translation service

<iq type="get" to="translator@shakespeare.lit" from="philip@aristocracy.fr/throne">
  <query xmlns="http://jabber.org/protocol/disco#info"/>
</iq>

      

Example 2. Disco response for a tranlation service

<iq type="result" to="philip@aristocracy.fr/throne" from="translator@shakespeare.lit">
  <query xmlns="http://jabber.org/protocol/disco#info">
    ...
    <feature var="http://jabber.org/protocol/translator"/>
    ...
  </query>
</iq>

      

5.2 Discovering Language Support

Example 3. Language Disco Query

<iq type="get" to="translator@shakespeare.lit" from="john@royalfamily.en/throne">
  <query xmlns="http://jabber.org/protocol/disco#items"/>
</iq>

      

Example 4. Language Disco Result

<iq type="result" to="john@royalfamily.en/throne" from="translator@shakespeare.lit">
  <query xmlns="http://jabber.org/protocol/disco#items">
    <item name="English To French" jid="translator@shakespeare.lit/en/fr"/>
    <item name="French To English" jid="translator@shakespeare.lit/fr/en"/>
    <item name="Italian To French" jid="translator@shakespeare.lit/it/fr"/>
    <item name="French to Italian" jid="translator@shakespeare.lit/fr/it"/>
  </query>
</iq>

      

5.3 Messages

Messages are the primary vehicle of communication within Jabber. Messages are required to be supported by a translation service for that reason. Two cases need to be specified. The first being when a message is sent to the service without extended addressing, and the second when it does have extended addressing.

5.3.1 Message Without Extended Addressing

A message that does not have extended addressing information gets translated, and the translation is sent back to the sender. This could be useful for quick translations.

In the following two examples, King John sends a message to the translation service to have his English translated into Italian.

Example 5. King John Translates A Message

<message to="translator@shakespeare.lit/en/it" from="john@royalfamily.en/throne">
  <subject>Hey</subject>
  <body>Bonjour</body>
</message>

	

When the translation is complete it is sent back to King John. Note how the <subject/> and <body/> are handled. An 'xml:lang' MUST be added to the original child elements, and a translated copy is added to the <message/> with the proper 'xml:lang' attribute. This is so there is no loss of information.

Example 6. Resulting Message

<message to="john@royalfamily.en/throne" from="translator@shakespeare.lit/en/it">
  <subject xml:lang="en">Hey</subject>
  <subject xml:lang="it">Heyo</subject>
  <body xml:lang="en">Bonjour</body>
  <body xml:lang="it">Hola</body>
</message>

	

5.3.2 Message With Extended Addressing

The above use case doesn't satisfy the goal of seamless translation. By adding an <address/> child element as defined in Extended Stanza Addressing [5] this goal can be met.

In the following examples, Juliet sends a message to Romeo. The original is in French and the message Romeo receieves needs to be in Italian.

Example 7. Juliet Sends Message To Romeo

<message to="translator.capulet.fam/fr/it" from="juliet@capulet.fam/tower" type="chat">
  <body>Bonjour</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="to" jid="romeo@montahue.fam">
  </addresses>
</message>

	

The <message/> is addressed to the translation service's French to Italian resource. The <address/> child element specifies that the translation is destined for Romeo.

Example 8. Translated Message As Received By Romeo

<message to="romeo@montahue.fam" from="translator.capulet.fam/fr/it" type="chat">
  <body xml:lang="fr">Bonjour</body>
  <body xml:lang="it">Hola</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="replyto" jid="juliet@capulet.fam/tower">
  </addresses>
</message>

	

Note that the "replyto" <address/> has been added. This was added by the translation service. It is Juliet's JID since she sent the message. The translation service adds the "replyto" to prevent spoofing. If there is already a "replyto" and the "from" JID is not one of the translation service's resources, the message MUST be sent back to the sender with a <not-acceptable/> error condition.

Example 9. The bounced message

<message to="juliet@capulet.fam/tower" from="translator.capulet.fam/fr/it" type="error">
  <body>Bonjour</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="to" jid="romeo@montahue.fam">
    <address type="replyto" jid="juliet@montahue.fam">
  </addresses>
  <error code="406">
    <not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
  </error>
</message>

	

5.4 Presence

Example 10. Sending presence to be translated

<presence to="translator@montahue.fam/en/fr" from="romeo@montahue.fam/hall">
  <show>Online</show>
  <status>Where art thou?</status>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="to" jid="juliet@capulet.fam">
  </addresses>
</presence>

      

Example 11. Translated presence

<presence to="juliet@capulet.fam" from="translator@montahue.fam/en/fr">
  <show>Online</show>
  <status xml:lang="en">Where art thou?</status>
  <status xml:lang="fr">Where art thou?</status>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="replyto" jid="romeo@montahue.fam/hall">
  </addresses>
</presence>

      

<presence/> stanzas that do not include an extended addressing child element MUST be ignored and handled as if they're for the translation service.

5.5 Translating Into Multple Languages

Example 12. Three Languages

<message to="translator@montahue.fam/en/fr" from="romeo@montahue.fam" type="chat">
  <body>Hello</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="to" jid="translator@montahue.fam/en/it">
    <address type="to" jid="translator@montahue.fam/fr/de">
    <address type="to" jid="juliet@capulet.fam">
    <address type="replyto" jid="romeo@montahue.fam">
  </addresses>
</message>

      

Example 13. Message After One Translation

<message to="translator@montahue.fam/en/it" from="translator@montahue.fam/en/fr" type="chat">
  <body xml:lang="en">Hello</body>
  <body xml:lang="fr">Bonjour</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="to" jid="translator@montahue.fam/fr/de">
    <address type="to" jid="juliet@capulet.fam">
    <address type="replyto" jid="romeo@montahue.fam">
  </addresses>
</message>

      

Example 14. Message After Two Translations

<message to="translator@montahue.fam/fr/de" from="translator@montahue.fam/en/it" type="chat">
  <body xml:lang="en">Hello</body>
  <body xml:lang="fr">Bonjour</body>
  <body xml:lang="it">Hola</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="to" jid="juliet@capulet.fam">
    <address type="replyto" jid="romeo@montahue.fam">
  </addresses>
</message>

      

Example 15. Final Message

<message to="juliet@capulet.fam" from="translator@montahue.fam/fr/de" type="chat">
  <body xml:lang="en">Hello</body>
  <body xml:lang="fr">Bonjour</body>
  <body xml:lang="it">Hola</body>
  <body xml:lang="de">Hallo</body>
  <addresses xmlns="http://jabber.org/protocol/address">
    <address type="replyto" jid="romeo@montahue.fam">
  </addresses>
</message>

      

5.6 Multicasting A Translated Message

Example 16. Multicasting A Translated Message

      

6. Errors

Example 17. Invalid Language Pair

    

Example 18. Undeliverable Message

    

7. Business Rules

Stanzas MUST be delivered in the order that they are received, ie: FIFO.

The <subject/> and <body/> child elements of a <message/> stanzas MUST be supported.

The <show/> child element of <presence/> stanzas MUST be supported.

The service MAY require registration either in band or out of band.

The translation service's resource identifier MUST follow the "from/to" pattern.

The translation service MAY add an "xml:lang" set to the from language to elements that it translates that do not already have one.

Child elements MUST NOT be deleted from the original stanza.

8. Implementation Notes

To make the translation service seamless to the end-user, clients and components such as Multi-User Chat [6] MUST honor the "replyto" address.

9. Security Considerations

required

10. IANA Considerations

required

11. Jabber Registrar Considerations

required

12. XML Schema

strongly recommended

13. Acknowledgements

Thanks go out to:


Notes

1. RFC 2119: Key words for use in RFCs to Indicate Requirement Levels <http://www.ietf.org/rfc/rfc2119.txt>.

2. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.

3. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.

4. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.

5. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.

6. JEP-0045: Multi-User Chat <http://www.jabber.org/jeps/jep-0045.html>.


Revision History

Version 0.1 (2004-09-15)

Initial version. ()