Lemmy: Internationalization - Both back and front end

Created on 8 Apr 2019  Â·  13Comments  Â·  Source: LemmyNet/lemmy

help wanted

Most helpful comment

As a translator, I could provide both German and French (as well as a little Chinese).

All 13 comments

For back-end, you may want to have a look at the gettext and gettext-macros crate.

Sweet, that looks perfect!

Maybe fluent-rs could be of use?

I think Fluent doesn't work so well (at least with the current API) when you have to switch languages regularly, like you have to do if you want to serve each page in a different language (I remember seeing an issue about that).

Also the advantage of the gettext-macros crate is that once configured, it generates translations files automatically for you, and you can just upload them Weblate, Crowdin or whatever to have them translated.

I think Fluent doesn't work so well (at least with the current API) when you have to switch languages regularly

Could you elaborate?

it generates translations files automatically for you

Does one not need to provide it with i18n bundles that are already in files?

Could you elaborate?

This is the issue I was thinking of: https://github.com/projectfluent/fluent-rs/issues/64

So for instance Fluent (at least the Rust version) doesn't provide yet a mechanism to fallback to English (or another language) if a message was not translated.

Does one not need to provide it with i18n bundles that are already in files?

I'm not sure what you mean by "i18n bundles", and to which "files" you refer to… :sweat_smile:

But the idea is that any string wrapped in a i18n! macro will be added to a .pot file that is used as a template for .po files, which contains the real translations.

Both the back and front end can read from the same XML or json language files, that one shouldn't be a problem.

The only stuff on the back end is error messages sent to the front end, so its not too much.

An additional question I have, is, are other projects doing the language stuff as a build step? Or passing a language param to the back end?

Same for front end.

As a translator, I could provide both German and French (as well as a little Chinese).

Okay I finally found a library I like for this on the front end. https://lingui.js.org/tutorials/react.html

Hopefully it'll work with inferno.

I can help with French too

I can assist with Japanese.

Okay this is done, def took a lot of work. I'll create a tag for translations, and assign everyone above. I'd really appreciate anyone adding translation files.

The instructions for adding them are here.

Fixed by #189 .

@pojntfx @uqpu @finkiki okay I've made some translation issues here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dessalines picture dessalines  Â·  6Comments

Nutomic picture Nutomic  Â·  4Comments

l1ving picture l1ving  Â·  5Comments

mateMathieu picture mateMathieu  Â·  6Comments

shirshak55 picture shirshak55  Â·  5Comments