You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-7Lines changed: 5 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,7 @@ We ask that you make pull requests because changes to this repository will get d
12
12
13
13
## Running the app locally
14
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:
15
+
This is a static site with a build step, simply run `npm start`:
18
16
19
17
```
20
18
npm install
@@ -40,19 +38,19 @@ This will prompt you to enter a language code and will generate your language fi
40
38
41
39
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
40
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.
41
+
The way translations are implemented is building static pages using Codeship (see `./scripts`for details).
44
42
45
43
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
44
47
45
The good things about this approach:
48
46
47
+
- Every language is indexed by search engines.
49
48
- 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.
49
+
- When PRs get merged they are almost immediately deployed live to GitHub pages. This makes maintenance really nice as there is no manual deploy step.
51
50
52
51
The drawbacks of this approach:
53
52
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
53
+
- Default branch is `source` as we can't use `master` anymore.
0 commit comments