Skip to content

Latest commit

 

History

History
65 lines (47 loc) · 3.39 KB

File metadata and controls

65 lines (47 loc) · 3.39 KB

speed.measurementlab.net source code

Contributing to this project

This repository has interaction limits enabled. Issues and pull requests are restricted to repository collaborators. This is in response to a high volume of unsolicited, AI-generated contributions that were consuming maintainer time without adding value.

If you are interested in contributing — including for Google Summer of Code — please:

  1. Read our contribution requirements
  2. Join our gsoc-contributors mailing list and introduce yourself
  3. Coordinate with a maintainer on what you'd like to work on
  4. Once vetted, you will be added as a collaborator and can open issues and PRs

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.

The mlab-speedtest repository implements the https://speed.measurementlab.net/ website.

Setting up Local Development Environment

Install Build Dependencies

  • Install website build dependencies for your operating system and environment
    • Node >= v20.0 - Using NVM: nvm install v20.0
    • Install libraries - npm install
    • Build dist - npm run build -- staging
    • Serving locally - python3 -m http.server -d dist
    • Firebase tools - npm install -g firebase-tools

Adding new languages

Translations for this site are managed in the Open Technology Fund's Localization Lab Transifex site. Contributing translators may choose to translate and/or review translations there. Completed translations are then imported for use within this application and published by M-Lab staff.

How to add a new localization

  1. Download the completed .po file from Transifex and save it in translations/languages/
    • Use the existing naming convention (e.g., es.po, de_DE.po)
  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)
  3. Add the short language code to the supported array in src/js/i18n.js
    • If the language is RTL, also add it to the rtlLanguages array
  4. Rebuild: npm run build -- staging

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.

Previewing site locally

To preview the site locally, we recommend using Python:

npm install
npm run build -- staging
python3 -m http.server -d dist

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

Deployment

The site is deployed via GitHub Actions to Firebase Hosting:

Environment Trigger URL
Sandbox Pull request (from same repo) https://mlab-sandbox.web.app
Production Merge to main https://speed.measurementlab.net

Note: PR deployments only work for branches pushed directly to m-lab/mlab-speedtest, not from forks (due to Firebase secrets not being available to fork PRs).