[XEP-0171] Clarifying standard error conditions for translation services
Hi everyone, While implementing and reviewing XEP-0171 (Language Translation), I noticed that the specification currently defines very limited error handling (Section 4.3 only mentions <bad-request/> and <item-not-found/>). In real-world translation service scenarios, servers frequently need to communicate various rejection reasons to clients. However, the current specification does not explicitly define them. I suggest clarifying these error conditions to ensure consistency across different implementations. These error conditions fully adhere to RFC 6120, and descriptive details can be included within the standard <text/> element: 1. Rate limiting / Server busy / Overload Condition: <resource-constraint/> (type='wait') Description: The system currently lacks the resources to service this stanza; signals the client to back off and retry later. 2. Unsupported language pair or translation engine Condition: <feature-not-implemented/> (type='cancel') Description: The request format is valid, but the service does not support the requested language combination or specified engine. 3. Text payload exceeds maximum length Condition: <not-acceptable/> (type= 'modify') Description: The text length exceeds the per-request processing limit; signals the client to truncate or split the text before retrying. 4. Source language auto-detection failed Condition: <bad-request/> (type= 'modify') Description: The input content is too ambiguous or unrecognizable; prompts the client to explicitly specify the 'source_lang' attribute and resend. 5. Content policy / safety filter violation Condition: <policy-violation/> (type='cancel') Description: The submitted content violates service operational rules or safety policies. 6. Quota exhausted / Paid subscription required Condition: <subscription-required/> (type='auth') Description: The translation quota has been exhausted, or an active subscription plan is required (RFC 6120 natively provides this condition specifically for subscription scenarios). Looking forward to your thoughts.
In practice, users may encounter text in a language they don’t recognize. However, the current specification requires the source language to be specified when requesting a translation. In this case, I use und to indicate that the language is unknown, allowing the translation server to attempt automatic language detection. The server can also declare this capability using a combination such as source_lang="und" and destination_lang="en" to indicate that it supports automatic language detection when translating into English. Another tricky issue is that XEP-0171 lists supported translations as language pairs. If a translation engine supports 20 languages in both directions, that means 400 entries, which is far too many. Modern translation services usually list supported source and target languages separately and have a separate option for automatic language detection.
I've put together a set of fixes for XEP-0171 (Language Translation, v1.1.1). Diff: https://github.com/jinyu2022/xeps/blob/xep-0171-protocol-update/xep-0171.xml <huxiangkun2003@gmail.com> 于2026年10月28日周三 01:16写道:
In practice, users may encounter text in a language they don’t recognize. However, the current specification requires the source language to be specified when requesting a translation. In this case, I use und to indicate that the language is unknown, allowing the translation server to attempt automatic language detection.
The server can also declare this capability using a combination such as source_lang="und" and destination_lang="en" to indicate that it supports automatic language detection when translating into English.
Another tricky issue is that XEP-0171 lists supported translations as language pairs. If a translation engine supports 20 languages in both directions, that means 400 entries, which is far too many. Modern translation services usually list supported source and target languages separately and have a separate option for automatic language detection. _______________________________________________ Standards mailing list -- standards@xmpp.org To unsubscribe send an email to standards-leave@xmpp.org
Currently, the spec requires declaring full source–target pairs. For 100 languages, that blows up to ~10,000 pairs, which feels a bit excessive. I'm considering listing languages individually instead—both source & target by default, with opt-out flags: ``` <item> <engine jid='translation.shakespeare.lit' name='SYSTRANS 2005 Release 2' source_detection='1'> <!-- By default, each language is both a source and a target. Same-language pairs are excluded. --> <lang xml:lang='en' name='English'/> <lang xml:lang='fr' name='French'/> <lang xml:lang='zh-Hans' source='false'/> <lang xml:lang='ko' target='false'/> </engine> </item> ``` Also, I’m undecided on how best to handle source auto-detection. Which approach makes more sense to you? An engine attribute: source_detection='1' A special entry: <lang xml:lang='und' target='false'/>
participants (2)
-
huxiangkun2003@gmail.com -
yiwei wu