Skip to content

xliff-file with duplicate key - let error say what file is affected #30762

Closed
@Schmalitz

Description

@Schmalitz

Symfony version(s) affected: 3.4.23

Description
If you work with various translation xliff-files and one of these has a duplicate key, the error message doesn't say what file is affected:
Invalid resource provided: "1.2"; Errors: [ERROR 1877] Element '{urn:oasis:names:tc:xliff:document:1.2}trans-unit': Duplicate key-sequence ['76'] in key identity-constraint '{urn:oasis:names:tc:xliff:document:1.2}K_unit_id'. (in /var/www/tickeos/web/ - line 314, column 0)

How to reproduce

  • use Symfony\Component\Translation\TranslatorInterface trans()
  • include a xliff-file with duplicate keys e.g.
    <trans-unit id="76">...</trans-unit><trans-unit id="76">...</trans-unit>

Possible Solution

  • error says what file is affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)Translation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions