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

Add Chinese and Japanese localization #1251

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
cargo install mdbook --no-default-features --features search --vers "^0.4" --locked
cargo install mdbook-variables --vers "^0.2" --locked
cargo install mdbook-admonish --vers "^1" --locked
cargo install mdbook-i18n-helpers --locked
export PATH="$PATH:$HOME/.cargo/bin"
mdbook --version

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ metals.sbt

.vscode

# GetText
*.pot
*.po~
*.mo
po/ja.po
po/zh-cn.po

# Dependencies
node_modules

Expand Down
32 changes: 32 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
Globalization
-------------

To add a new locale (es, zh-cn, etc):

```bash
script/genpo.sh xx
```

To resync the po files to the original:

```bash
script/sync.sh xx
```

To serve the po files, run the following:

```bash
script/serve.sh xx
```

then run:

```bash
script/concat.sh xx
```

when you change a `*.po` file

Diataxis
--------

The following is the [four kinds of documentation](https://www.writethedocs.org/videos/eu/2017/the-four-kinds-of-documentation-and-why-you-need-to-understand-what-they-are-daniele-procida/) structure, which I'm not really sure would work, but worth giving it some try.

### tutorial
Expand Down
8 changes: 7 additions & 1 deletion book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title = "The Book of sbt"

[output.html]
theme = "theme"
additional-css = ["src/reference/custom-202409.css", "src/reference/mdbook-admonish.css"]
additional-css = ["src/reference/custom-202410.css", "src/reference/mdbook-admonish.css"]
cname = "www.scala-sbt.org"

[preprocessor.variables]
Expand All @@ -21,3 +21,9 @@ scala2_13_example_version = "2.13.15"
[preprocessor.admonish]
command = "mdbook-admonish"
assets_version = "3.0.2" # do not edit: managed by `mdbook-admonish install`

[preprocessor.gettext]
after = ["links"]

[build]
extra-watch-dirs = ["po"]
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ lazy val root = (project in file("."))
name := "website",
siteEmail := "eed3si9n" + "@gmail.com",
// Reference
MdBook / siteSubdirName := s"""$targetSbtBinaryVersion/docs/en""",
MdBook / siteSubdirName := s"""$targetSbtBinaryVersion/docs/""",
tutorialSubDirName := s"""$targetSbtBinaryVersion/tutorial""",
landingSubDirName := "",
// Redirects
Expand Down
135 changes: 135 additions & 0 deletions po/summary/appendix-glossary.ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
msgid ""
msgstr ""
"Project-Id-Version: The Book of sbt\n"
"POT-Creation-Date: 2024-10-30T03:08:34-04:00\n"
"PO-Revision-Date: 2024-10-30T01:14:09-04:00\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ja\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: src/reference/appendix/glossary.md:20
msgid "Glossary"
msgstr ""

#: src/reference/appendix/glossary.md:23
msgid "Symbols"
msgstr ""

#: src/reference/appendix/glossary.md:26
msgid "`:=`, `+=`, `++=`"
msgstr ""

#: src/reference/appendix/glossary.md:28
msgid ""
"These construct a [Setting](../../../../1.x/api/sbt/internal/util/"
"Init$Setting.html), which is the fundamental type in the [settings](../guide/"
"build-definition-basics.md) system."
msgstr ""

#: src/reference/appendix/glossary.md:30
msgid "`%`"
msgstr ""

#: src/reference/appendix/glossary.md:32
msgid ""
"This is used to build up a [ModuleID](../../../../1.x/api/sbt/"
"librarymanagement/ModuleID.html)."
msgstr ""

#: src/reference/appendix/glossary.md:34
msgid "`%%`"
msgstr ""

#: src/reference/appendix/glossary.md:36
msgid ""
"This is similar to `%` except that it identifies a dependency that has been "
"[cross built](../concepts/cross-building.html)."
msgstr ""

#: src/reference/appendix/glossary.md:38
msgid "`%%%`"
msgstr ""

#: src/reference/appendix/glossary.md:40
msgid ""
"This is defined in [sbt-platform-deps](https://github.com/portable-scala/sbt-"
"platform-deps) in sbt 1.x."
msgstr ""

#: src/reference/appendix/glossary.md:42
msgid "C"
msgstr ""

#: src/reference/appendix/glossary.md:45
msgid "Command"
msgstr ""

#: src/reference/appendix/glossary.md:47
msgid ""
"A system-level building block of sbt, often used to capture user interaction "
"or IDE interaction. See [Command](../concepts/command.html)."
msgstr ""

#: src/reference/appendix/glossary.md:49
msgid "Cross building"
msgstr ""

#: src/reference/appendix/glossary.md:51
msgid ""
"The idea of building multiple targets from the same set of source file. This "
"includes Scala cross building, targetting multiple versions of Scala "
"releases; platform cross building, targetting JVM, Scala.JS, and Scala "
"Native; and custom virtual axis like Spark versions."
msgstr ""

#: src/reference/appendix/glossary.md:53
msgid "D"
msgstr ""

#: src/reference/appendix/glossary.md:56
msgid "Dependency resolution"
msgstr ""

#: src/reference/appendix/glossary.md:58
msgid ""
"During library management, when multiple version candidates (e.g. "
"`foo:2.2.0` and `foo:3.0.0`) are found for a library `foo` within a "
"dependency graph, it is called a _dependency conflict_. The process of "
"mediating the conflict into a single version is called _dependency "
"resolution_. Often, this would result in the older version beging removed "
"from the dependency graph, which is called an _eviction_ of `foo:2.2.0`. In "
"some cases, an eviction is considered unsafe because the candidates are not "
"replacable. See [sbt update](../reference/sbt-update.md)."
msgstr ""

#: src/reference/appendix/glossary.md:60
msgid "E"
msgstr ""

#: src/reference/appendix/glossary.md:63
msgid "Eviction"
msgstr ""

#: src/reference/appendix/glossary.md:65
msgid "See [dependency resolution](#dependency-resolution)."
msgstr ""

#: src/reference/appendix/glossary.md:67
msgid "V"
msgstr ""

#: src/reference/appendix/glossary.md:70
msgid "`value`"
msgstr ""

#: src/reference/appendix/glossary.md:72
msgid ""
"`.value` is used to denote a happens-before relationship from one task or "
"setting to another. This method is special (it is a macro) and cannot be "
"used except in `:=` or in the standalone construction methods `Def.setting` "
"and `Def.task`."
msgstr ""
135 changes: 135 additions & 0 deletions po/summary/appendix-glossary.zh-cn.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
msgid ""
msgstr ""
"Project-Id-Version: The Book of sbt\n"
"POT-Creation-Date: 2024-10-30T03:50:36-04:00\n"
"PO-Revision-Date: 2024-10-30T03:50:36-04:00\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh-cn\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: src/reference/appendix/glossary.md:20
msgid "Glossary"
msgstr ""

#: src/reference/appendix/glossary.md:23
msgid "Symbols"
msgstr ""

#: src/reference/appendix/glossary.md:26
msgid "`:=`, `+=`, `++=`"
msgstr ""

#: src/reference/appendix/glossary.md:28
msgid ""
"These construct a [Setting](../../../../1.x/api/sbt/internal/util/"
"Init$Setting.html), which is the fundamental type in the [settings](../guide/"
"build-definition-basics.md) system."
msgstr ""

#: src/reference/appendix/glossary.md:30
msgid "`%`"
msgstr ""

#: src/reference/appendix/glossary.md:32
msgid ""
"This is used to build up a [ModuleID](../../../../1.x/api/sbt/"
"librarymanagement/ModuleID.html)."
msgstr ""

#: src/reference/appendix/glossary.md:34
msgid "`%%`"
msgstr ""

#: src/reference/appendix/glossary.md:36
msgid ""
"This is similar to `%` except that it identifies a dependency that has been "
"[cross built](../concepts/cross-building.html)."
msgstr ""

#: src/reference/appendix/glossary.md:38
msgid "`%%%`"
msgstr ""

#: src/reference/appendix/glossary.md:40
msgid ""
"This is defined in [sbt-platform-deps](https://github.com/portable-scala/sbt-"
"platform-deps) in sbt 1.x."
msgstr ""

#: src/reference/appendix/glossary.md:42
msgid "C"
msgstr ""

#: src/reference/appendix/glossary.md:45
msgid "Command"
msgstr ""

#: src/reference/appendix/glossary.md:47
msgid ""
"A system-level building block of sbt, often used to capture user interaction "
"or IDE interaction. See [Command](../concepts/command.html)."
msgstr ""

#: src/reference/appendix/glossary.md:49
msgid "Cross building"
msgstr ""

#: src/reference/appendix/glossary.md:51
msgid ""
"The idea of building multiple targets from the same set of source file. This "
"includes Scala cross building, targetting multiple versions of Scala "
"releases; platform cross building, targetting JVM, Scala.JS, and Scala "
"Native; and custom virtual axis like Spark versions."
msgstr ""

#: src/reference/appendix/glossary.md:53
msgid "D"
msgstr ""

#: src/reference/appendix/glossary.md:56
msgid "Dependency resolution"
msgstr ""

#: src/reference/appendix/glossary.md:58
msgid ""
"During library management, when multiple version candidates (e.g. "
"`foo:2.2.0` and `foo:3.0.0`) are found for a library `foo` within a "
"dependency graph, it is called a _dependency conflict_. The process of "
"mediating the conflict into a single version is called _dependency "
"resolution_. Often, this would result in the older version beging removed "
"from the dependency graph, which is called an _eviction_ of `foo:2.2.0`. In "
"some cases, an eviction is considered unsafe because the candidates are not "
"replacable. See [sbt update](../reference/sbt-update.md)."
msgstr ""

#: src/reference/appendix/glossary.md:60
msgid "E"
msgstr ""

#: src/reference/appendix/glossary.md:63
msgid "Eviction"
msgstr ""

#: src/reference/appendix/glossary.md:65
msgid "See [dependency resolution](#dependency-resolution)."
msgstr ""

#: src/reference/appendix/glossary.md:67
msgid "V"
msgstr ""

#: src/reference/appendix/glossary.md:70
msgid "`value`"
msgstr ""

#: src/reference/appendix/glossary.md:72
msgid ""
"`.value` is used to denote a happens-before relationship from one task or "
"setting to another. This method is special (it is a macro) and cannot be "
"used except in `:=` or in the standalone construction methods `Def.setting` "
"and `Def.task`."
msgstr ""
Loading