Skip to content

Feature Request: Add Support for XLIFF 2.x Files #96

@Kanti

Description

@Kanti

Description
Currently, the grumphp-config package (through pluswerk/grumphp-xliff-task) supports linting for XLIFF files — but this appears to target XLIFF 1.2 only.
Modern translation workflows and frameworks (e.g. Symfony 6+, TYPO3 12+, and many CAT tools) increasingly use XLIFF 2.0/2.1, which are not fully compatible with XLIFF 1.x.

Adding support for XLIFF 2.x would ensure that GrumPHP checks remain relevant for current localization pipelines.


Why this matters

  • XLIFF 2.x is the official OASIS standard and is now widely adopted.
  • Some projects have fully migrated to .xlf files using version="2.0" or "2.1".
  • Without explicit support, valid files may fail validation or be skipped.

Proposed Implementation

  • Detect the XLIFF version via the root attribute (version="2.0" or "2.1").
  • Use appropriate XML Schema validation for XLIFF 2.x (available from OASIS).
  • Add a configuration flag, e.g.:
parameters:
    tasks:
      xlifflint:
        xliff_version: 2.1
  • Fallback to 1.2 if unspecified (to maintain backward compatibility).

Example

<xliff version="2.0" srcLang="en" trgLang="de">
  <file id="homepage">
    <unit id="welcome">
      <segment>
        <source>Hello world!</source>
        <target>Hallo Welt!</target>
      </segment>
    </unit>
  </file>
</xliff>

Expected Behavior

  • GrumPHP validates XLIFF 2.0/2.1 files correctly.
  • No false positives or XML schema errors for valid modern .xlf files.
  • Clear validation errors when XLIFF 2.x structure is invalid.

References


Environment

  • grumphp-config version: latest
  • grumphp-xliff-task version: latest
  • PHP version: n/a

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions