-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Translation] XliffLintCommand: allow .xliff file extension #32548
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
In other parts of the application I think we said: So, in theory, we shouldn't merge this for consistency ... or we should add support for |
My opinion is that if symfony is able to load .xliff files (which it is without any problems), it should be able to lint these .xliff files. On this line (218 on master):
The linter explicitly loads .xlf and .xliff files. So this pull-request fixes a bug where xliff files are being loaded by the linter (removing that would be a BC break in my opinion), but can't be properly linted because of the wrong regex. |
(should target 4.4 btw) |
@nicolas-grekas Sorry, I'm unfamiliar with the GitHub branch targeting. I think I screwed this up >.< EDIT: Ok, I think I got it reversed, will check how to target 4.4 |
@nicolas-grekas I added another error message if "xliff" is used with strict mode enabled. Could you have a look at it again? Altough that change does not resolve my issue, because I am using strict mode unintentionally and I found no "easy" way to disable it. The flag to enable strict mode is set to "true" by default in the constructor. I think there should be an option like "--no-strict-mode" to disable it via the command line. |
@codegain but why don't you use the |
@nicolas-grekas I am using poeditor.com for translations which only works with .xliff files and shows the error "File format unsupported" if an .xlf file is uploaded. According to a section in the specs for XLIFF 1.2 (http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html):
the .xlf extension is recommeded, but not strictly required. The XLIFF 2.0 specs (http://docs.oasis-open.org/xliff/xliff-core/v2.0/xliff-core-v2.0.html) make no preference towards any file extension. |
Did you report the issue to poeditor? That's where the real issue is to me. |
@nicolas-grekas Their response:
I had no idea that any sort of "iOS xliff" exists, because it works perfectly fine with symfony xlf files (if I change the extension to ".xliff").
|
Thanks for the details. If everybody else is OK to seamlessly accept |
@nicolas-grekas @Tobion Just to clarify: Should the command now seamlessly accept .xliff files (without an additional error message) or raise an error if .xliff is used in strict mode? |
I would accept loading both without any messages. |
Thank you @codegain. |
…nsion (codegain) This PR was merged into the 4.4 branch. Discussion ---------- [Translation] XliffLintCommand: allow .xliff file extension | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | License | MIT I ran into a problem with XLIFF files having an *.xliff extension and a "target-language" attribute. The command always outputted: There is a mismatch between the language included in the file name and the value used used in the "target-language" attribute of the file. The "target-language" attribute was set to "en" and the filename was also "menu.en.xliff". After reading the source code, I realized that this regex does not respect other valied file extensions such as "xliff" for these files and therefore throws this (rather confusing) error. Commits ------- dba6a21 [Translation] XliffLintCommand: allow .xliff file extension
I ran into a problem with XLIFF files having an *.xliff extension and a "target-language" attribute.
The command always outputted: There is a mismatch between the language included in the file name and the value used used in the "target-language" attribute of the file.
The "target-language" attribute was set to "en" and the filename was also "menu.en.xliff".
After reading the source code, I realized that this regex does not respect other valied file extensions such as "xliff" for these files and therefore throws this (rather confusing) error.