trabajo-afectivo/db/migrate/20171206000001_setting_default_locale2.rb
2022-01-01 14:38:12 +01:00

38 lines
940 B
Ruby

# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
class SettingDefaultLocale2 < ActiveRecord::Migration[5.1]
def up
# return if it's a new setup
return if !Setting.exists?(name: 'system_init_done')
setting = Setting.find_by(name: 'locale_default')
if setting
setting.area = 'System::Branding'
setting.preferences[:prio] = 8
setting.save!
end
Setting.create_if_not_exists(
title: 'Locale',
name: 'locale_default',
area: 'System::Branding',
description: 'Defines the system default language.',
options: {
form: [
{
name: 'locale_default',
}
],
},
state: 'en-us',
preferences: {
prio: 8,
controller: 'SettingsAreaItemDefaultLocale',
permission: ['admin.system'],
},
frontend: true
)
end
end