-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] Add a new lint:translation command #19942
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
Comments
I like this idea. But I'd think a bit more about the options of the command. It's common for this kind of commands to have two modes: 1) "show the changes to do but don't make them", 2) "make those changes". In this example, The other issue to think about is if we want to allow to select the fixers: reorder, add missing, etc. or we want to run all of them at once. Finally, I'd like to have a list of proposed fixers. For example:
|
@javiereguiluz I agree with you, it makes sense to make changes for I suppose, we'd like to have some format-specific fixers, for example, for YAML translations: # inline
post.no_comments: No comments
post.no_posts: No posts
# or expanded
post:
no_comments: No comments
no_posts: No posts I'm also wondering in the best way of original translation determination. I think we should provide |
@bocharsky-bw did you considered Ie. extending the update command with
Last but not least, the command could be moved to the translation component like the |
Hey @ro0NL , I think single What about formatting YAML translation files: I think doing the same operation with different commands is a bad idea. The command should determine translation file format by itself and process it properly. |
Maybe you're right, and 2 commands could work
About (re)formatting; this only affects inline vs. expanded (ie. dot notation yes/no) and is definitely translation related, but only for YAML+PHP. Im more or less leaning to something like |
There are quite some bundles that do a nice job on this, or am I mistaking on the scope of your issue here? ;) https://github.com/schmittjoh/JMSTranslationBundle |
A command changing the file should not be named |
Even if this idea is changed to only provide a linter command and not a fixer, I'd love to see it happen. (Context -> this morning, a minor error in a XLIFF translation file completely broke a bundle release: https://github.com/javiereguiluz/EasyAdminBundle/pull/1490) |
@javiereguiluz we right now have the |
…es (javiereguiluz) This PR was squashed before being merged into the 3.3-dev branch (closes #21578). Discussion ---------- [Translation] Added a lint:xliff command for XLIFF files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19942 | License | MIT | Doc PR | - It works exactly the same as the `lint:yaml` command: ### Lint a single file  ### Lint a bundle  ### Get the result in JSON  Commits ------- 7609e44 [Translation] Added a lint:xliff command for XLIFF files
Hi, guys!
I'd like to open a PR for implementing a new console command for translations:
First of all, I'd like to say that maintain translations is a difficult process, especially if we want to keep them consistent with each other. I mean: fix syntax, keep message order in sync in different files, add missing translation messages, etc.).
Actually, we can see it in the example of Symfony Demo project though this is a small project. This problem is even more relevant for big projects. Symfony Web Debug Toolbar helps with missed translations, but its tips relate to the opened page only (the page that developer's viewing right now). That's why I want to suggest this new console command.
What do you think about it?
The text was updated successfully, but these errors were encountered: