Skip to content

Commit 95a2d73

Browse files
committed
Massive, messy merge. Fingers crossed.
2 parents 538faa0 + f999a19 commit 95a2d73

File tree

197 files changed

+3159
-11952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+3159
-11952
lines changed

Diff for: .gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
node_modules
22
out
33
.DS_Store
4-
challenges*/*
5-
pages/*
4+
built
65
.idea

Diff for: CONTRIBUTING.md

+57-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ $ npm install
5858

5959
## Package
6060

61-
If you have made any changes to the code or you just cloned this project from github,
61+
If you have made any changes to the code or you just cloned this project from github,
6262
you'll need to rebuild all of the challenges and/or pages.
6363
If you haven't, skip to the next step!
6464

@@ -97,3 +97,59 @@ platforms, [Wine](https://www.winehq.org/) needs to be installed. On OS X, it is
9797
installable via [Homebrew](http://brew.sh/).
9898

9999
This will output the contents of the application to a folder at `../out/Git-it-win32-ia32`.
100+
101+
102+
## Translations to other languages
103+
If you want to add a new language to this project, here are some step you need to do.
104+
105+
### Add locale code
106+
First, edit `locale.js` and add locale code in it. You can use any editor you like.
107+
108+
```bash
109+
$ vim lib/locale.js
110+
```
111+
112+
In `locale.js`, there must have a variable called 'available', and add your language in it.
113+
For example, we have already had three languages, and wanted to add German(Germany):
114+
115+
```javascript
116+
var available = {
117+
'en-US': 'English',
118+
'ja-JP': '日本語',
119+
'zh-TW': '中文(臺灣)',
120+
'de-DE': 'Deutsch'
121+
}
122+
```
123+
124+
Before colon is your language code, it must look like '\<lang\>-\<location\>'. '\<lang\>' is your language, in this case, 'de' is the language code of 'German'. '\<location\>' is your location code, in this case, 'DE' is the location code of 'Germany'. If you don't know what your language/location code, you can find it [here](http://www.lingoes.net/en/translator/langcode.htm).
125+
126+
> **The language code *MUST* be all lowercase, and location code *MUST* be all uppercase.**
127+
128+
129+
If there are lots of locations using same language, you could add your language in variable 'aliases'. App will auto-redirect to target language. For example, There are five locations using 'German' as their language (de-AT, de-CH, de-DE, de-LI and de-LU), you can add 'de' into 'aliases' and let app using 'de-DE' for default 'de' language.
130+
131+
```javascript
132+
var aliases = {
133+
'en': 'en-US',
134+
'ja': 'ja-JP',
135+
'zh': 'zh-TW',
136+
'de': 'de-DE'
137+
}
138+
```
139+
> **Locale in aliases *MUST* point to a locale existed in available.**
140+
141+
### Translate files
142+
All files that translator should edit is in `resources/contents`. We suggest translator using 'en-US' as original language to translate.
143+
144+
```bash
145+
cd resources/contents
146+
cp en-US '<your-lang>-<your-location>'
147+
```
148+
> **Folder name in resources/contents *MUST* be the same as the locale you added in locale.js.**
149+
150+
### Build
151+
Don't forget to build to generate built file.
152+
153+
```bash
154+
npm run build-all
155+
```

Diff for: challenge-content-ja/10_requesting_you_pull_please.html

-42
This file was deleted.

Diff for: challenge-content-ja/1_get_git.html

-52
This file was deleted.

Diff for: challenge-content-ja/2_repository.html

-53
This file was deleted.

0 commit comments

Comments
 (0)