[openstreetmap/openstreetmap-website] Allow new diary entry language to be specified in params (PR #6012)

Anton Khorev notifications at github.com
Wed May 14 15:04:26 UTC 2025


It's possible to open the new diary entry link with parameters to initialize the form values like this:  
https://www.openstreetmap.org/diary/new?diary_entry[title]=Subject&diary_entry[body]=texttexttext

The only value that is not supported is entry language because it's overwritten by user preferences. But the prefences are supposed to set only the default language value judging by `diary.default_language` name, not to override explicitly specified values.

This PR allows to use the `diary_entry[language_code]` parameter to specify the language of a new diary entry.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Test if preferred diary entry language is selected
  * Allow new diary entry language to be specified in params

-- File Changes --

    M app/controllers/diary_entries_controller.rb (2)
    M test/controllers/diary_entries_controller_test.rb (64)

-- Patch Links --

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

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

Message ID: <openstreetmap/openstreetmap-website/pull/6012 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250514/72bf39d6/attachment.htm>


More information about the rails-dev mailing list