Fix availble languages now that mapping no longer happens

pull/7408/head
Oliver Günther 5 years ago
parent 14383e35a6
commit f5d8c9aca9
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 2
      config/settings.yml
  2. 27
      db/migrate/20190618115620_fix_available_languages.rb

@ -158,7 +158,7 @@ available_languages:
- pt
- 'pt-BR'
- it
- zh
- 'zh-CN'
- ko
- ru
default_language:

@ -0,0 +1,27 @@
class FixAvailableLanguages < ActiveRecord::Migration[5.2]
def up
Setting.available_languages = Setting.available_languages.map do |lang|
if lang == 'zh'
'zh-CN'
else
lang
end
end
User.where(language: 'zh').update_all(language: 'zh-CN')
end
def down
Setting.available_languages = Setting.available_languages.map do |lang|
if lang == 'zh-CN'
'zh'
else
lang
end
end
User.where(language: 'zh-CN').update_all(language: 'zh')
end
private
end
Loading…
Cancel
Save