8000 [Translation] Add missing translations using ChatGPT by nicolas-grekas · Pull Request #53417 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Translation] Add missing translations using ChatGPT #53417

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

Merged
merged 1 commit into from
Jan 6, 2024

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Jan 4, 2024
Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

This is a follow up of #53404

The process around the maintenance of our translation files is too heavy currently. I feel like spending hours on the topic, and I guess it's the same for contributors.

Instead, I propose to account for the GPT tools that are really good at translating our short messages.

In order to still allow and call for human review, I propose to use the state="needs-review-translation" on <target> tags as defined by XLIFF.

With some help from carsonbot, we'll be able to call for reviews per language. My proposal would be to make it able to send PRs that remove the state attribute but call for reviews by a native speaker before we could merge. We could even make the reviewer the author of the git commit if we want to keep some sort of history on the topic.

@thunderer I'd prefer being explicit about using GPT. I'm going to replace your PRs by this one sorry.

@thunderer
Copy link
Contributor

@nicolas-grekas I specifically mentioned professional translator, because I actually work with one. I can provide a proof of that if necessary. When I had a native speaker available, I mentioned it explicitly.

@nicolas-grekas
Copy link
Member Author
nicolas-grekas commented Jan 4, 2024

OK, great. I'm surprised you're able to deliver so many languages at this rate.
On my side, the constant stream of PRs on the topic is a burden I'd like to cut, so there is my proposal.
I'd be happy to have reviews on GPT-generated translations instead!

@thunderer
Copy link
Contributor

Hi Nicolas, I was always explicit in my PRs about where the translations come from. I saw that maybe I'll be able to help quicker so I contacted a company and ordered those translations - all of them were made by native speakers or sworn translators, I have asked for that. Since they were ready today, I submitted all PRs. I didn't assign myself until they were ready, to not block anyone who would like to contribute. Would it be possible for you to merge my PRs once I rebase them?

@nicolas-grekas
Copy link
Member Author

Sure, I can do that. If you have more patches on the topic, it'd be nice if you could group them in one PR also. 🙏

@thunderer
Copy link
Contributor

@nicolas-grekas excellent, I'll rebase them shortly.

@thunderer
Copy link
Contributor

@nicolas-grekas all PRs rebased, checked diffs and they update only the <target> line removing the needs-translation attribute. I will group the changes next time for all translations I have available at given time, I'm sorry for causing additional work. I thought that one-PR-per-issue is expected since @carsonbot raised separate issues.

@nicolas-grekas nicolas-grekas force-pushed the tr-gpt branch 2 times, most recently from 467f8f2 to e4fa398 Compare January 4, 2024 14:56
@nicolas-grekas
Copy link
Member Author

PR rebased and ready.

@OskarStark
Copy link
Contributor

@nicolas-grekas what do you think of having a list of native speakers, ready to review such messages, which could then get a ping after ChatGPT proposed a translation?

@carsonbot carsonbot changed the title Add missing translations using ChatGPT [Translation] Add missing translations using ChatGPT Jan 4, 2024
@nicolas-grekas
Copy link
Member Author
nicolas-grekas commented Jan 5, 2024

@OskarStark we would need a way to manage that list. And since things should remain open, people should be able to subscribe and unsubscribe at will.

One idea in this direction could be to have one special issue managed by carsbonbot that is opened/closed when needed, and that people could register to to be notified of when a new translation is needed. Or maybe one issue per language (but I'm not sure this is a good idea as that'd also mean spamming notifications - one single issue wouldn't). @Nyholm WDYT also?

@nicolas-grekas
Copy link
Member Author
nicolas-grekas commented Jan 5, 2024

having a list of native speakers

Oh, another idea would be to add willing translators to .github/CODEOWNER

@thunderer
Copy link
Contributor

@nicolas-grekas I volunteer as tribute for Polish. 😄

@OskarStark
Copy link
Contributor

Oh, another idea would be to add willing translators to .github/CODEOWNER

That wouldn't work, I already had that idea for bridges in Notifier, Mailer etc. but this file only has some effect for members of the repo/orga 😢

Copy link
Member
@yceruto yceruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Spanish translations at least :)

@rosier
Copy link
Contributor
rosier commented Jan 5, 2024

In order to still allow and call for human review, I propose to use the state="needs-review-translation" on <target> tags as defined by XLIFF.

WDYT of using state="needs-review" since the translation is already done by GPT and it just needs to be reviewed?

@nicolas-grekas
Copy link
Member Author

WDYT of using state="needs-review"

It's not in the xliff spec: https://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#state

fabpot added a commit that referenced this pull request Jan 6, 2024
This PR was merged into the 5.4 branch.

Discussion
----------

Add .github/sync-translations.php

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

That's the script I used in #53404

With current branch numbers as example: when adding a new message to translate on 7.1, we would ask the author to add it to the "en.xlf" file on 5.4, to run this script, and only then to send the PR on 5.4
This would ensure new messages are duplicated in all languages.

We could also run chatgpt on that PR to pre-fill all translations, building on #53417

Commits
-------

9c4cb74 Add .github/sync-translations.php
@fabpot
Copy link
Member
fabpot commented Jan 6, 2024

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 355081e into symfony:5.4 Jan 6, 2024
@nicolas-grekas nicolas-grekas deleted the tr-gpt branch January 7, 2024 10:53
nicolas-grekas added a commit that referenced this pull request Jan 9, 2024
… of "This is not" in error messages (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

[Validator] Consistently use "This value is not" instead of "This is not" in error messages

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

That's longer but more understandable. That's also how most messages are constructed already.

Related to #53417

Commits
-------

96c7fbd [Validator] Consistently use "This value is not" instead of "This is not" in error messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants
0