Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Provide missing translations thanks to Gemini #60445

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
May 18, 2025
Merged

Conversation

nicolas-grekas
Copy link
Member

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

@carsonbot carsonbot added this to the 6.4 milestone May 17, 2025
@nicolas-grekas
Copy link
Member Author

Generate a CSV file where the following sentence is translated in all those languages. The first column is the language, the second the translation.
The sentence : This value is not a valid Twig template.
The languages: af,ar,az,be,bg,bs,ca,cs,cy,da,de,el,es,et,eu,fa,fi,fr,gl,he,hr,hu,hy,id,it,ja,lb,lt,lv,mk,mn,my,nb,nl,nn,no,pl,pt_BR,pt,ro,ru,sk,sl,sq,sr_Cyrl,sr_Latn,sv,th,tl,tr,uk,ur,uz,vi,zh_CN,zh_TW

Then I run this script:

foreach (file('trans.csv') as $line) {
    [$lang, $tr] = explode(',', rtrim($line), 2);

    $file = \sprintf('src/Symfony/Component/Validator/Resources/translations/validators.%s.xlf', $lang);
    echo $file;
    $content = file_get_contents($file);
    $content = str_replace(
        '<target state="needs-translation">This value is not a valid Twig template.</target>',
        \sprintf('<target state="needs-review-translation">%s</target>', $tr),
        $content
    );
    file_put_contents($file, $content);
}

@chalasr
Copy link
Member

chalasr commented May 17, 2025

Missing translations are nice first contributions, do we really want to remove that? If yes should we trust Gemini's content blindly? Maybe ping native people who've already touched the files for review?

@nicolas-grekas
Copy link
Member Author

We do this since a few months now, so I'd say yes.
They're still to validate. Carsonbot to help track.

@fabpot
Copy link
Member

fabpot commented May 18, 2025

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 4c45d9c into symfony:6.4 May 18, 2025
10 of 11 checks passed
@nicolas-grekas nicolas-grekas deleted the trans branch May 18, 2025 08:29
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.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.