{"record":{"id":"73b1db53e5c4cfd5","repo":"symfony/translation","slug":"no-support-implemented-for-dumping-xliff-version-s","errorCode":null,"errorMessage":"No support implemented for dumping XLIFF version \"%s\".","messagePattern":"No support implemented for dumping XLIFF version \"(.+?)\"\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"Dumper/XliffFileDumper.php","lineNumber":49,"sourceCode":"        $xliffVersion = '1.2';\n        if (\\array_key_exists('xliff_version', $options)) {\n            $xliffVersion = $options['xliff_version'];\n        }\n\n        if (\\array_key_exists('default_locale', $options)) {\n            $defaultLocale = $options['default_locale'];\n        } else {\n            $defaultLocale = \\Locale::getDefault();\n        }\n\n        if ('1.2' === $xliffVersion) {\n            return $this->dumpXliff1($defaultLocale, $messages, $domain, $options);\n        }\n        if ('2.0' === $xliffVersion) {\n            return $this->dumpXliff2($defaultLocale, $messages, $domain);\n        }\n\n        throw new InvalidArgumentException(\\sprintf('No support implemented for dumping XLIFF version \"%s\".', $xliffVersion));\n    }\n\n    protected function getExtension(): string\n    {\n        return $this->extension;\n    }\n\n    private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ?string $domain, array $options = []): string\n    {\n        $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony'];\n        if (\\array_key_exists('tool_info', $options)) {\n            $toolInfo = array_merge($toolInfo, $options['tool_info']);\n        }\n\n        $dom = new \\DOMDocument('1.0', 'utf-8');\n        $dom->formatOutput = true;\n\n        $xliff = $dom->appendChild($dom->createElement('xliff'));","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/symfony/translation/blob/ae9e8a51bc29780d63c7f9efd6005d7c875e100b/Dumper/XliffFileDumper.php#L31-L67","documentation":"Version guard in XliffFileDumper::formatCatalogue(): the 'xliff_version' option passed to format()/dump() is neither '1.2' nor '2.0' (the only versions with dump implementations), so the dumper cannot serialize the message catalogue and throws with the unsupported version substituted into the message.","triggerScenarios":"Calling dump()/formatCatalogue() with options ['xliff_version' => 'something-other-than-1.2-or-2.0'], e.g. '2.1', '1.0', or a typo.","commonSituations":"Wanting to dump XLIFF 2.1 (unsupported by this dumper); typo'd version string in config; copying options from another tool.","solutions":["Pass the option explicitly: $dumper->format($catalogue, 'messages', ['xliff_version' => '1.2']) or '2.0'.","Omit 'xliff_version' to use the default version 1.2.","If the file must be XLIFF 2.1/2.x, dump as 2.0 or post-process the output; no other versions are supported."],"exampleFix":"// before\n$dumper->dump($catalogue, ['path' => $dir, 'xliff_version' => '2.1']);\n// after\n$dumper->dump($catalogue, ['path' => $dir, 'xliff_version' => '2.0']);","handlingStrategy":"validation","validationCode":"$v = $options['xliff_version'] ?? '1.2'; if (!in_array($v, ['1.2','2.0'], true)) { throw new \\InvalidArgumentException(\"Unsupported XLIFF version {$v}; use 1.2 or 2.0\"); }","typeGuard":"function isSupportedXliffVersion(string $v): bool { return in_array($v, ['1.2','2.0'], true); }","tryCatchPattern":"try { $dumper->dump($catalogue, $options); } catch (InvalidArgumentException $e) { if (str_contains($e->getMessage(), 'XLIFF version')) { // fall back to default version } }","preventionTips":["Treat xliff_version as an enum of exactly '1.2' or '2.0' in your config layer","Don't assume newer XLIFF versions (2.1+) are supported by Symfony's dumper","Add a smoke test dumping one catalogue with each configured version"],"tags":["symfony","translation","xliff","unsupported-version"],"backgroundTag":"invalid-enum-value","analyzedSha":"ae9e8a51bc29780d63c7f9efd6005d7c875e100b","analyzedAt":"2026-09-15T22:29:15.305Z","contentChangedAt":"2026-09-15T22:29:15.305Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}