[openstreetmap/openstreetmap-website] add IDs to note and changeset mail subjects (PR #3952)
Andy Allan
notifications at github.com
Wed Jun 14 13:28:43 UTC 2023
@gravitystorm requested changes on this pull request.
@Strubbl thank you for your PR. I've marked this as a draft, since it is only partially implemented and not suitable for merging.
You asked where the interpolation values would come from, and one example is here:
https://github.com/openstreetmap/openstreetmap-website/blob/e9e4b10473fa536cdb840303ee4afccf71c69329/app/mailers/user_mailer.rb#L143-L147
You can see how the `commenter` variable is set. You need to do something similar for e.g. `note_id`. You can access the note id in this context in various ways, e.g. `comment.note.id`.
You will also need to adjust the tests, or write new ones, to make sure the subject line is filled in correctly.
> @@ -1585,8 +1585,8 @@ en:
anonymous: An anonymous user
greeting: "Hi,"
commented:
- subject_own: "[OpenStreetMap] %{commenter} has commented on one of your notes"
- subject_other: "[OpenStreetMap] %{commenter} has commented on a note you are interested in"
+ subject_own: "[OpenStreetMap] %{commenter} has commented on your note %{note_id}"
+ subject_other: "[OpenStreetMap] %{commenter} has commented on note %{note_id} you are interested in"
your_note: "%{commenter} has left a comment on one of your map notes near %{place}."
You will also need to change the other `subject_own` and `subject_other` translations further down this file - there are separate subjects for "commented" "closed" and "reopened" events.
> @@ -1611,8 +1611,8 @@ en:
hi: "Hi %{to_user},"
greeting: "Hi,"
commented:
- subject_own: "[OpenStreetMap] %{commenter} has commented on one of your changesets"
- subject_other: "[OpenStreetMap] %{commenter} has commented on a changeset you are interested in"
+ subject_own: "[OpenStreetMap] %{commenter} has commented on your changeset %{changeset_id}"
+ subject_other: "[OpenStreetMap] %{commenter} has commented on changeset %{changeset_id} you are interested in"
your_changeset: "%{commenter} left a comment at %{time} on one of your changesets"
Unfortunately, for technical reasons explained below, you can't change the interpolation variables in a translation, without also changing the key.
The technical reason is that the interpolation variables must be exactly the same in all translations for the same key. It can take several weeks, or longer, for all the translators to update their translations, and in the meantime the code would not work in those languages. So if you change the interpolations in a value, you need to change the key (e.g. `subject_own`) to something else too.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3952#pullrequestreview-1479439738
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3952/review/1479439738 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230614/00870ee2/attachment.htm>
More information about the rails-dev
mailing list