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

Asciidoctor/Table support #353

Closed
dbaio opened this issue Jan 22, 2022 · 2 comments
Closed

Asciidoctor/Table support #353

dbaio opened this issue Jan 22, 2022 · 2 comments

Comments

@dbaio
Copy link
Contributor

dbaio commented Jan 22, 2022

At this moment seems po4a only supports simple Asciidoctor Tables.

Single example:

Source file.
PO file.

po4a-gettextize \
        --format asciidoc \
        --option compat=asciidoctor \
        --option yfm_keys=title,part,description \
        --master "po4a-asciidoctor-table-single.adoc" \
        --master-charset "UTF-8" \
        --copyright-holder "The FreeBSD Project" \
        --package-name "FreeBSD Documentation" \
        --po "po4a-asciidoctor-table-single.po"

-->

#. type: Table
#: po4a-asciidoctor-table-single.adoc:15
#, no-wrap
msgid ""
"|Cell in column 1, header row |Cell in column 2, header row\n"
"\n"
"|Cell in column 1, row 2\n"
"|Cell in column 2, row 2\n"
"\n"
"|Cell in column 1, row 3\n"
"|Cell in column 2, row 3\n"
"\n"
"|Cell in column 1, row 4\n"
"|Cell in column 2, row 4\n"
msgstr ""

It combines all content into a single string, making it difficult to translate, especially when the table has much information.

Table with a operator (Advanced example) for the record:

Source file.
PO file.

#. type: Table
#: po4a-asciidoctor-tables.adoc:21
#, no-wrap
msgid ""
"| Meaning\n"
"| Examples\n"
"\n"
"\n"
"|The names of commands.\n"
"|Use `ls -l` to list all files.\n"
"\n"
"|The names of files.\n"
"|Edit [.filename]#.login#.\n"
"\n"
"|On-screen computer output.\n"
"a|\n"
"\n"
msgstr ""

#. type: Table
#: po4a-asciidoctor-tables.adoc:30
msgid ""
"....  You have mail.  ....  |What the user types, contrasted with on-screen "
"computer output.  a|"
msgstr ""

#. type: Table
#: po4a-asciidoctor-tables.adoc:47
msgid ""
"....  % date +\"The time is %H:%M\" The time is 09:18 ....  |User and group "
"names.  |Only `root` can do this.  |Emphasis.  |The user _must_ do this.  "
"|Text that the user is expected to replace with the actual text.  |To search "
"for a keyword in the manual pages, type `man -k _keyword_` |Environment "
"variables.  |`$HOME` is set to the user's home directory."
msgstr ""

It's hard to translate when there is the a operator and chunk of code into the content.
...

https://docs.asciidoctor.org/asciidoc/latest/tables/format-column-content/
https://docs.asciidoctor.org/asciidoc/latest/tables/format-cell-content/#a-operator

@jnavila
Copy link
Collaborator

jnavila commented Jan 22, 2022

Try using the option tablecells of the asciidoc format:

po4a-gettextize \
        --format asciidoc \
        --option compat=asciidoctor \
        --option tablecells=1 \
        --option yfm_keys=title,part,description \
        --master "po4a-asciidoctor-table-single.adoc" \
        --master-charset "UTF-8" \
        --copyright-holder "The FreeBSD Project" \
        --package-name "FreeBSD Documentation" \
        --po "po4a-asciidoctor-table-single.po"

@dbaio
Copy link
Contributor Author

dbaio commented Jan 22, 2022

Perfect, thanks for this info @jnavila.
Not a bug; it's working fine with this option, the simple and the advanced example. My bad.

@dbaio dbaio closed this as completed Jan 22, 2022
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