Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Improve the lint:xliff command #26537

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

Closed
javiereguiluz opened this issue Mar 15, 2018 · 0 comments
Closed

[FrameworkBundle] Improve the lint:xliff command #26537

javiereguiluz opened this issue Mar 15, 2018 · 0 comments

Comments

@javiereguiluz
Copy link
Member

Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? no
Symfony version 4.1

The lint:xliff command validates the XML syntax of the XLIFF translation files, but it's common to make other mistakes like the following:

 <!-- messages.fa.xlf -->
 <?xml version="1.0" encoding="utf-8"?>
 <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
-    <file source-language="en" target-language="en" datatype="plaintext" original="file.ext">
+    <file source-language="en" target-language="fa" datatype="plaintext" original="file.ext">

In my experience it's pretty common to forget update the target-language value and keep the original one (en in this case). So, could we improve lint:xliff to detect and report this error too? Question to translation and XLIFF experts:

  • Should we do this?
  • Is this really an error? The app works great even if target-language is wrong? Does Symfony ignore this? Is it on purpose or a bug too?
  • Are there other common XLIFF errors that we could fix too?

Thanks!

@javiereguiluz javiereguiluz added this to the 4.1 milestone Mar 15, 2018
@fabpot fabpot closed this as completed Mar 30, 2018
fabpot added a commit that referenced this issue Mar 30, 2018
This PR was squashed before being merged into the 4.1-dev branch (closes #26682).

Discussion
----------

Improved the lint:xliff command

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #26537
| License       | MIT
| Doc PR        | -

This is how it looks:

![lint-xliff-output](https://user-images.githubusercontent.com/73419/37958502-fd8732e0-31b0-11e8-8688-8644ca930daf.png)

Commits
-------

6bbcc45 Improved the lint:xliff command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants