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

Spanish (es): Catch-up with EN version #2120

Open
henrif75 opened this issue Jun 5, 2024 · 21 comments · Fixed by #2232
Open

Spanish (es): Catch-up with EN version #2120

henrif75 opened this issue Jun 5, 2024 · 21 comments · Fixed by #2232

Comments

@henrif75
Copy link
Collaborator

henrif75 commented Jun 5, 2024

Translate remaining messages and review fuzzy translations.
As of 6/5/24, current translation stats are:

es.po
3129 translated messages, 450 fuzzy translations, 194 untranslated messages.

Steps:

  1. Sync your branch with main.
  2. Recreate messages.pot:
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}' \
  mdbook build -d po
  1. Merge with the es.po:
msgmerge --update po/es.po po/messages.pot
  1. Edit the es.po file with your favorite PO editor.
@letesdev
Copy link

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:

image

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 ! 😄

@henrif75
Copy link
Collaborator Author

Hi @letesdev
Can you make sure you've got the latest version from main?
My po/es.po is different from your screenshot:
image

@letesdev
Copy link

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:
image

I can translate paragraphs using Poedit:

image

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:

image

(here's the es.po.txt file in case you need it - ps: delete the .txt extension)

@henrif75
Copy link
Collaborator Author

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.

@letesdev
Copy link

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.

@henrif75
Copy link
Collaborator Author

Can you try to upgrade the gettext tools to the latest version (0.22.5) and recreate the messages.pot?

@carreter
Copy link
Contributor

carreter commented Jul 8, 2024

@letesdev What's your status on this? Would love to pitch in!

@mgeisler
Copy link
Collaborator

Hey folks, I'm sorry about these formatting problems! I only tested our instructions once way back using my wife's Windows laptop 😄

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?

@carreter
Copy link
Contributor

@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 ?

@henrif75
Copy link
Collaborator Author

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:

  • gettext version
  • mdbook version
  • your OS

Also, please upload the messages.pot file created after you ran mdbook build
Thank you.

@letesdev
Copy link

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 😄

@carreter
Copy link
Contributor

@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
Copy link
Collaborator Author

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

@carreter
Copy link
Contributor

@henrif75 just updated get text version and confirmed that this doesn't change the behavior.

Maybe this is related to this issue? google/mdbook-i18n-helpers#171

@carreter
Copy link
Contributor

After the fix in google/mdbook-i18n-helpers#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! :')

@mgeisler
Copy link
Collaborator

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.

@carreter
Copy link
Contributor

msgmerge did the trick!

@carreter
Copy link
Contributor

carreter commented Aug 20, 2024

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?

@mgeisler
Copy link
Collaborator

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.

@mgeisler
Copy link
Collaborator

The live translation delta can be seen in the synced translation report.

mgeisler pushed a commit that referenced this issue Sep 12, 2024
@carreter
Copy link
Contributor

@mgeisler This is still not complete as #2232 still left some messages untranslated. Can you reopen it?

@henrif75 henrif75 reopened this Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants