Skip to content
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

Translations not supported #1309

Open
rkfg opened this issue Apr 8, 2020 · 4 comments
Open

Translations not supported #1309

rkfg opened this issue Apr 8, 2020 · 4 comments
Labels

Comments

@rkfg
Copy link

rkfg commented Apr 8, 2020

In particular, in Riot web the room name says "Empty room (was ..." when the other user leaves. This string can't be localized so it looks bad when everything else is in another language.

Related code:

return `Empty room (was ${memberNamesToRoomName(leftNames)})`;

Same issue with memberNamesToRoomName function, it always sets the room name to "{user1} and {user2}" for a room with 3 participants regardless of the current locale.

@turt2live
Copy link
Member

It is supported, but there's some obvious gaps. We'll use this issue to track those.

@turt2live turt2live changed the title Is localization supported? Default room names in js-sdk cannot be translated Apr 8, 2020
@turt2live
Copy link
Member

ah, I thought this was on riot-web. i18n is not supported at this level.

@turt2live turt2live changed the title Default room names in js-sdk cannot be translated Translations not supported Apr 8, 2020
@rkfg
Copy link
Author

rkfg commented Apr 8, 2020

I guess it's best to move these UI bits to riot-web or React SDK so they can be translated properly. As I understand, this repo is the network part of Riot, why does it set the room names based on the number of participants in it in the first place? Looks like a UI/UX part to me, not the protocol one.

@turt2live
Copy link
Member

This isn't that low level. The js-sdk is more intended for client developers, which is why it has some of the spec's UI/UX features embedded into it.

MadLittleMods added a commit to matrix-org/matrix-react-sdk that referenced this issue Apr 3, 2023
See #10432 (comment)

The HTTPError already has a good label and it isn't even translated if we re-label it here in this way generically

Probably best to just remove in favor of thinking about a translations in general from the `matrix-js-sdk`, see matrix-org/matrix-js-sdk#1309
andybalaam pushed a commit to matrix-org/matrix-react-sdk that referenced this issue Apr 14, 2023
* Properly translate errors in AddThreepid.ts

Part of element-hq/element-web#9597

* Use translated message

* Avoid returning undefined ever

* More usage

* Introduce UserFriendlyError

* Use UserFriendlyError

* Add more usage instead of normal error

* Use types and translatedMessage

* Fix lints

* Update i18n although it's wrong

* Use unknown for easier creation from try/catch

* Use types

* Use error types

* Use types

* Update i18n strings

* Remove generic re-label of HTTPError

See #10432 (comment)

The HTTPError already has a good label and it isn't even translated if we re-label it here in this way generically

Probably best to just remove in favor of thinking about a translations in general from the `matrix-js-sdk`, see matrix-org/matrix-js-sdk#1309

* Make error message extraction generic

* Update i18n strings

* Add tests for email addresses

* More consistent error logging to actually see error in logs

* Consistent error handling

* Any is okay because we have a fallback

* Check error type

* Use dedicated mockResolvedValue function

See #10432 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants