[internal] Add script to sync translation files#3201
Merged
m4theushw merged 6 commits intomui:masterfrom Nov 23, 2021
Merged
Conversation
5bf57fc to
30b2038
Compare
Contributor
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
flaviendelangle
approved these changes
Nov 23, 2021
alexfauquette
approved these changes
Nov 23, 2021
Member
|
@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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 l10nto 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.