]> cat aescling's git repositories - mastodon.git/commitdiff
Do not fetch environment variables to determine default locale (#6618)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Sun, 4 Mar 2018 09:00:46 +0000 (18:00 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 4 Mar 2018 09:00:46 +0000 (10:00 +0100)
The default locale is now set by config.

app/serializers/rest/instance_serializer.rb
lib/tasks/assets.rake

index e903604b2698e70b2ccadf5061c9c0a7c8ef5b94..e3e64ea8767fcda5b1e93fb7ad786f39be60966a 100644 (file)
@@ -48,7 +48,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
   end
 
   def languages
-    [ENV.fetch('DEFAULT_LOCALE', I18n.default_locale)]
+    [I18n.default_locale]
   end
 
   private
index 0826f018641eefdac49e004e3195d8bbad778f2f..b642510a1625766c899b2e852f6573b66ac4bec7 100644 (file)
@@ -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