-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[core] Add script to sync translation files #3201
Conversation
5bf57fc
to
30b2038
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
@m4theushw Cooool, for further automation, we could maybe make the script part of the CI. This would guarantee we never forget about it, nor we have regressions on it. @mui-org/x speaking of CI tools and how we can make our work as maintainers easier. Would it make sense to dedicate some of the weekly meetings to maintain a backlog of tech tasks? Effectively, we could collaborate on the next opportunities. I will propose this topic in the next retrospective, maybe it will resonate with the team, if not, an idea to hurry. |
Currently, we have 22 translation files. It's becoming a pain to keep all of them in sync when a new key is added. I felt that in #2946 when I had to copy the English translation to the other locales. The purpose of this script is to use the English locale as the source of truth, then it goes over all the other files checking, for each key, if a translation was provided or not. If there's a translation it doesn't touch it, but if the translation is missing it automatically copies from the English file and marks it as a comment. The script also keeps the lines in the same order as the source of truth. To add a new key, you only need to first add it to the English locale, then run
yarn l10n
to propagate it to other files.Besides the synchronization, the script is also capable of generating a report (by running
yarn l10n --report
) of the missing translations. Its content is used to update #3211. My idea is automatically update this issue in a GitHub Workflow whenever a new commit is made, similar to #2081.