Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mquinson/po4a
Browse files Browse the repository at this point in the history
  • Loading branch information
mquinson committed Dec 31, 2023
2 parents e5404b3 + 15accb2 commit e897995
Show file tree
Hide file tree
Showing 18 changed files with 193 additions and 29 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Asciidoc:
(GitHub's #424). Thanks Jean-Noël Avila for the pull request.
* Keep original formating (GitHub's #416). Thanks suddenfall for
the feedback, and Jean-Noël Avila for the fixes.
* Fix a bug in handling of bold text starting a list item
(GitHub's #447). Thanks Jean-Noël Avila for the pull request.
* Fix handling of linebreaks in lists (GitHub's #444). Thanks
Jean-Noël Avila for the pull request.

Tex:
* Allow verbatim environment declaration without trailing space
Expand Down
13 changes: 5 additions & 8 deletions lib/Locale/Po4a/AsciiDoc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,9 @@ sub parse {
$paragraph = $text . "\n";
$self->{indent} = "";
$self->{bullet} = $bullet;
} elsif ( not defined $self->{verbatim}
and ( $line eq " +") ) {
$paragraph .= $line . "\n";
} elsif ( ( $line =~ /^\s*$/ ) and ( !defined( $self->{type} ) or ( $self->{type} ne "Table" ) ) ) {

# When not in table, empty lines or lines containing only spaces do break paragraphs
Expand Down Expand Up @@ -1058,7 +1061,7 @@ sub parse {

if ( ( $paragraph ne "" && $self->{bullet} && length( $self->{indent} || "" ) == 0 ) )
{
if ( !$self->{options}{'nolinting'} ) {
if ( ( !$self->{options}{'nolinting'} ) && ($paragraph !~ m/ \+\n/ ) ) {
# Second line of an item block is not indented. It is unindented
# (and allowed) additional text or a new list item.
warn wrap_mod(
Expand All @@ -1080,12 +1083,6 @@ sub parse {
$paragraph .= $line . "\n";
}

# paragraphs starting by a bullet, or numbered
# or paragraphs with a line containing many consecutive spaces
# (more than 3)
# are considered as verbatim paragraphs
$wrapped_mode = 0 if ( $paragraph =~ m/^(\*|[0-9]+[.)] )/s
or $paragraph =~ m/[ \t][ \t][ \t]/s );
( $line, $ref ) = $self->shiftline();
}
if ( length $paragraph ) {
Expand Down Expand Up @@ -1196,7 +1193,7 @@ sub do_paragraph {
}

@comments = ();
if ( defined $self->{bullet} ) {
if ( ( defined $self->{bullet} ) && !($t =~ /\+\n/ ) ) {
my $bullet = $self->{bullet};
my $indent1 = $self->{indent};
my $indent2 = $indent1 . ( ' ' x length($bullet) );
Expand Down
19 changes: 6 additions & 13 deletions po/pod/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ msgid ""
msgstr ""
"Project-Id-Version: po4a 0.20\n"
"Report-Msgid-Bugs-To: [email protected]\n"
"POT-Creation-Date: 2023-12-30 20:49+0100\n"
"PO-Revision-Date: 2023-08-17 03:01+0200\n"
"POT-Creation-Date: 2023-10-21 17:16+0200\n"
"PO-Revision-Date: 2023-10-21 17:26+0200\n"
"Last-Translator: Marco Ciampa <[email protected]>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/po4a/po4a-doc/it/"
">\n"
Expand Down Expand Up @@ -1562,11 +1562,7 @@ msgid ""
"file, you must specify the format parser to use, the location of the "
"translated document to produce, and optionally some configuration. File "
"names should be quoted or escaped if they contain spaces. Here is an example:"
msgstr ""
"È necessario elencare anche i documenti che devono essere tradotti. Per ogni "
"file master, bisogna specificare l'elaboratore del formato da usare, la "
"posizione del documento tradotto da produrre, e opzionalmente qualche "
"configurazione. Ecco un esempio:"
msgstr "È necessario elencare anche i documenti che devono essere tradotti. Per ogni file master, bisogna specificare l'elaboratore del formato da usare, la posizione del documento tradotto da produrre, e opzionalmente qualche configurazione. Se i nomi dei file dovessero contenere degli spazi, a questi ultimi dovranno essere apposti dei caratteri di escape oppure i nomi interi dovranno essere essere messi tra virgolette. Ecco un esempio:"

#. type: verbatim
#: po4a:134
Expand All @@ -1585,8 +1581,7 @@ msgid ""
" de:doc/de/script.xml\n"
"\n"
msgstr ""
" [type: sgml] doc/my_stuff.sgml fr:doc/fr/mon_truc.sgml \\\n"
" de:doc/de/mein_kram.sgml\n"
" [type: sgml] \"doc/my stuff.sgml\" \"fr:doc/fr/mon truc.sgml\" de:doc/de/mein\\ kram.sgml\n"
" [type: man] script fr:doc/fr/script.1 de:doc/de/script.1\n"
" [type: docbook] doc/script.xml fr:doc/fr/script.xml \\\n"
" de:doc/de/script.xml\n"
Expand Down Expand Up @@ -2168,10 +2163,8 @@ msgstr "COPYRIGHT E LICENZA"
#. type: textblock
#: po4a:192 po4a-gettextize:81 po4a-normalize:34 po4a-translate:59
#: po4a-updatepo:58
#, fuzzy
#| msgid "Copyright 2002-2022 by SPI, inc."
msgid "Copyright 2002-2023 by SPI, inc."
msgstr "Copyright 2002-2022 by SPI, inc."
msgstr "Copyright 2002-2023 by SPI, inc."

#. type: textblock
#: po4a:193 po4a-gettextize:82 po4a-normalize:35 po4a-translate:60
Expand Down Expand Up @@ -5096,7 +5089,7 @@ msgid ""
"L<Jamulus|https://jamulus.io/> (markdown, yaml, HTML): a FOSS application "
"for online jamming in real time. The website documentation is maintained in "
"multiple languages using po4a."
msgstr ""
msgstr "L<Jamulus|https://jamulus.io/> (markdown, yaml, HTML): un'applicazione FOSS per il jamming online in tempo reale. La documentazione del sito viene mantenuta in più lingue tramite po4a."

#. type: textblock
#: doc/po4a.7.pod:153
Expand Down
15 changes: 15 additions & 0 deletions t/fmt/asciidoc/LineBreak.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,18 @@ __________________________
This is a Quote block. +
This is a Quote block.
__________________________

. List item section 1
. List item section 2 +
+
Another section of list item 2

Further text


* List item section A
* List item section B +
+
Another section of list item B
Further text
19 changes: 17 additions & 2 deletions t/fmt/asciidoc/LineBreak.norm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This is a paragraph with a linebreak, where the linebreak occurs on second line
The second part of the paragraph is on a second line.

* We can do the same with a list item +
After the linebreak, the bullet point is continued.
After the linebreak, the bullet point is continued.
* In this bullet point, the list item is continued on the next line. +
Then the line is broken in a second part.
Then the line is broken in a second part.

..........................
This is a Literal block. +
Expand All @@ -17,3 +17,18 @@ __________________________
This is a Quote block. +
This is a Quote block.
__________________________

. List item section 1
. List item section 2 +
+
Another section of list item 2

Further text


* List item section A
* List item section B +
+
Another section of list item B

Further text
39 changes: 39 additions & 0 deletions t/fmt/asciidoc/LineBreak.po
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,42 @@ msgid ""
msgstr ""
"THIS IS A QUOTE BLOCK.\n"
"THIS IS A QUOTE BLOCK."

#. type: Plain text
#: LineBreak.adoc:25
msgid "List item section 1"
msgstr "LIST ITEM SECTION 1"

#. type: Plain text
#: LineBreak.adoc:28
#, no-wrap
msgid ""
"List item section 2\n"
"\n"
"Another section of list item 2"
msgstr ""
"LIST ITEM SECTION 2\n"
"\n"
"ANOTHER SECTION OF LIST ITEM 2"

#. type: Plain text
#: LineBreak.adoc:30 LineBreak.adoc:37
msgid "Further text"
msgstr "FURTHER TEXT"

#. type: Plain text
#: LineBreak.adoc:33
msgid "List item section A"
msgstr "LIST ITEM SECTION A"

#. type: Plain text
#: LineBreak.adoc:36
#, no-wrap
msgid ""
"List item section B\n"
"\n"
"Another section of list item B"
msgstr ""
"LIST ITEM SECTION B\n"
"\n"
"ANOTHER SECTION OF LIST ITEM B"
33 changes: 33 additions & 0 deletions t/fmt/asciidoc/LineBreak.pot
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,36 @@ msgid ""
"This is a Quote block.\n"
"This is a Quote block."
msgstr ""

#. type: Plain text
#: LineBreak.adoc:25
msgid "List item section 1"
msgstr ""

#. type: Plain text
#: LineBreak.adoc:28
#, no-wrap
msgid ""
"List item section 2\n"
"\n"
"Another section of list item 2"
msgstr ""

#. type: Plain text
#: LineBreak.adoc:30 LineBreak.adoc:37
msgid "Further text"
msgstr ""

#. type: Plain text
#: LineBreak.adoc:33
msgid "List item section A"
msgstr ""

#. type: Plain text
#: LineBreak.adoc:36
#, no-wrap
msgid ""
"List item section B\n"
"\n"
"Another section of list item B"
msgstr ""
19 changes: 17 additions & 2 deletions t/fmt/asciidoc/LineBreak.trans
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ THIS IS A PARAGRAPH WITH A LINEBREAK, WHERE THE LINEBREAK OCCURS ON SECOND LINE
THE SECOND PART OF THE PARAGRAPH IS ON A SECOND LINE.

* WE CAN DO THE SAME WITH A LIST ITEM +
AFTER THE LINEBREAK, THE BULLET POINT IS CONTINUED.
AFTER THE LINEBREAK, THE BULLET POINT IS CONTINUED.
* IN THIS BULLET POINT, THE LIST ITEM IS CONTINUED ON THE NEXT LINE. +
THEN THE LINE IS BROKEN IN A SECOND PART.
THEN THE LINE IS BROKEN IN A SECOND PART.

..........................
THIS IS A LITERAL BLOCK. +
Expand All @@ -17,3 +17,18 @@ __________________________
THIS IS A QUOTE BLOCK. +
THIS IS A QUOTE BLOCK.
__________________________

. LIST ITEM SECTION 1
. LIST ITEM SECTION 2 +
+
ANOTHER SECTION OF LIST ITEM 2

FURTHER TEXT


* LIST ITEM SECTION A
* LIST ITEM SECTION B +
+
ANOTHER SECTION OF LIST ITEM B

FURTHER TEXT
3 changes: 3 additions & 0 deletions t/fmt/asciidoc/Lists.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,6 @@ After deciding the fate for all hunks, if there is any hunk that was chosen, the
* [x] Checked
* [X] Checked
* [*] Checked
1. *starting* with
a strong item
2 changes: 2 additions & 0 deletions t/fmt/asciidoc/Lists.norm
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,5 @@ After deciding the fate for all hunks, if there is any hunk that was chosen, the
* [x] Checked
* [X] Checked
* [*] Checked

1. *starting* with a strong item
7 changes: 6 additions & 1 deletion t/fmt/asciidoc/Lists.po
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,11 @@ msgid "Unchecked"
msgstr "UNCHECKED"

#. type: Plain text
#: Lists.adoc:248 Lists.adoc:249
#: Lists.adoc:248 Lists.adoc:249 Lists.adoc:250
msgid "Checked"
msgstr "CHECKED"

#. type: Plain text
#: Lists.adoc:252
msgid "*starting* with a strong item"
msgstr "*STARTING* WITH A STRONG ITEM"
7 changes: 6 additions & 1 deletion t/fmt/asciidoc/Lists.pot
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,11 @@ msgid "Unchecked"
msgstr ""

#. type: Plain text
#: Lists.adoc:248 Lists.adoc:249
#: Lists.adoc:248 Lists.adoc:249 Lists.adoc:250
msgid "Checked"
msgstr ""

#. type: Plain text
#: Lists.adoc:252
msgid "*starting* with a strong item"
msgstr ""
2 changes: 2 additions & 0 deletions t/fmt/asciidoc/Lists.trans
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,5 @@ AFTER DECIDING THE FATE FOR ALL HUNKS, IF THERE IS ANY HUNK THAT WAS CHOSEN, THE
* [x] CHECKED
* [X] CHECKED
* [*] CHECKED

1. *STARTING* WITH A STRONG ITEM
8 changes: 8 additions & 0 deletions t/fmt/asciidoc/Paragraphs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,11 @@ If --stdin was also used then this is prefixed by either "pack\t", or "keep\t" i
new .keep file was successfully created. This is useful to remove a
.keep file used as a lock to prevent the race with 'git repack'
mentioned above.
TIP: we're starting a
multi-line
Tip box.
TIP: *now bold*
text in
the beginning
4 changes: 4 additions & 0 deletions t/fmt/asciidoc/Paragraphs.norm
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ NOTE: This is my special note.
NOTE: What lovely war.

If --stdin was also used then this is prefixed by either "pack\t", or "keep\t" if a new .keep file was successfully created. This is useful to remove a .keep file used as a lock to prevent the race with 'git repack' mentioned above.

TIP: we're starting a multi-line Tip box.

TIP: *now bold* text in the beginning
12 changes: 11 additions & 1 deletion t/fmt/asciidoc/Paragraphs.po
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ msgid "What lovely war."
msgstr "WHAT LOVELY WAR."

#. type: Plain text
#: Paragraphs.adoc:61
#: Paragraphs.adoc:62
msgid "If --stdin was also used then this is prefixed by either \"pack\\t\", or \"keep\\t\" if a new .keep file was successfully created. This is useful to remove a .keep file used as a lock to prevent the race with 'git repack' mentioned above."
msgstr "IF --STDIN WAS ALSO USED THEN THIS IS PREFIXED BY EITHER \"PACK\\T\", OR \"KEEP\\T\" IF A NEW .KEEP FILE WAS SUCCESSFULLY CREATED. THIS IS USEFUL TO REMOVE A .KEEP FILE USED AS A LOCK TO PREVENT THE RACE WITH 'GIT REPACK' MENTIONED ABOVE."

#. type: Plain text
#: Paragraphs.adoc:66
msgid "we're starting a multi-line Tip box."
msgstr "WE'RE STARTING A MULTI-LINE TIP BOX."

#. type: Plain text
#: Paragraphs.adoc:69
msgid "*now bold* text in the beginning"
msgstr "*NOW BOLD* TEXT IN THE BEGINNING"
12 changes: 11 additions & 1 deletion t/fmt/asciidoc/Paragraphs.pot
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,20 @@ msgid "What lovely war."
msgstr ""

#. type: Plain text
#: Paragraphs.adoc:61
#: Paragraphs.adoc:62
msgid ""
"If --stdin was also used then this is prefixed by either \"pack\\t\", or "
"\"keep\\t\" if a new .keep file was successfully created. This is useful to "
"remove a .keep file used as a lock to prevent the race with 'git repack' "
"mentioned above."
msgstr ""

#. type: Plain text
#: Paragraphs.adoc:66
msgid "we're starting a multi-line Tip box."
msgstr ""

#. type: Plain text
#: Paragraphs.adoc:69
msgid "*now bold* text in the beginning"
msgstr ""
4 changes: 4 additions & 0 deletions t/fmt/asciidoc/Paragraphs.trans
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ NOTE: THIS IS MY SPECIAL NOTE.
NOTE: WHAT LOVELY WAR.

IF --STDIN WAS ALSO USED THEN THIS IS PREFIXED BY EITHER "PACK\T", OR "KEEP\T" IF A NEW .KEEP FILE WAS SUCCESSFULLY CREATED. THIS IS USEFUL TO REMOVE A .KEEP FILE USED AS A LOCK TO PREVENT THE RACE WITH 'GIT REPACK' MENTIONED ABOVE.

TIP: WE'RE STARTING A MULTI-LINE TIP BOX.

TIP: *NOW BOLD* TEXT IN THE BEGINNING

0 comments on commit e897995

Please sign in to comment.