[openstreetmap/openstreetmap-website] Build export download links from locale keys (PR #7271)
Lee Kindness
notifications at github.com
Tue Jul 28 20:04:40 UTC 2026
Replaces the four hardcoded bulk download URLs on the export page with values read from locale keys, following the pattern already used by the help page.
### Description
Addresses #7215.
The four "too large" download links have their URLs hardcoded in `app/views/site/export.html.erb`, and the Overpass one is spelled out a second time in `export.js` so the bbox can be appended on each map move. As a result the URLs cannot be localised - i.e the wiki download page in the reader's language - and cannot be pointed elsewhere by deployments that are not openstreetmap.org.
Changes:
- A `url` key alongside the existing `title` and `description` for each of the four sources, matching how `site.help.*` already holds its URLs.
- The view builds the list from a keyed array rather than four hand-written `dt`/`dd` pairs.
- `export.js` reads the Overpass base URL from a `data-base-url` attribute instead of a hardcoded literal, so the URL is stated once rather than twice. The rest of the file is untouched, jQuery included.
- A controller test asserting each link renders from its locale key, and that the Overpass link carries the attribute `export.js` depends on.
Note:
- `settings.overpass_url` is deliberately left alone. It is the query server's interpreter endpoint, a separate concern from the export download link — mixing up the two is why #7208 was closed.
- `data-base-url` is emitted on all four links but only read for Overpass, to keep the loop uniform. This could be restricted to that one source instead. The attribute is needed because `setBounds` overwrites `href` on every map move, so the pristine base cannot be read back from `href`, and `site.export.*` is not part of the JS translation bundle.
### How has this been tested?
- Linting. All clean: `bundle exec erb_lint .`, `bundle exec rails eslint`, `bundle exec rubocop`, `bundle exec i18n export`.
- Unit test: `bundle exec rails test test/controllers/site_controller_test.rb`.
- Manual edits to `en.yml` and `en-GB.yml` (my configured locale) to confirm changes picked up, URLs read, inherit from `en`
- Manual edits to `settings.overpass_url` to ensure the two Overpass servers which can be configured are distinct
Claude Code was used during the development.
You can view, comment on, or merge this pull request online at:
https://github.com/openstreetmap/openstreetmap-website/pull/7271
-- Commit Summary --
* Build export download links from locale keys
-- File Changes --
M app/assets/javascripts/index_modules/export.js (2)
M app/views/site/export.html.erb (18)
M config/locales/en.yml (4)
M test/controllers/site_controller_test.rb (17)
-- Patch Links --
https://github.com/openstreetmap/openstreetmap-website/pull/7271.patch
https://github.com/openstreetmap/openstreetmap-website/pull/7271.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7271
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7271 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260728/4b289546/attachment-0001.htm>
More information about the rails-dev
mailing list