[Proof of concept] Add script to generate locale files, and add PT as locale option. #20330
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.
What type of PR is this? (check all applicable)
Description
We have had a chicken/egg problem of not necessarily having a line-of-site towards being able to fully complete and make functional use of our locale setting due to the maintenance burden of multiple locales.
This PR adds a bin script to automatically generate locale files, always using
/../../en.yml
as the source of truth.Unlike other auto-translators, this asks GPT-4 to evaluate the full context of the file and make intelligent, context-rich decisions about which terms to prefer.
This could be improved over time in a variety of ways — including adding more comments to the
/../../en.yml
files to provide more assurance that the script will understand the context and make the appropriate choice.This PR updated our
fr.yml
files and addedpt.yml
, as Portuguese visitors are some of the more popular visitors of the platform. If this POC works, we can use this as a forcing function to finish localization functionality and make it usable across many languages.Note: There are a few times where the yml breaks and I reverted to the original. For this to work ideally, this should be caught as part of the script itself, but for now it is not.