DEV: Support translated title in desktop/notifications (PR #14325)

Allow translated title to be passed to desktop and push notifications, to be used instead of generating the translation on the client.

This is useful because only a small number of variables are passed into the client translation. If you have something like I do (I need a chat channel name as a variable in the translation), you’re currently out of luck. https://github.com/discourse/discourse/blob/c16358ecc09c9df70eed45c71fadda852848f005/app/assets/javascripts/discourse/app/lib/desktop-notifications.js#L156-L160

Also on the ensure_consistency job, exclude chat_message notifications from being cleaned up (they aren’t associated with a topic or post). There may be a slicker way to do this rather than another AND condition

GitHub

did you mean to double up these lines?

One is chat_mention, one is chat_message. Obviously the first one is for mentioning, but the second is for when you’re notification preferences are to get a notification on every new chat message in a channel.

Wow, I’m dumb! I swear I re-read that 10 times to be sure.

AND notification_type NOT IN (#{types[:chat_mention].to_i}, #{types[:chat_message].to_i})