-
Notifications
You must be signed in to change notification settings - Fork 44
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
Message Translations #123
Comments
@aquelemiguel @afonsojramos I think we discussed this at a certain point. I have an idea of how to do it. Leave it to me if you agree with the issue. |
Yeah, the big move to mostly using the |
Sure, removing other contributors from this. |
Yes, but at the same time, the translations will no longer be stored in code and therefore not part of the release binary. This would make no sense for tons of translations. Currently thinking of storing the translations in JSON files making it easier to change or add new ones without changing the codebase. |
I actually had already investigated a bit on how to do this properly with community integrations and stuff and I've found that platforms such as https://crowdin.com/ or https://weblate.org/en-gb/ offer a really good interface for managing the translations. Maybe it is a bit overkill, what do you think? |
Seems a bit overkill to me but nonetheless when I have time I will look into them. |
Alright, my proposed solution is one that: With that in mind, I propose the following:
Obviously, this means the binary of parrot alone when run will always default to English. The language translations are only available if the deployed parrot instance has local JSON translation files. Alternatively, we can serve the JSON files somewhere and make HTTP requests to fetch them, but I find this overkill. What do you think @afonsojramos @aquelemiguel |
Sorry for taking a while to get on this, but I overall really like your implementation! 🙂
A follow-up question: what if for some reason a translation isn't available? For instance, a contributor that has to add a new constant cannot possibly know every translation. Do we default to English?
Keep it local, easier and encourages easy open-source contributions. 😎 |
The default would be English, yes. It would be basically lookup for JSON file translation (actually this will be loaded into memory at startup) and if it does not exist, use the default string.rs current English messages. |
Sounds good, proceed with the implementation. 🙂 |
Rationale
Add translations to change the default parrot language from English to something else.
Description
The text was updated successfully, but these errors were encountered: