<p></p>
<p><b>@gravitystorm</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3257#discussion_r674219671">app/controllers/preferences_controller.rb</a>:</p>
<pre style='color:#555'>> +  layout "site"
+
+  before_action :authorize_web
+  before_action :set_locale
+
+  authorize_resource :class => false
+
+  before_action :check_database_readable
+  before_action :check_database_writable, :only => [:update]
+
+  def show; end
+
+  def edit; end
+
+  def update
+    current_user.languages = params[:user][:languages].split(",")
</pre>
<p>OK, I've refactored (and force-pushed) so that we use a partial to ensure the successful flash message is shown in the updated language (simply by deferring the lookup of the flash message to the subsequent page load). I've added tests, but the important one is disabled until there's actually another translation to test against!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3257#discussion_r674219671">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLMTTBQSNFNKSWN4HHLTY4E4PANCNFSM5AL23W7Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLI5XE32SCWEJEIXJTDTY4E4PA5CNFSM5AL23W72YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFJYFE5Y.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3257#discussion_r674219671",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3257#discussion_r674219671",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>