Skip to content

Commit 6f14a7d

Browse files
committed
revert README.md
1 parent fbdadd0 commit 6f14a7d

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
nodeschool.github.io
2+
====================
3+
4+
- On the web: http://nodeschool.io/
5+
- On Gitter: [nodeschool/organizers](https://gitter.im/nodeschool/organizers)
6+
7+
Please fork it and send us improvements! Read our [CONTRIBUTING.md](CONTRIBUTING.md) guide for more details on how to send a great PR.
8+
9+
**If you are an owner on the nodeschool/Owners team** please do not edit this repo directly but instead send your contributions as pull requests.
10+
11+
We ask that you make pull requests because changes to this repository will get deployed onto the live production site immediately and it's best if you get feedback on your pull request first before it goes live.
12+
13+
## Running the app locally
14+
15+
This is a static site, simply open `index.html` or use your favorite static file server to run local server.
16+
17+
You can also use the included development static server by running the following commands:
18+
19+
```
20+
npm install
21+
npm start
22+
```
23+
24+
## Stickers, Badges and whatnots
25+
26+
These are in the `/images` directory, feel free to use for your events. In `images/make-a-sticker` there is a template for making a sticker too. Woop.
27+
28+
## Translations
29+
30+
If you would like to translate the NodeSchool site into another language please make a pull request adding `languages/<language code>.json`.
31+
32+
To generate a new language file template automatically, run the following commands inside a clone of this repository:
33+
34+
```
35+
npm install
36+
npm run generate-language
37+
```
38+
39+
This will prompt you to enter a language code and will generate your language file in the `languages/` folder with English placeholder text. Now just translate each line. You should also add your language to the `languages/languages.json` list.
40+
41+
When picking your language code, please use the correct code from the first column of this spreadsheet: http://en.wikiversity.org/wiki/ISO_639-1_language_matrix
42+
43+
The way translations are implemented is using 100% client-side JavaScript. When the page is loaded the users browser locale is detected (using [browser-locale](http://npmjs.org/browser-locale)) and a XHR request is made to the `languages` folder to try and fetch a JSON translation file for that locale. First we check for the full 5 character locale file (e.g. `en-us`) and if that doesn't exist we fallback to the 2 character version (`en`) and if that doesn't exist we just do nothing and show the default English version.
44+
45+
Translation files are a mapping of translations IDs to the translated strings. There is a separate file called `languages/selectors.json` which maps CSS selectors in markup to the translation IDs.
46+
47+
The good things about this approach:
48+
49+
- The site remains a static site. This means that contributing to the site is really easy as the entire site is just flat HTML, CSS, JS and JSON files
50+
- When PRs get merged they are immediately deployed live to GitHub pages. This makes maintenance really nice as there is no manual deploy step.
51+
52+
The drawbacks of this approach:
53+
54+
- Only the English (default) version is indexed by search engines
55+
- The English version briefly appears on page loads before the translated version is swapped in
56+
57+
### Update Translations
58+
59+
Are you not sure what translations is missing? Don't worry! :)
60+
Just run this command:
61+
62+
```
63+
npm install
64+
npm run generate-untranslated-lang
65+
```
66+
67+
You will find untranslated IDs in `languages/xx.untranslated.json`.

0 commit comments

Comments
 (0)