Problem/Motivation

When doing translation imports using XLIFF format, Drupal\tmgmt_file\Plugin\tmgmt_file\Format\Xliff::validateImport() compares existing IDs, source and target language codes with the recieved translation data.

However, when comparing source/target languages it takes letter-casing into account. This can be an issue as there are some translation services that update this information.

From https://www.w3.org/International/articles/language-tags/:

The entries in the registry follow certain conventions with regard to upper and lower letter-casing. For example, language tags are lower case, alphabetic region subtags are upper case, and script tags begin with an initial capital. This is only a convention! When you use these subtags you are free to do as you like, unless you are constrained by the rules of the system you are working with. For HTML and XML language markup, the case should not matter.

Proposed resolution

We could try to skip letter-casing comparison when validating XLIFF imports in Drupal\tmgmt_file\Plugin\tmgmt_file\Format\Xliff::validateImport().

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mbovan created an issue. See original summary.

mbovan’s picture

cburschka’s picture

Status: Active » Closed (duplicate)

I think this is the same as #2866391: Check XLiff source/target langcodes case-insensitively. (patch exists, but note it's a few months old).

cburschka’s picture

(The #2866391 patch does not cover the ::validateCustom bug in #2894500, but it could be extended to fix both at once.)