Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docbook: comment is moved to wrong location for nested labels #295

Open
xry111 opened this issue Feb 20, 2021 · 2 comments
Open

docbook: comment is moved to wrong location for nested labels #295

xry111 opened this issue Feb 20, 2021 · 2 comments

Comments

@xry111
Copy link

xry111 commented Feb 20, 2021

test.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>

<chapter>
  <title>Test</title>

  <!-- some comment -->

  <screen><userinput>/path/to/command --some-arg</userinput></screen>
</chapter>

test.po:

# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2021-02-20 15:02+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: Content of: <chapter><title>
#: test.xml:7
msgid "Test"
msgstr "测试"

#.  some comment 
#. type: Content of: <chapter><screen>
#: test.xml:11
#, no-wrap
msgid "<userinput>/path/to/command --some-arg</userinput>"
msgstr "<userinput>/path/to/command --some-arg</userinput>"

The output of po4a-translate -f docbook -m test.xml -p test.po is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
]>

<chapter>
  <title>测试</title>

  

  <screen><!-- some comment -->
<userinput>/path/to/command --some-arg</userinput></screen>
</chapter>

Now we have a leading empty line in the box, if we convert it to a HTML page.

@mquinson
Copy link
Owner

I think that the easiest would it be to remove the comments in the translated file all together.

Would it work for you?

@xry111
Copy link
Author

xry111 commented Feb 21, 2021

I think that the easiest would it be to remove the comments in the translated file all together.

Would it work for you?

Yes. I'm currently using a very complicated sed to do it.

xry111 added a commit to xry111/lfs-book-i18n that referenced this issue Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants