-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form][Security][Validator] Normalize translation files #53404
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
Conversation
But this will make it hard to know if a translation is missing or not. Do we really want to force users to do this? $missing = $original !== $translation |
src/Symfony/Component/Form/Resources/translations/validators.az.xlf
Outdated
Show resolved
Hide resolved
f06e7de
to
6aa5cec
Compare
I added |
src/Symfony/Component/Security/Core/Resources/translations/security.th.xlf
Show resolved
Hide resolved
src/Symfony/Component/Security/Core/Resources/translations/security.en.xlf
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
(Just update according to the test. Ie, the test is correct. )
29a5a7f
to
1cc9bc0
Compare
PR ready, tests fixed! |
I don't think the current xliff reader takes |
@nicolas-grekas I'm wondering, this will cause conflicts in all existing translation PRs, would it be possible to merge them before this one? Afterwards it seems like you could rerun the script to update the files. |
Oh.. Does this mean my fallback locale is never used?
If |
Indeed. Updated! |
@@ -111,6 +111,10 @@ private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, s | |||
continue; | |||
} | |||
|
|||
if (isset($translation->target) && 'needs-translation' === (string) $translation->target->attributes()['state']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would deserve a changelog entry IMO, while sneaking it in the normalization PR makes it invisible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #54541
@nicolas-grekas can you update carsonbot to make it aware of those |
…tor implementations to be used (xabbuh) This PR was merged into the 5.4 branch. Discussion ---------- [Form][Security][Validator] prevent incompatible Translator implementations to be used | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #53404 (comment) | License | MIT Commits ------- 86a21dd prevent incompatible Translator implementations to be used
…tor implementations to be used (xabbuh) This PR was merged into the 5.4 branch. Discussion ---------- [Form][Security][Validator] prevent incompatible Translator implementations to be used | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix symfony/symfony#53404 (comment) | License | MIT Commits ------- 86a21dd578 prevent incompatible Translator implementations to be used
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
…colas-grekas) This PR was merged into the 5.4 branch. Discussion ---------- [Translation] Add missing translations using ChatGPT | 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.~ Commits ------- 2bbbff9 Add missing translations using ChatGPT
I will open a bug report, because ignoring translations that have a Edit: #54541 |
I tackled this aspect in #54536 |
Ah no sorry, not the exact same topic 😬 |
I used the below script to spot mistakes and normalize translation files.
I propose to accept English where translations are missing because this makes it easier to automate and also to spot what's missing (opening only one file is needed.)
Carsonbot would need to be updated to account for this when checking for missing translations /cc @Nyholm