Skip to content
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

[Proof of concept] Add script to generate locale files, and add PT as locale option. #20330

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benhalpern
Copy link
Contributor

@benhalpern benhalpern commented Nov 8, 2023

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

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 added pt.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.

Copy link
Contributor

github-actions bot commented Nov 8, 2023

Uffizzi Ephemeral Environment deployment-40329

☁️ https://app.uffizzi.com/github.com/forem/forem/pull/20330

📄 View Application Logs etc.

What is Uffizzi? Learn more!

@alvarohurtado84
Copy link

If I may ask, what is the point of this?

You only need translations once. Generating all the locales in another language, even with AI, will rarely be accurate. There is a good community trying to provide translations that are accurate per language and per region: was this PT locale Portuguese or Brazilian or any other variant?

I tried myself in the past by doing it with Spanish from Spain but my requests in Github and in Forem.dev were ignored.

Simply nurturing and taking a little care of the community will provide good translations that will cover the most used languages very rapidly. Just my two cents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants