Browse Source

Do not fetch environment variables to determine default locale (#6618)

The default locale is now set by config.
Akihiko Odaki 6 years ago
parent
commit
778b37790b
2 changed files with 3 additions and 5 deletions
  1. 1 1
      app/serializers/rest/instance_serializer.rb
  2. 2 4
      lib/tasks/assets.rake

+ 1 - 1
app/serializers/rest/instance_serializer.rb

@@ -48,7 +48,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
   end
 
   def languages
-    [ENV.fetch('DEFAULT_LOCALE', I18n.default_locale)]
+    [I18n.default_locale]
   end
 
   private

+ 2 - 4
lib/tasks/assets.rake

@@ -1,10 +1,8 @@
 # frozen_string_literal: true
 
 def render_static_page(action, dest:, **opts)
-  I18n.with_locale(ENV['DEFAULT_LOCALE'] || I18n.default_locale) do
-    html = ApplicationController.render(action, opts)
-    File.write(dest, html)
-  end
+  html = ApplicationController.render(action, opts)
+  File.write(dest, html)
 end
 
 namespace :assets do