anotherim/src/main/java/eu/siacs/conversations/entities
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
..
AbstractEntity.java added max history age (default 1w). automatically sort newly added mam messages 2014-12-10 14:08:06 +01:00
Account.java migrate copy ond write list to synchronized hashset for pending mucs 2019-06-30 21:57:37 +02:00
Blockable.java migrate to xmpp-addr 2018-03-07 22:30:36 +01:00
Bookmark.java refactored avatar workers into single class 2019-01-25 10:07:02 +01:00
Contact.java refactored avatar workers into single class 2019-01-25 10:07:02 +01:00
Conversation.java resetToWaiting should include http uploaded files 2019-07-20 12:15:06 +02:00
Conversational.java very much unoptimized search functionality 2018-04-26 13:22:31 +02:00
DownloadableFile.java reintroduced fixed IV mode for OTR file transfer. fixes #2595 2017-08-23 22:37:13 +02:00
Edited.java keep track of previously edited ids 2018-12-01 15:52:44 +01:00
IndividualMessage.java show language in message bubble if multiple language variants were received 2019-09-12 10:12:51 +02:00
ListItem.java refactored avatar workers into single class 2019-01-25 10:07:02 +01:00
Message.java show language in message bubble if multiple language variants were received 2019-09-12 10:12:51 +02:00
MTMDecision.java integrate trust manager into conversations 2018-03-07 22:30:33 +01:00
MucOptions.java do not put default nick into bookmark if none has been set before 2019-08-19 13:55:52 +02:00
Presence.java fixed caps hash generation for empty form values 2018-04-22 11:07:00 +02:00
Presences.java cleanup nameWithoutVersion() code 2017-06-24 16:13:55 +02:00
PresenceTemplate.java wip: new status message dialog 2018-03-07 22:30:36 +01:00
RawBlockable.java handle blocking and unblocking of full jids 2019-07-10 17:58:48 +02:00
ReadByMarker.java shorten read markers to 'everyone has read up to this point' when > 4 user 2018-06-30 12:14:42 +02:00
ReceiptRequest.java migrate to xmpp-addr 2018-03-07 22:30:36 +01:00
Roster.java use inContactList() instead inRoster() in the proper places 2018-11-03 16:32:08 +01:00
ServiceDiscoveryResult.java create empty disco result on error to fire advance stream features event 2019-08-13 21:18:32 +02:00
StubConversation.java very much unoptimized search functionality 2018-04-26 13:22:31 +02:00
Transferable.java mark deleted files in database and not query them when querying for media 2019-01-10 14:52:27 +01:00
TransferablePlaceholder.java renamed downloadable to transferable 2015-07-10 15:11:03 +02:00