ZF-8383: Zend_Translate_Adapter_Xliff: use own attribut trans-unit id as array keys for $this->_translate instead of source strings




Transunit ID is an optional element so we can not use it because it's optional.

Additionally you forgot the negs of such an change. * when something is not translated your user would get cryptic keys * when something changes in your source the xliff tool would not be aware of the change as there would be no connex between source and target * within your source there would be no way for the author (which could be another person than the coder) to know what is meant without looking into the translation file

"Transunit ID is an optional element so we can not use it because it's optional."

Transunit ID is required in XLIFF 1.1 and 1.2 Specification: "The required id attribute is used to identify the within the file".……

This does not change what I said before.

When you are in need of short translations, also within your code like you wrote before you should use the mentioned "id" as source.

Changing the behaviour of this single adapter to something which does not conform how translation is done in the rest of this framework is actually no option.

It's a pity that it is not possible to implement an optional paramater (for reasons of backward compatibility) to instruct the adapter to select the Transunit ID and not the source string as array key.

No for this feature.

It would change behaviour in relation to all other adapters. Additionally it would add the above described problems.

When you are in need of a "special" version you can still simply extend the related adapter and create your own specialized version.


Compared with TMX format which are both from LISA. Based on TMX I agree to add such an option for XLIFF.

Based on the xliff standard the usage was fixed. Integrated with r19457.