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

Translations #345

Closed
simonsan opened this issue Feb 17, 2023 · 6 comments · Fixed by #352
Closed

Translations #345

simonsan opened this issue Feb 17, 2023 · 6 comments · Fixed by #352
Labels
A-translation Area: Everything regarding translations E-help wanted Call for participation: Help is requested to fix this issue

Comments

@simonsan
Copy link
Collaborator

Comprehensive Rust has developed a nice translation mechanism for mdbook books: https://github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md

We could make some research on how to adapt to that workflow making it possible to translate Rust patterns to different languages.

Newer simplified Chinese could be the starter.

@simonsan simonsan added the A-translation Area: Everything regarding translations label Feb 17, 2023
@simonsan simonsan pinned this issue Feb 21, 2023
@simonsan simonsan added the E-help wanted Call for participation: Help is requested to fix this issue label Feb 21, 2023
@mgeisler
Copy link

mgeisler commented Mar 1, 2023

Hi @simonsan, I would love to see the infrastructure used elsewhere. We will eventually publish the i18n helpers (google/comprehensive-rust#462), but for now I recommend installing them with

cargo install --git https://github.com/google/comprehensive-rust i18n-helpers

@simonsan
Copy link
Collaborator Author

simonsan commented Apr 4, 2023

Published now as https://github.com/google/mdbook-i18n-helpers 🚀

CC: rust-lang/mdBook#5 (comment)

@simonsan
Copy link
Collaborator Author

simonsan commented Apr 5, 2023

It will probably still take some time until we can fully adopt it, as it seems like that Markdown formatting isn't transferred in the translation process. Afaiu that could destroy the ability to further translate things within a language, when we would reformat the original markdown.

Tracking: google/mdbook-i18n-helpers#19

@mgeisler
Copy link

mgeisler commented Apr 6, 2023

as it seems like that Markdown formatting isn't transferred in the translation process. Afaiu that could destroy the ability to further translate things within a language, when we would reformat the original markdown.

You are correct: the Markdown text is copied as-is to the PO files. So if you mass-format it, the translations will stop working.

My work arounds for this are:

I hope to write a tool for the second option soon since I plan to standardize the formatting of my own Markdown files.

@simonsan
Copy link
Collaborator Author

simonsan commented Apr 6, 2023

Thanks for the clarification <3

@mgeisler
Copy link

mgeisler commented Apr 6, 2023

Maybe I should clarify that the mdbook-i18n-helpers extract the text on a per-paragraph basis right now. So changes only invalidate a single paragraph at a time.

If you add/remove a few words in a paragraph, Gettext will do a good job at finding the old paragraph when you update your xx.po file for the xx language. The entry is then marked "fuzzy", which is a signal to the translator that they need to update the old translation.

@simonsan simonsan unpinned this issue Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Everything regarding translations E-help wanted Call for participation: Help is requested to fix this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants