about summary refs log tree commit diff
path: root/lib/tasks/assets.rake
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-09-25 23:05:54 +0200
committerGitHub <noreply@github.com>2017-09-25 23:05:54 +0200
commit3b60832214fdd9d8b5fd01e9a177a6dde5259907 (patch)
tree7685a3e67baf1ed4caff4eef62ab2e724a58801e /lib/tasks/assets.rake
parent259181c41a5b6d4654e4e956490a3e4120bc9920 (diff)
New error page graphic. Other error page improvements (#5099)
- 500.html generated with admin-set default locale if set
- Error page `<title>` includes Mastodon site title
- 500 title changed to "This page is not
  correct" (ref: <https://www.youtube.com/watch?v=2VCAP_seh1A>)
- 500 content appended with "on our end" to make clear it's
  not user's fault
Diffstat (limited to 'lib/tasks/assets.rake')
-rw-r--r--lib/tasks/assets.rake7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake
index ad7c6ba90..2ef72fdef 100644
--- a/lib/tasks/assets.rake
+++ b/lib/tasks/assets.rake
@@ -3,15 +3,16 @@
 namespace :assets do
   desc 'Generate 500.html'
   task :generate_500 do
-    html = ApplicationController.render('errors/500', layout: 'error')
-    File.write(Rails.root.join('public', '500.html'), html)
+    I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do
+      html = ApplicationController.render('errors/500', layout: 'error')
+      File.write(Rails.root.join('public', '500.html'), html)
+    end
   end
 end
 
 if Rake::Task.task_defined?('assets:precompile')
   Rake::Task['assets:precompile'].enhance do
     Webpacker::Manifest.load
-
     Rake::Task['assets:generate_500'].invoke
   end
 end