-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Use i18n Keys #4397
Use i18n Keys #4397
Conversation
Hi @amanape Does this change seem fine? If so, I'll make similar changes to the rest of the repo. |
Yes, that's the correct way to do it. Don't worry about trying to get the other translations in though, you can focus on English only for now. I recommend converting this PR to a draft if you're thinking of continuing |
Hi @Vaishakh-SM @amanape , just some questions, to start helping on the process 1. do you think its best to keep all the translations in one file?As a positive I see everithing is centralized and as a negative the file might grow too large. 2. If so, do you think its worth grouping the elements on the Json structure itself?I see currently the resources are prefixed, so for example {
"CODE_EDITOR": {
"SAVE_LABEL": {
"en": "Save",
"zh-CN": "保存",
}
}
} Using the resource would be similar using dot notation I understand if probably the better choice is to work as it is, because this change is already big enough and changing the standard would require modify the parts that are already translated; I just wanted to bring it up in case you think something is worth changing before starting. 3. What would be the standard to leave the resources pending to be translated?If you leave the key missing then the system will take the resource of the default language (English) which I think its a good behavior, but leaving the key missing could also reduce visibility for the pending translations 4. How could I support without generating git conflicts?This one goes more to you @Vaishakh-SM, Im sorry, I have never co-authored a PR here on github, so, how would be the better way? do I push changes to the same branch? do I create a new branch and PR changes to yours, or how is it better to proceed?. Because we would be modifying the same file I don't want to create git conflicts Thanks |
Hey @danicruz0415, thanks for your input. To answer your questions:
No, I do not. The recommended way in the official documentation would be to have a translations file per language. (e.g.,
Yes, that is a good alternative and I can see it improve DX for the time being. As a side note, since the major UI changes, there are actually a lot of translations that are no longer required, but left over. In reality, there are only a few keys currently being used.
As is. IF we had individual translation files, it would be easy for other individuals to extend it.
I think one strategy would be to agree on certain routes/components to work on, on separate PRs. There will be some conflict since some routes re-use certain components, but it would expected and shouldn't be too difficult to resolve. You can see a basic map of the FE here: https://github.com/All-Hands-AI/OpenHands/tree/main/frontend#project-structure Thanks a lot for taking this up! Feel free to open another PR mentioning the routes/components you plan to cover |
The strategy to avoid conflicts sounds good to me! @danicruz0415 I'll take up the routes that you aren't once you open up your PR. |
Hi! I've opened this PR: #4464 @Vaishakh-SM if its ok by you I can take the "components/modals" folder I leave the error that I was having, and the solution in case someone stumbles upon it, as googling it did not show many results
It seems that this syntax where you set up an environment variable before running the command is not recognized by windows PowerShell (see this SO Question). The solution is to remove the env variable (change the "dev" script inside the @amanape do you think this is worth mentioning on the troubleshoot section of the readme? It might be that is a trivial error just that I am not too familiar with it, so it took me a little to figure it out jeje |
Sure! Do you plan on taking up any other folders? |
Hi @Vaishakh-SM sorry, I wasn't sure which ones needed translation so I mentioned the one I was testing with 🙈 🟦 means does not need localization
If its ok by you I can take the folders I am not sure if anything outside the components folder needs any localization. As far as I saw it didn't. |
Thanks for the hard work of categorizing the files! Sorry for the late response. Yes, this seems fine to me. I'll start working on the files outside these folders. |
Hello @Vaishakh-SM just checking in to see if this is generally on your radar still. |
Hi! |
@Vaishakh-SM if you need any help or a review let me know! 😄 |
Hey Dani! |
Hey @Vaishakh-SM, there have been a significant amount of app-wide changes and will be a few more by the end of this week. Your branch is out of date and requires these conflicts to be resolved. Unfortunately, since it is a branch on your fork, nobody but you can make write changes to them. If you're struggling with resolving the conflicts, I would recommend opening a new branch that is synced with the latest changes. |
…ndant label in translation to a generic CLOSE label
9eb2fa6
to
4787dc7
Compare
Hi @amanape , I've opened PR#5286 which is synced with latest main. Still seems like some checks are failing (if I understand, this is because some tests try to find the element from the alt texts) but I think we can continue the discussion in that PR (If so I'll close this PR)? |
The tests are failing because the text content has changed. This is expected since you're changing hardcoded values to dynamic ones with the help of the i18n library. It is safe to close this PR |
End-user friendly description of the problem this fixes or functionality that this introduces
Right now, several instances of plain English language are used in the codebase. Using i18 keys would ensure better inclusivity by enabling users to use different languages.
Link of any specific issues this addresses
Issue#4280