mquinson / po4a

Maintain the translations of your documentation with ease (PO for anything)
http://po4a.org/
GNU General Public License v2.0
121 stars 58 forks source link

Asciidoc / Only first line of a multiline attributes is recognized as assignment #414

Closed suddenfall closed 1 year ago

suddenfall commented 1 year ago

When I define a multiline attribute in an adoc file like this:

:myvar: {var1} + \
{var2} + \
{var3}

I got an po-file output like this:

#. type: Plain text
#: accessories.adoc:13
msgid "{var2} + \\ {var3}"
msgstr ""

At first, I thought, it is an issue with the recognition of "+ \". After further tests I am of the opinion that the attribute is not recognized as a multiline definition. If the definition were recognized as multiline, then the output {var2} + \\ {var3} should not be in the po-file.

bug.zip

jnavila commented 1 year ago

There's an issue here: asciidoctor and legacy asciidoc do not manage multi-line attributes the same way:

Only the legacy version is handled right now.

suddenfall commented 1 year ago

Wow, that's very remarkable how extensively you research everything. I appreciate that!

I'm not a Perl programmer, but I took a look at your pull request. Wow again, the bug fix is even implemented with test cases. Very nice.

I have also have checked out and tested your pull request. And yes, it works perfectly.

Thanks for your fast bug fixing!

Should I close this issue or is someone else doing it?

jnavila commented 1 year ago

Fast indeed. But alas, the tests do not cover the cases when the attribute is not managed by po4a, and there was of course a bug on this part. I will push a fix shortly.

jnavila commented 1 year ago

For the issue, please let the merge of the PR close it automatically.

mquinson commented 1 year ago

[A]las, the tests do not cover the cases when the attribute is not managed by po4a, and there was of course a bug on this part. I will push a fix shortly.

Maybe you could commit this change directly w/o resorting on a PR? Would you like to have the push right, @jnavila, or do you prefer to rely on PR?

jnavila commented 1 year ago

Hi, I'm (very selfishly) only interested in the asciidoc support and not breaking it for git manpages translation. If this qualifies for push right, then ok. I'll still use PR in order to "document" the changes anyway.

mquinson commented 1 year ago

Hello, this definitely qualifies for the push right. If there is an issue blocking you, I don't want to be the blocking point preventing you from fixing it by yourself. I'm confident that you won't overuse it, but I feel better when you can fix problems even if my laptop gets stolen or something.