Add user's preferred language to cache key of MR title partial
What does this MR do and why?
This is to fix a bug wherein the Edit button is being shown in a different language from the current user's preferred language.
Before this fix, when the partial was cached and the language is different, it'll stay that way until the cache is invalidated.
Now, the current user's preferred language will be taken into consideration for the cache key.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Enable caching on dev:
rails dev:cache
. - View an open MR and see that the "Edit" button is shown on current user's preferred language.
- Update the viewer's preferred language to a different language (e.g. German).
- View the same open MR again and the "Edit" button should show in the updated user's preferred language.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #350217 (closed)