-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Translate playban feedback #17093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate playban feedback #17093
Conversation
| def abort(pov: Pov): Unit = tell(pov, s"i18n.${trans.playbanFeedbackAbort} {user}") | ||
|
|
||
| def noStart(pov: Pov): Unit = tell(pov, s"Warning, {user}. Failing to start games $tempBan") | ||
| def noStart(pov: Pov): Unit = tell(pov, s"i18n.${trans.playbanFeedbackNoStart} {user}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suddenly we're sending i18n keys to the chat, where before there only was human-readable text.
this means that all clients displaying chats must now support these i18n keys.
the 2 mobile apps currently don't, and will instead show i18n.playbanFeedbackNoStart to the end user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted.
As we can't translate on the fly, it seems that there are only 2 options left:
- Keep Lichess messages in English in the chat
- Send the translated text (2 messages if the 2 players speak different languages)
ui/chat/src/ctrl.ts
Outdated
| private onMessage = (line: Line): void => { | ||
| if (line.u === 'lichess' && line.t.startsWith('i18n.')) { | ||
| this.translateLichessFeedback(line); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we only convert i18n messages when received from the WS, they'll remain untranslated when (re)loading the page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I saw the Lichess messages disappear from the chat when reloading ... I have to check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this particular message is not stored, but other potentially translatable messages are.
|
So, this adds the concept of storing i18n keys in the chat database, and sending i18n keys as chat messages to clients, where before it only was human text. This needs to be implemented in every client, of which we support 3: the website, the old app, and the new app. When the app implements translatable chat messages, then it will become nearly impossible to change the format. So it's important to get it right the first time. This is not right. It only works for translations that have one argument, which is the username. It's incredibly specific and won't generalize to other translatable chat messages. |
e92640d to
79b35f3
Compare
|
I agree ... I'll concentrate on the modal dialog first .... EDIT: actually I can't (concentrate on the modal dialog first). It seems to be generated listening to the chat events |
Follow up on #17074
Feedback is displayed (translated in the user's language) in the chatroom and in the modal dialog (if the user is the offender)