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

PO4A:LATEX ifthenelse puts everything in one message #448

Open van-beek opened 6 months ago

van-beek commented 6 months ago

Hi, i am probably overlooking something or doing something wrong.

consider the following latex code:

\section{this is the chapter title}

here is the first paragraph in the document, it will go in the translation
file just fine.

the second paragraph will also be put in the po file just fine.

\ifthenelse{\equal{includesubsections}{1}}{

\subsection{this is the first subsection}

here the text for the subsection is included.

\subsection{this is the second subsection}

here again some text to translate.

but all this paragraphs are put in one msg in de po file.

}{
here is the text if i dont want subsections.

}

then i call the following command to create a pot file: po4a-gettextize -f latex -m latex.tex -p translation.pot

this will generate the following pot file:

# 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: 2023-12-14 10:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: section{#2}
#: latex.tex:2
msgid "this is the chapter title"
msgstr ""

#. type: Plain text
#: latex.tex:5
msgid ""
"here is the first paragraph in the document, it will go in the translation "
"file just fine."
msgstr ""

#. type: Plain text
#: latex.tex:7
msgid "the seccond paragraph will also be put in the po file just fine."
msgstr ""

#. type: subsection{#2}
#: latex.tex:24
msgid "this is the first subsection"
msgstr ""

#. type: ifthenelse{#2}
#: latex.tex:24
msgid ""
"here the text for the subsection is included.  \\subsection{this is the "
"second subsection} here again some text to translate.  but all this "
"paragraphs are put in one msg in de po file."
msgstr ""

#. type: ifthenelse{#3}
#: latex.tex:24
msgid "here is the text if i dont want subsections."
msgstr ""

As you can see in the ifthenelse{#2} everything after the first plain text paragraph is put in one msgid. no separation of the subsection and the second sub paragraph anymore in separate msgid's.

where do i go wrong, or is it a bug in the latex processing?