[openstreetmap/openstreetmap-website] Set i18n locale before writing "report a problem" on embed page (PR #4934)

Anton Khorev notifications at github.com
Sun Jun 30 02:00:33 UTC 2024


`/export/embed` page has the "Report a problem" link which is supposed to be localized depending on the browser's accept-language header. But that doesn't happen because javascript waits for `window.onload` before setting the language. By that time `L.Control.OSMReportAProblem` is already created with a default locale.

![image](https://github.com/openstreetmap/openstreetmap-website/assets/4158490/d67e1985-81a1-4e7d-aeba-f0929c0d9262)
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4934

-- Commit Summary --

  * Set i18n locale before writing "report a problem" on embed page

-- File Changes --

    M app/assets/javascripts/embed.js.erb (12)
    A test/system/embed_test.rb (19)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4934.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4934.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4934
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4934 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240629/539d6ec9/attachment.htm>


More information about the rails-dev mailing list