Skip to content

Commit e3d6ca8

Browse files
committed
README
1 parent 2c6b9e8 commit e3d6ca8

File tree

3 files changed

+70
-11
lines changed

3 files changed

+70
-11
lines changed

.github/workflows/CI.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ jobs:
88
steps:
99
- uses: actions/checkout@v1
1010
- uses: actions/setup-node@v1
11-
- run: yarn
12-
- run: yarn pull-en
13-
- run: yarn docs-sync validate
14-
11+
- run: yarn
12+
- run: yarn docs-sync validate-against-en
1513

1614
site-builds:
1715
runs-on: ubuntu-latest
@@ -52,3 +50,7 @@ jobs:
5250

5351
- run: yarn workspace typescriptlang-org build
5452
working-directory: ./website
53+
54+
# Verify the website build
55+
- run: yarn test
56+
working-directory: ./web

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A repo for handling localized versions of the TypeScript website content
44

5-
### How this works
5+
### Setting up
66

77
```sh
88
git clone https://github.com/microsoft/TypeScript-Website-Localizations
@@ -11,14 +11,50 @@ cd TypeScript-Website-Localizations
1111
# Setup
1212
yarn
1313

14-
# Optional: Grab the English files
14+
# Optional: Grab the English files to make translation easier
1515
yarn pull-en
16+
17+
# Optional: Verify your changes will correctly replace the english files
18+
yarn validate-paths
1619
```
1720

1821
That's it, you've got a copy of all the documentation and now can write documentation which follows the existing patterns.
1922

20-
More docs to come.
23+
### How translations work
24+
25+
The TypeScript website handles translations by having language specific files with matching filepaths:
26+
27+
E.g: [`/packages/documentation/copy/en/reference/JSX.md`](https://github.com/microsoft/TypeScript-website/blob/68a4f67ed5f396228eeb6d0309b51bcfb19d31a1/packages/documentation/copy/en/reference/JSX.md#L1)
28+
29+
Has existing translations in different languages:
30+
31+
```sh
32+
/packages/documentation/copy/id/reference/JSX.md
33+
/packages/documentation/copy/ja/reference/JSX.md
34+
/packages/documentation/copy/pt/reference/JSX.md
35+
```
36+
37+
Same path, just switched `en` for `id`, `ja` & `pt`.
38+
39+
#### This repo
40+
41+
This repo contains all of the non-English locale files. It means you can clone and translate without all the infrastructure overhead of the pretty complex TypeScript-Website.
42+
43+
For example if you wanted to translate a new handbook page you would:
44+
45+
- Clone this repo (see above)
46+
- Pull in the English files `yarn pull-en` (these will be gitignored)
47+
- Find your english file: `docs/documentation/en/handbook-v2/Basics.md`
48+
- Recreate the same folder path in your language: `docs/documentation/it/handbook-v2/Basics.md`
49+
- Translate the file!
50+
- Create a pull request to this repo
51+
- Once merged, the translation will appear on the next website deploy
52+
53+
#### Language owners
54+
55+
When a new language is created, we ask for a few people to become language owners. These owners are able to merge pull requests to files in their language via [code-owner-self-merge](https://github.com/OSS-Docs-Tools/code-owner-self-merge) in a pull request. They will be pinged on PRs which affect them, you can see the flow in PRs like [this](https://github.com/microsoft/TypeScript-Website/pull/1478) or [this](https://github.com/microsoft/TypeScript-Website/pull/1458).
2156

57+
The TypeScript team generally only know English, and can answer clarifying questions if needed! For quick questions, you can use the `ts-website-translation` channel in the [TypeScript Discord](https://discord.gg/typescript).
2258

2359
# Contributing
2460

yarn.lock

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44

55
"@oss-docs/sync@*":
6-
version "0.3.1"
7-
resolved "https://registry.yarnpkg.com/@oss-docs/sync/-/sync-0.3.1.tgz#9d39d81f0bb91373c0180ab7a3ac4c47f7d2fd5f"
8-
integrity sha512-y9SNwKA701CgWBQRCzeYw54bmDy9DzhCueMGpZquWj+m1yOc+g/OH0cPVpYT2+zPv+gAc35zW21yDi+ujlG8Uw==
6+
version "0.4.1"
7+
resolved "https://registry.yarnpkg.com/@oss-docs/sync/-/sync-0.4.1.tgz#b5f9aa339cd9d8daf891d1fa4bebd56520d09e2a"
8+
integrity sha512-6pjnvUJ6EVAs8AeAKcvAAfFAODzpspgjo5ufuP04jT1Y8IZ9LLOqkPdo3xPMDb/TJPzcinFf1/DjaaZUvaEb3A==
99
dependencies:
1010
cachedir "^2.3.0"
11+
chalk "^4.1.0"
1112
cross-spawn "^7.0.1"
1213
gunzip-maybe "^1.4.1"
1314
mvdir "^1.0.21"
@@ -19,7 +20,7 @@ ansi-regex@^5.0.0:
1920
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
2021
integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
2122

22-
ansi-styles@^4.0.0:
23+
ansi-styles@^4.0.0, ansi-styles@^4.1.0:
2324
version "4.3.0"
2425
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
2526
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
@@ -65,6 +66,14 @@ cachedir@^2.3.0:
6566
resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8"
6667
integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==
6768

69+
chalk@^4.1.0:
70+
version "4.1.0"
71+
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
72+
integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
73+
dependencies:
74+
ansi-styles "^4.1.0"
75+
supports-color "^7.1.0"
76+
6877
chownr@^1.1.1:
6978
version "1.1.4"
7079
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
@@ -154,6 +163,11 @@ gunzip-maybe@^1.4.1:
154163
pumpify "^1.3.3"
155164
through2 "^2.0.3"
156165

166+
has-flag@^4.0.0:
167+
version "4.0.0"
168+
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
169+
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
170+
157171
ieee754@^1.1.13:
158172
version "1.2.1"
159173
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
@@ -339,6 +353,13 @@ strip-ansi@^6.0.0:
339353
dependencies:
340354
ansi-regex "^5.0.0"
341355

356+
supports-color@^7.1.0:
357+
version "7.2.0"
358+
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
359+
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
360+
dependencies:
361+
has-flag "^4.0.0"
362+
342363
tar-fs@^2.1.0:
343364
version "2.1.1"
344365
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"

0 commit comments

Comments
 (0)