Update moz.l10n to 0.11.2 and translate-toolkit to 3.19.3#4028
Update moz.l10n to 0.11.2 and translate-toolkit to 3.19.3#4028eemeli merged 2 commits intomozilla:mainfrom
Conversation
Just to make sure I understand: if we have a Fluent translation with leading whitespaces, so far these would get dropped when serializing. Wouldn't that result in the translation being imported from VCS without the leading whitespaces? Assuming my understanding is correct — which I doubt — I think this will result in no change in serialized content, and no need for migrations? |
|
The code looks good!
What is the motivation for this change? Could you provide example entities / translations where the behaviour will be different? |
|
I think I'd misremembered that Fluent ignored all leading indents, as in fact it only ignores common indents. I submitted mozilla/moz-l10n#129 to fix that; this PR will need a subsequent update to incorporate that change. After that, the treatment of leading spaces should be unchanged from the previous. |
flodolo
left a comment
There was a problem hiding this comment.
Tried a forced sync locally, nothing strange happened.

The significant change here is moz.l10n's Fluent serialization, which now by default correctly escapes syntactical content found in text spans. Mostly this shows up by leading whitespace now getting escaped in FTL files; previously any leading whitespace in a Fluent translation was effectively dropped. The non-default behaviour is enabled with
escape_syntax=False, and is used during pretranslation.If it's desirable that we do not include leading whitespace in formatted outputs, we'll need to include a migration here.
This fixes #4003 thanks to moz.l10n now considering
%@in the Android translation as a placeholder, so that its introduction is an error because a matching one isn't included in the original source.The translate-toolkit update is coming along for the ride, to allow for lxml 6.0 as a transitive dependency, due to mozilla/moz-l10n#118.