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
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,16 +13,17 @@
13
13
>
14
14
> We expect all contributions to reflect a genuine understanding of the code being changed. PRs that appear to be generated by AI tools without meaningful human review will be closed.
15
15
16
-
`mlab-speedtest`is an Angular.js application providing the website https://speed.measurementlab.net. The app code currently uses `gulp` to integrate language localizations prior to deployment.
16
+
The `mlab-speedtest`repository implements the https://speed.measurementlab.net/ website.
17
17
18
18
## Setting up Local Development Environment
19
19
20
20
### Install Build Dependencies
21
21
22
22
* Install website build dependencies for your operating system and environment
23
-
* Node >= v10.15.1 - Using NVM: `nvm install v10.15.1`
* to: `<script src="/assets/translations/es.js"></script>`
45
-
* Regenerate the supported language strings:
46
-
*`gulp inject`
35
+
1. Download the completed `.po` file from Transifex and save it in `translations/languages/`
36
+
* Use the existing naming convention (e.g., `es.po`, `de_DE.po`)
37
+
2. If the filename uses a locale code (e.g., `de_DE`), add a mapping in `scripts/po-to-json.js` so it maps to the short code (e.g., `de_DE` -> `de`)
38
+
3. Add the short language code to the `supported` array in `src/js/i18n.js`
39
+
* If the language is RTL, also add it to the `rtlLanguages` array
40
+
4. Rebuild: `npm run build`
41
+
42
+
The build converts `.po` files to JSON in `dist/translations/`. At runtime, `i18n.js` selects the language automatically via the `?lang=` query parameter, `localStorage`, or browser preference.
47
43
48
44
## Previewing site locally
49
45
50
-
To preview the site locally, we recommend using the Python Simple HTTP Server.
46
+
To preview the site locally, we recommend using Python:
51
47
52
-
* Navigate to the `/app` directory and run: `python3 -m http.server 8000`
48
+
```
49
+
npm install
50
+
npm run build
51
+
python3 -m http.server -d dist
52
+
```
53
53
54
54
If you are a user on the M-Lab Firebase project, you can also preview the site locally using the firebase-cli: `firebase serve --only hosting:mlab-speedtest`
0 commit comments