Element-web: i18n the app

Created on 20 Jan 2016  路  20Comments  路  Source: vector-im/element-web

Created by @ matthew:matrix.org.

feature p2

Most helpful comment

All 20 comments

eternaleye points out we could use l20n.org for this.

Or if using webpack, maybe just write a simple translate function. Put translations for each locale in individual modules, and let webpack import them?

EDIT: l20n can be used with webpack.

I tried something like git grep "Type a message" in the repo but cannot find any matching string. Am I missing something?

Yup. vector-web has 4 layers: vector-web, matrix-react-sdk,
matrix-js-sdk and then synapse on the backend. Currently all 4 layers
can emit human-readable messages, which makes i18n a bit tougher than it
should be (but not /that/ bad).

In this instance, matrix-react-sdk contains that bit of UI.

@ara4n Thanks for the explanation.
Should probably wait until the layers are separated.

well, the top 3 layers are all webpacked together, and all of them are separated. So i wouldn't hold off on this necessarily; just a heads up that we do sometimes leak errors from synapse into the UI, which ideally should be i18nized too.

Oh OK. I would be happy to help. I need to spend sometime going through the code.

I think if we can settle on a i18n library/framework now can start using it for new strings, it would serve as a good start for the migration of existing strings.

I'm keen to start work on this, but I'm no js prorammer ... what should I do?

According to this https://alicoding.com/localizing-react-app-using-react-router-with-react-intl/ I shoul start collecting en-US.json file, do I?

I hope someone from the core team can kick this started and then it's easier for us to follow.

I believe we could start something helpfull on our own ...

Maybe first document where most UI strings are?

For example:
Some are inside React components' JSX template:
https://github.com/matrix-org/matrix-react-sdk/tree/develop/src/components/views

The second type is error messages, like this https://github.com/matrix-org/matrix-js-sdk/blob/develop/lib/client.js#L661 . I am not sure how much of the error messages will end up in the UI.

Should the localization code and strings exists in all of vector-web, matrix-react-sdk and matrix-js-sdk. Or should there be another repo for the purpose of localization and is depended on by all 3 repos?

@ara4n

I could also help on this work, after the structure is set. I could start searching for strings, replacing them by i18n constants and build mo/po files. We just need to have structure built.

I'd be happy to do a german translation as soon as there are auto-generated translation string files. Would help to make riot more parent-compatible. 馃槃 馃帉

Any progress here?

I'll join the translation team for spanish and catalan translations.

Hi, we have made a pull request with a proposal to i18n the app.

https://github.com/matrix-org/matrix-react-sdk/pull/800

I can help for french.

i18n has now landed on develop, thanks to MTRNord & everyone else who has contributed. There's still lots of languages to be contributed (including a lot of French!) - https://github.com/vector-im/riot-web/blob/develop/docs/translating.md has the instructions for doing so. Closing this one up :)

Was this page helpful?
0 / 5 - 0 ratings