php-translation / symfony-bundle

Symfony integration for Translations
MIT License
327 stars 93 forks source link

lint:xliff translations fails #244

Closed tristanbes closed 6 years ago

tristanbes commented 6 years ago

Hello,

When running command bin/console lint:xliff translations on generated .xlf it fails

 ERROR  in translations/FOSUserBundle.fr.xlf
 * Line 2, Column 0: Element '{urn:oasis:names:tc:xliff:document:2.0}xliff': No matching global declaration available for the validation root.

  ERROR  in translations/messages.fr.xlf
 * Line 2, Column 0: Element '{urn:oasis:names:tc:xliff:document:2.0}xliff': No matching global declaration available for the validation root.

  ERROR  in translations/validators.fr.xlf
 * Line 2, Column 0: Element '{urn:oasis:names:tc:xliff:document:2.0}xliff': No matching global declaration available for the validation root.
// FOSUserBundle.fr.xlf
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:2.0" version="2.0" srcLang="fr" trgLang="fr">
  <file id="FOSUserBundle.fr">
Koalabaerchen commented 6 years ago

Little bit late to the party but: This isn't a problem with this bundle but with the translation component from symfony (where the linter comes from).

The linter only supports xliff 1.2, not 2.0 which your file is (by default).

To still be able to use the linter, you can set the version in the config of this bundle (xliff_version: 1.2) to generate compatible files.