Open henrif75 opened 3 months ago
Hi 👋
I am interested in helping translating this book to spanish, but I am having some problems with building the spanish version. I am using a Windows 10 machine and followed your README.md, CONTRIBUTING.md and TRANSLATIONS.md guides, but still face some errors.
I am able to build (and serve) the english and the spanish version, but as you can see in the image below, there are still some level-1 paragraphs in English:
I followed your steps in this issue, and the po/es.po
file seems legit for me (I used Poedit):
#: src\index.md
msgid ""
"Android: a half-day course on using Rust for Android platform development "
"(AOSP). This includes interoperability with C, C++, and Java."
msgstr ""
"Android: un curso de medio dÃa sobre el uso de Rust en el desarrollo de la "
"plataforma Android (AOSP). En él se incluye la interoperabilidad con C, C++ "
"y Java."
Thanks in advance ! 😄
Hi @letesdev
Can you make sure you've got the latest version from main
?
My po/es.po
is different from your screenshot:
Hi @henrif75,
Thanks for your message !
After getting the latest version from main
, my po/es.po
is the same as yours:
#: src/index.md
msgid ""
"[Android](android.md): a half-day course on using Rust for Android platform "
"development (AOSP). This includes interoperability with C, C++, and Java."
msgstr ""
"[Android](android.md): un curso de medio dÃa sobre el uso de Rust en el "
"desarrollo de la plataforma Android (AOSP). En él se incluye la "
"interoperabilidad con C, C++ y Java."
and serving the book directly shows me the translated message:
I can translate paragraphs using Poedit:
However, I have the same problems if I follow the TRANSLATIONS.md guide. After extracting the original English text and generating the messages.pot
(with
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}' mdbook build -d po
command), and updating the po/es.po
file with new messages (with msgmerge --update po/es.po po/messages.pot
command), here's the output:
(here's the es.po.txt file in case you need it - ps: delete the .txt extension)
The resulting es.po file after you run the msgmerge looks weird (e.g., it has the original line numbers) Can you delete and regenerate the messages.pot and share here? Also, can you check the version of gettext? Thanks.
Of course, here's the requested information:
$ xgettext --version
xgettext (GNU gettext-tools) 0.19.8.1
Copyright (C) 1995-1998, 2000-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Ulrich Drepper.
Can you try to upgrade the gettext tools to the latest version (0.22.5) and recreate the messages.pot?
@letesdev What's your status on this? Would love to pitch in!
Hey folks, I'm sorry about these formatting problems! I only tested our instructions once way back using my wife's Windows laptop :smile:
I recall that there were two popular places to get the Gettext tools from on Windows. The instructions should point to the right one, so perhaps it's worth double-checking that you really installed everything from there?
@letesdev I've put up a draft PR so we can start collaborating on this. I'll commit my progress as often as I can.
@henrif75 Can you verify that the file generated by Poedit over in my PR (#2232) is correct and doesn't have the same issues as @letesdev ?
Hi @carreter, I checked the file and unfortunately it's still in the wrong format, with line numbers in comments:
#: src/SUMMARY.md src/running-the-course/course-structure.md:15
#: src/running-the-course/course-structure.md:34
#: src/running-the-course/course-structure.md:52
#: src/running-the-course/course-structure.md:69 src/welcome-day-1.md
#: src/welcome-day-2.md src/welcome-day-3.md src/welcome-day-4.md
#: src/concurrency/welcome-async.md
msgid "Welcome"
msgstr "Te damos la bienvenida"
The es.po
file I updated does not have these:
#: src/SUMMARY.md src/index.md
msgid "Welcome to Comprehensive Rust 🦀"
msgstr "Te damos la bienvenida a Comprehensive Rust 🦀"
Can you please check and report back here:
Also, please upload the messages.pot
file created after you ran mdbook build
Thank you.
Hi guys, sorry for the late answer, last days before holidays have been crazy...
I tried to update gettext tools twice, without success... I would love to have some Windows guide if you have 😄 if not, i will try again...
Thanks @carreter and @henrif75 😄
@henrif75 thanks for checking on that. Here's the info you requested:
And here's the messages.pot
:
messages.pot.txt
Thanks @carreter. The messages.pot
file was generated with the line numbers.
The most current version of gettext is 0.22.5 - I don't think this could be the culprit, but if you could update and retest it would be great.
@mgeisler Would have any idea of why messages.pot
was created with the wrong parameter? Essentially, the it's ignoring the granularity parameter.
@henrif75 thanks for checking on that. Here's the info you requested:
- gettext version: 0.21
- mdbook version: 0.4.40
- OS version: custom Debian derivative
And here's the
messages.pot
: messages.pot.txt
@henrif75 just updated get text version and confirmed that this doesn't change the behavior.
Maybe this is related to this issue? https://github.com/google/mdbook-i18n-helpers/issues/171
After the fix in https://github.com/google/mdbook-i18n-helpers/pull/215, the line numbers issue is resolved:
carreter@carreter:~/projects/comprehensive-rust$ cat po/messages.pot | grep :[0-9]
"POT-Creation-Date: 2024-07-19T19:45:30Z\n"
"We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break "
msgid "\"127.0.0.1:0\""
msgid "\"127.0.0.1:2000\""
msgid "\"ws://127.0.0.1:2000\""
Now time to go through the translations I had made with the incorrect messages.pot
and merge them into the corrected one! :')
Now time to go through the translations I had made with the incorrect
messages.pot
and merge them into the corrected one! :')
If we're talking about many translations, then you should look into using msgcat
and/or msgmerge
to merge them. The Gettext tools come with a lot of utilities which can manipulate the PO files.
msgmerge
did the trick!
FYI, this is my last week working at Google. I'm not sure if I will have time to finish the translation while I am here, but I will try my best to get as much of it as I can done over on #2232. Afterwards work will be slower, but I will still plug away at it.
There are 301/3613 messages left to translate!
@letesdev are you still interested in helping out with this?
Thanks @carreter for all the hard work here! @henrif75 and @letesdev, can you give #2232 a review? From skimming through it with gh pr diff 2232 | bat -l patch
, it looks great from a structure point of view.
The live translation delta can be seen in the synced translation report.
Translate remaining messages and review fuzzy translations. As of 6/5/24, current translation stats are:
Steps:
main
.messages.pot
:es.po
:es.po
file with your favorite PO editor.