Closed Bug 1677173 Opened 11 months ago Closed 8 months ago

Attribute xml:space="preserve" is lost when translating XLIFF strings

Categories

(Webtools Graveyard :: Pontoon, defect, P2)

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: flod, Assigned: mathjazz)

Details

I'm not exactly sure what the right behavior should be here, but:

  • All strings for the VPN client are marked with xml:space="preserve".
  • When I translate them in Pontoon, the attribute is lost.

Example of commit from Pontoon: https://github.com/mozilla-l10n/mozilla-vpn-client-l10n/commit/8e01685ed7da569d7c537509faa0e48cf2504212

I would expect attributes in the source string to be kept in the translation.

Right now, the automation extracting new strings is also adding these attributes back (example).

Priority: -- → P2

I tried to dig a bit deeper.

Managing xml:space

I think this might have larger functionality implications
http://producthelp.sdl.com/sdl%20trados%20studio/client_en/Ref/U-Z/Options/File_Types/XLIFF_Filter/XLIFF_Whitespace_Handling.htm

SDL does different things with whitespaces depending on that value. It's unclear what happens to the target element (I assume the attribute is maintained).

Is the XLIFF exported by QT libraries incorrect?

Looking at examples from Transifex and others, I noticed that the xml:space attribute is defined on the <trans-unit>, not on the <source> within.

The XLIFF 1.2 specs have xml:space attribute as optional on:

  • <file>
  • <group>
  • <trans-unit>
  • <alt-trans>

There's no mention of <source>.

I think we should morph this bug into a more generic "Handle xml:space in XLIFF file", and fix the VPN string as part of the export automation.

@Matjaz
Thoughts?

Seems like this is indeed a bug on the VPN export side.

We don't have that problem in Firefox for iOS for example, which introduced the xml:space="preserve" attribute as part of the migration to latest Xcode tools. Note that it rightfully puts the attribute in the <trans-unit> element:
https://github.com/mozilla-l10n/firefoxios-l10n/commit/5eab2fed47a6466036f0bd9c4568c57391968bba

If we'll need to add the ability to manage space differently based on the value of the xml:space attribute, we should file a separate bug for that.

Assignee: nobody → m
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → INVALID
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.