1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-14 14:10:05 +02:00
Commit Graph

24 Commits

Author SHA1 Message Date
Abner Chou
e0546608d5
Update dprint link in TRANSLATIONS.md (#1377)
Fix the `dprint` official link in the TRANSLATIONS.md file.
2023-10-17 16:02:56 -04:00
Henri F
0e32756795
Update TRANSLATIONS.md with details on installation and dprint usage (#1372)
Related to #1359
2023-10-16 13:02:38 -07:00
Martin Geisler
4560ee8484
Format all PO files with dprint (#1359)
This enforces a consistent formatting for the PO files. The goal of this
is to avoid large diffs due to random and unnecessary reformatting.

We use the format of `msgcat`: this is also waht `msgmerge` produces and
it’s easy to replicate for people by installing Gettext and running
`dprint fmt`.

This is a follow-up to #1351 which started enforcing that the `msgid`
fields don’t change due to reformatting in a PR.

If this turns out to be cumbersome, then we can disable it again.
2023-10-14 12:53:18 +02:00
Martin Geisler
ac8e3ed14f
Mention POT-Creation-Date in instructions (#1314)
I don’t know if this is enough on its own? In principle, the new
publication system should work smoothly without people having to know
much about this header, so that’s why I only describe it briefly.

Followup to #1243.
2023-10-07 18:32:10 +02:00
Qinglin
a166ccfdb1
Fixed TRANSLATIONS.md link (#1071) 2023-08-13 13:37:38 +00:00
Martin Geisler
c4603fd595
Move Poedit instructions into new section (#960)
We did not actually have a section with instructions for how to edit a translation. Instead, this information was kind of implicitly there.
2023-07-13 08:19:52 -07:00
Henri Fontana
2e692fcc8a
Additional configuration steps on TRANSLATIONS.md (#959)
* Added steps to configure Poedit properly

* Small adjustments

* Add link to Poedit

* Fix file formatting

* One. More. dprint. Fix.
2023-07-13 11:00:46 +02:00
Sharun
f5764ad4bc
remove $ from code-blocks in other markdown files as well (#952)
* remove $ from code blocks in translations

* remove $ from code blocks in the other markdown files as well

* Revert "remove $ from code blocks in the other markdown files as well"

This reverts commit eda922dab9.

* remove $ from code blocks in setup.md

* re-added the previous changes

* revert logging.md
2023-07-10 21:25:41 -07:00
Yohann Coppel
7fadb45ece
Add missing binaries in TRANSLATIONS.md instructions. (#884)
* Add missing binaries in TRANSLATIONS.md instructions.

With these instructions, I can start from a clean fork, and get running
quickly.

* Update TRANSLATIONS.md: Add Debian

Co-authored-by: Martin Geisler <martin@geisler.net>

* Update TRANSLATIONS.md, format.

* Remove duplicate info between README and TRANSLATIONS.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-07-03 08:37:06 +02:00
Ming-Ying Chung
a5fbd2fd7c
Add PR labeler action to label translation-related PRs (#845)
* Add PR labeler action to label translation-related PRs

* Sync labels when PR changes

* Update instructions for new translation
2023-06-22 14:21:33 +09:00
Martin Geisler
8c212b3f8c
Warn against running msgmerge too often (#789)
* Warn against running `msgmerge` too often
2023-06-09 14:32:48 +00:00
Martin Geisler
0b93628ef3
Call out GitHub suggestions (#788)
* Call out GitHub suggestions
2023-06-09 09:29:26 -04:00
Martin Geisler
753dea4950
Give guidance on how to review translations (#784)
This captures some general advice which I’ve been handing out 1:1 to
the many new translation reviewers.
2023-06-08 10:42:09 -04:00
Martin Geisler
aaca44f62b
Format files with dprint (#711)
The dprint formatter is a flexible system which will use sandboxed
WebAssembly formatters to format our code (mostly: it calls out to
`rustfmt` for Rust code).

A particularly interesting feature is that dprint can format Rust code
blocks in the Markdown files. However, before we turn that on, we need
to have a way to normalize the Markdown text as it is extracted[1].
That is so that the word put into the translations is kept after the
reformatting.

[1]: https://github.com/google/mdbook-i18n-helpers/issues/19
2023-05-30 17:04:19 +02:00
Martin Geisler
84650b2af1
Add a style guide (#591)
This is an attempt at documenting some things to do and don’t do when
updating the course text or a translation.

Fixes #560.
2023-05-04 12:20:22 +02:00
Martin Geisler
251782aac3
Small copy-edit for TRANSLATIONS.md (#590) 2023-04-28 09:42:05 +02:00
Martin Geisler
49bf110b31
Use mdbook-i18n-helpers crate (#552)
The i18n-helpers are now available as a stand-alone crate:
https://crates.io/crates/mdbook-i18n-helpers.

Because we cache the Rust binaries in our GitHub workflows, I bumped
the cache prefix to ensure we use a clean cache. Otherwise, Cargo
won’t install the new binaries in mdbook-i18n-helpers because it sees
the old ones from this repository.
2023-04-05 16:08:11 +02:00
Martin Geisler
f26134b1f5
Add links to the cloud-translate tool (#549) 2023-04-04 15:14:20 +02:00
Kuba
4a9b679a9c
Add note about fuzzy and fix heading nesting (#466) 2023-03-01 09:17:41 +00:00
Jooyung Han
1821a3fd12
Make i18n-helpers a requirement (#461)
* Make i18n-helpers a requirement

* Skip mdbook-gettext for mdbook-xgettext

* Gettext finds PO file based on `book.language`

* Update workflow

No need to set `preprocessor.gettext.po-file`.

---------

Co-authored-by: Jooyung Han <jooyung@google.com>
2023-02-28 22:05:09 +09:00
Martin Geisler
f90fecb449
Add hint about using a PO editor (#356) 2023-02-06 20:17:36 +01:00
Martin Geisler
e847c13fb7
Take out unnecessary watch dir (#303)
The directory is already mentioned in our `book.toml`.
2023-01-30 13:33:04 +01:00
Kostis Andrikopoulos
4fed580efa
Add trailing backslash for multiline command (#277)
There were some backslashed missing in the command to serve the
translated book. Thus the shell would execute the lines one after the
other, instead of as one command.

This lead to the environment variables not actually being set, and thus
the non-translated version was served anyway.
2023-01-25 18:26:58 +01:00
Martin Geisler
48ec773052 Add support for translations
This implements a translation pipeline using the industry-standard
Gettext[1] system.

I picked Gettext for the reasons described in [2] and [3]:

* It’s widely used in open source software. This means that there are
  graphical editors which will help you in editing the `.po` files. An
  example is Poedit[4], which is available for all major platforms.

  There are also many online systems for doing translations. An
  example is Pontoon[5], which is used for the Rust website itself. We
  can consider setting up such an instance ourselves.

* It is a light-weight yet structured format. This means that nothing
  changes with regards to how you update the original English text. We
  can still accept fixes and PRs like normal.

  The structure means that translators can see exactly which part of
  the course they need to update after a change. This is completely
  lost if you simply copy over the original text and translate it
  in-place in the Markdown files.

The code here only adds support for translations. They are not yet
tested, published or used for anything. Next steps will be:

* Add support for switching languages via a bit of JavaScript on each
  page.

* Update the speaker notes feature to support translations (right now
  “Speaker Notes” is hard-coded into the generated HTML). I think we
  should turn it into a mdbook preprocessor instead.

* Add testing: We should test that the `.po` files are well-formed. We
  should also run `mdbook test` on each language since the
  translations can alter the embedded code.

Fixes #115.

[1]: https://www.gnu.org/software/gettext/manual/html_node/index.html
[2]: https://github.com/rust-lang/mdBook/pull/1864
[3]:
https://github.com/rust-lang/mdBook/issues/5#issuecomment-1144887806
[4]: https://poedit.net/
[5]: https://pontoon.rust-lang.org/
2023-01-18 16:12:53 +01:00