Skip to content

format-po-gettext: ICU comment needs to be encoded or support multi line #2383

@garikkh

Description

@garikkh

#2347 added a change out of scope to the PR:

one extra change - i made an context comment more readable like so: js-lingui:icu={var, plural, one {one book} other {many books}}&pluralize_on=count,anotherCount,thirdCount,manyCount,superLongVariableNameIsOkayCount

And this change breaks our TMS:

Same issue as in #2004 - if a comment gets too long, our TMS breaks it up into multiple lines, and multiple lines don't get parsed correctly in lingui

With this change, we have an entry:

#. jsi18nicu={hours, plural, one {{hours} hr} other {{hours} hrs}}&pluralize_on=hours
msgid "{hours} hr"
msgid_plural "{hours} hrs"
msgstr[0] "{hours} hr"
msgstr[1] "{hours} hrs"

That our TMS changes to:

#. jsi18nicu={hours, plural, one {{hours} hr} other {{hours}
#. hrs}}&pluralize_on=hours
msgid "{hours} hr"
msgid_plural "{hours} hrs"
msgstr[0] ""
msgstr[1] ""
msgstr[2] ""

And cannot be parsed when doing lingui compile step.

Looking for feedback here, either we revert the changes for having ICU readable, or change the compiling/PO parser to combine the comments. FWIW I attempted the latter, and its fairly involved.

Originally posted by @garikkh in #2347 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions