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

Translation failed. This is probably a bug in rewrite.ts. #7

Open
vanous opened this issue Jul 21, 2019 · 1 comment
Open

Translation failed. This is probably a bug in rewrite.ts. #7

vanous opened this issue Jul 21, 2019 · 1 comment

Comments

@vanous
Copy link

vanous commented Jul 21, 2019

I am comparing po4a and asciidoctor-gettext and asciidoctor-gettext's output seems nicer - for example tables are better tokenized in asciidoctor-gettext rather then full multilline string being used in po file as in po4a.

But i can never apply the translation. I have tried to use asciidoctor-gettext translate but it always fails with:

Translation failed. This is probably a bug in rewrite.ts.

No further message is given.

So i tried using it on asciidoc official i18n-font-test.adoc test file, but that one fails with:

invalid style for paragraph: hardbreaks-option and then

Translation failed. This is probably a bug in rewrite.ts..

I tried fully empty non translated.po file, fully edited .po file... to no avail. See my output:

$ wget https://raw.githubusercontent.com/asciidoctor/asciidoctor-pdf/master/spec/fixtures/i18n-font-test.adoc
--2019-07-21 19:56:04--  https://raw.githubusercontent.com/asciidoctor/asciidoctor-pdf/master/spec/fixtures/i18n-font-test.adoc
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.12.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.12.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3765 (3.7K) [text/plain]
Saving to: ‘i18n-font-test.adoc’

i18n-font-test.adoc                             100%[=====================================================================================================>]   3.68K  --.-KB/s    in 0.001s  

2019-07-21 19:56:04 (2.80 MB/s) - ‘i18n-font-test.adoc’ saved [3765/3765]

$ asciidoctor-gettext.js gettextize -m i18n-font-test.adoc -p out.po
Unknown node name: 'open'
Unknown node name: 'colist'
$ asciidoctor-gettext.js translate -m i18n-font-test.adoc  -p out.po -l out.adoc
Unknown node name: 'open'
Unknown node name: 'colist'
asciidoctor: WARNING: <stdin>: line 115: invalid style for paragraph: hardbreaks-option
Translation failed. This is probably a bug in rewrite.ts.
Please file a bug report and attaching the input asciidoc file.
https://github.com/martijnthe/asciidoctor-gettext/issues/


Steps to reproduce:

wget https://raw.githubusercontent.com/asciidoctor/asciidoctor-pdf/master/spec/fixtures/i18n-font-test.adoc
asciidoctor-gettext.js gettextize -m i18n-font-test.adoc -p out.po
asciidoctor-gettext.js translate -m i18n-font-test.adoc  -p out.po -l out.adoc

thank you

@benoitrolland
Copy link

benoitrolland commented Mar 10, 2023

similar problems still are here ...

after
wget https://raw.githubusercontent.com/asciidoctor/asciidoctor-pdf/master/spec/fixtures/i18n-font-test.adoc

I get (under windows/cygwin):
$ asciidoctor-gettext gettextize -m i18n-font-test.adoc -p out.po
Unknown node name: 'open'
Unknown node name: 'colist'

myidt@DESKTOP-IV5C6TI /d/brl/proj/2022/gettextTest
$ asciidoctor-gettext translate -m i18n-font-test.adoc -p out.po -l out.adoc
Unknown node name: 'open'
Unknown node name: 'colist'
asciidoctor: WARNING: : line 124: invalid style for paragraph: hardbreaks-option
Translation failed. This is probably a bug in rewrite.ts.
Please file a bug report and attaching the input asciidoc file.
https://github.com/martijnthe/asciidoctor-gettext/issues/new


$ npm show asciidoctor-gettext

[email protected] | MIT | deps: 3 | versions: 8
gettext/po string extraction tool for asciidoc documents
https://github.com/martijnthe/asciidoctor-gettext

keywords: adoc, asciidoc, asciidoctor, asciidoctor.js, gettext, i18n, internationalization, localization, po, po4a, translation

bin: asciidoctor-gettext

dist
.tarball: https://registry.npmjs.org/asciidoctor-gettext/-/asciidoctor-gettext-1.3.1.tgz
.shasum: 207d32f2b428010ad0622924d1da54cc1684b971
.integrity: sha512-HzCXVR/VGnRS5KXrsbQRD8RoBtd6uH6ceOYwey7/AuGX0jqfn4s6jZpT0XLDZeESJcCq6pfpjtsvqzxpver8uQ==
.unpackedSize: 48.5 kB

dependencies:
asciidoctor.js: 1.5.7-rc.1 commander: ^2.15.1 gettext-parser: ^2.0.0

maintainers:

dist-tags:
latest: 1.3.1 next: 1.0.0

published over a year ago by martijnthe [email protected]

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