anotherim/src
Daniel Gultsch 9bf5fb98ac show language in message bubble if multiple language variants were received
XML and by inheritence XMPP has the feature of transmitting multiple language
variants for the same content. This can be really useful if, for example, you
are talking to an automated system. A chat bot could greet you in your own
language.

On the wire this will usually look like this:

```xml
<message to="you">
  <body>Good morning</body>
  <body xml:lang="de">Guten Morgen</body>
</message>
```

However receiving such a message in a group chat can be very confusing and
potentially dangerous if the sender puts conflicting information in there and
different people get shown different strings.

Disabeling support for localization entirely isn’t an ideal solution as on
principle it is still a good feature; and other clients might still show a
localization even if Conversations would always show the default language.

So instead Conversations now shows the displayed language in a corner of the
message bubble if more than one translation has been received.

If multiple languages are received Conversations will attempt to find one in
the language the operating system is set to. If no such translation can be
found it will attempt to display the English string.

If English can not be found either (for example a message that only has ru and
fr on a phone that is set to de) it will display what ever language came first.

Furthermore Conversations will discard (not show at all) messages with with
multiple bodies of the same language. (This is considered an invalid message)

The lanuage tag will not be shown if Conversations received a single body in
a language not understood by the user. (For example operating system set to
'de' and message received with one body in 'ru' will just display that body as
usual.)

As a guide line to the user: If you are reading a message where it is important
that this message is not interpreted differently by different people (like a
vote (+1 / -1) in a chat room) make sure it has *no* language tag.
2019-09-12 10:12:51 +02:00
..
compat/java/eu/siacs/conversations use EmojiWrapperEditText for most relevant text inputs 2018-06-29 13:40:55 +02:00
conversations pulled translations from transifex 2019-08-29 09:48:13 +02:00
free/java/eu/siacs/conversations/services attempt to unregister when receiving push for channel no longer joined 2019-06-26 17:40:12 +02:00
freeCompat/java/eu/siacs/conversations/ui/service EmojiService: use replaceAll=false on android 8 2018-07-05 13:22:32 +02:00
main show language in message bubble if multiple language variants were received 2019-09-12 10:12:51 +02:00
playstore catch more firebase library bugs 2019-08-06 15:04:59 +02:00
playstoreCompat EmojiService: use replaceAll=false on android 8 2018-07-05 13:22:32 +02:00
quicksy pulled translations from transifex 2019-09-09 09:43:10 +02:00
system/java/eu/siacs/conversations use EmojiWrapperEditText for most relevant text inputs 2018-06-29 13:40:55 +02:00