Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Init i18n #192

Closed
mvaivre opened this issue Apr 4, 2022 · 11 comments · Fixed by #269
Closed

Init i18n #192

mvaivre opened this issue Apr 4, 2022 · 11 comments · Fixed by #269
Assignees
Labels
feature New feature

Comments

@mvaivre
Copy link
Member

mvaivre commented Apr 4, 2022

Translating the wallet would increase accessibility and broaden the potential audience of the app.
It's a relatively low hanging fruit, easy to implement using for instance react-i18next.

It would also be a wonderful opportunity to involve our community to provide translations (cc/ @Sakrecoer )

@mvaivre mvaivre added the feature New feature label Apr 4, 2022
@Sakrecoer
Copy link

Thanks for cc:ing me! I applause the initiative and agree with the benefits! It will be a pleasure to help make this happen!

@lf94 lf94 added the investigation Research and design task label May 5, 2022
@nop33
Copy link
Member

nop33 commented May 10, 2022

I suppose then that all English texts from the wallet would live inside a yaml or json file, right? Then, maybe we could find some tools that integrate with GitHub and allow the community to easily make PRs to add translations! win-win!

@lf94
Copy link
Contributor

lf94 commented May 10, 2022

It'd be better to use more official internationalization technology like gettext: https://en.wikipedia.org/wiki/Gettext
It's fairly ubiquitous.

@lf94 lf94 self-assigned this May 18, 2022
@lf94
Copy link
Contributor

lf94 commented May 18, 2022

/cc @mvaivre @nop33 what tech do you want to settle on?

@nop33
Copy link
Member

nop33 commented May 19, 2022

I don't know what tools are out there, I would need to do research. But first, we gotta define our requirements. I would propose the following requirements, please, feel free to extend:

  1. Good integration with React
  2. We can easily involve the community in adding translations (there are easy to use tools available for non-tech people)

@lf94
Copy link
Contributor

lf94 commented May 19, 2022

I'll conduct some quick research since it's assigned to me 🙂

@mvaivre
Copy link
Member Author

mvaivre commented May 24, 2022

As said in the description, I had some good experiences with react-i18next! It's lightweight, straightforward, ships with a handy useTranslation hook (works on React and React Native, so same interface), and is based on simple json files. But I'm curious to see if new alternatives exist.

@LeeAlephium
Copy link
Contributor

Well like I said, po files are accepted by a lot of translation services, whereas json which can be structured in any way may not be as common (non-standard)... Haven't gotten around to looking at anything but I wouldn't be surprised if react-i18next reads them too or has a tool for conversion 🙂

@mvaivre
Copy link
Member Author

mvaivre commented May 24, 2022

After a quick research, it seems like most of the translation services now support JSON (this, that, this one, that one (by the creators of i18next)...), and there are ways to convert po <-> json if needed. So it seems like we should rather focus on comparing the Devx of the different solutions! 👓

@LeeAlephium
Copy link
Contributor

i18next looks just fine then :)

https://www.i18next.com/principles/fallback#key-fallback makes me happy to see, but I'm surprised it's not recommended:

While this works and might reduce files to load it makes the management of translations a lot harder as you will need to update changes to fallback values in code and JSON files.
Possible - but not recommended.

I find it's the opposite: people have preferred po over time because you don't lose the semantics of what you're translating, and if one is missing it will fallback to the "source of truth" translation (English). Regardless you will have to change key names if the semantics change, which happen all the time, and a short key name is usually not sufficient to capture semantics.

@nop33
Copy link
Member

nop33 commented Jul 8, 2022

When I was working for the open source software Indico, we were using Transefix as the service to upload our json files so that translators have a smooth experience in translating them. I remember it offers a free tier for open source projects. Might be interesting for us.

Here's a preview of the current localization status of Indico for example https://www.transifex.com/indico/indico/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants