zulip / zulip

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
https://zulip.com
Apache License 2.0
21.37k stars 7.76k forks source link

Fix i18n issues with "(no topic)". #3639

Open showell opened 7 years ago

showell commented 7 years ago

We need to start storing no-topic topics as the empty string (or null) in the database, and then only use "(no topic)" or other translations of "(no topic)" in the presentation layer. Otherwise, it will be tricky going forward to allow ordinary users to edit no-topic messages to have a topic, unless we iterate through all the translations.

Also, if I have my browser set to language X, but I am on a realm where language Y is primarily spoken, then I want the "(no topic)" wording to be appropriate for the reader, not for me.

As part of fixing this, we'll need some migration strategy or a decision to only fix messages going forward (but maybe be backward compatible at least for English messages).

showell commented 7 years ago

see #2273 for more implementation details

showell commented 6 years ago

@rishig This is still technically a pitfall, as we have at least one place in our code like below, and this won't match for non-English sites:

 is_no_topic_msg = (message.topic_name() == "(no topic)")
timabbott commented 6 years ago

I think what we probably want to do for this is having the topic in the database be "" and then do the internationalized translation of that to "(no topic)" in clients. The only thing which is tricky about that approach is that it's kinda annoying from an API perspective.

zulipbot commented 3 years ago

Hello @zulip/server-i18n, @zulip/server-message-view, @zulip/server-misc members, this issue was labeled with the "area: internationalization", "area: message-editing", "area: topics" labels, so you may want to check it out!