From 99dbcdb3b0d2a33f17f58e070ad9b0697242f006 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Wed, 24 Jun 2020 15:27:17 +0100 Subject: [PATCH] Renamed `defaultLocale` setting to `lang` refs https://github.com/TryGhost/Ghost/issues/10318 - API has been updated to still work with `default_locale` for backwards compatibility but it makes sense for the client to match the underlying settings keys --- ghost/admin/app/models/setting.js | 2 +- ghost/admin/app/services/custom-views.js | 2 +- ghost/admin/app/templates/settings/general.hbs | 16 ++++++++-------- ghost/admin/mirage/fixtures/settings.js | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ghost/admin/app/models/setting.js b/ghost/admin/app/models/setting.js index a20d561e17..a46a809f10 100644 --- a/ghost/admin/app/models/setting.js +++ b/ghost/admin/app/models/setting.js @@ -11,7 +11,7 @@ export default Model.extend(ValidationEngine, { coverImage: attr('string'), icon: attr('string'), accentColor: attr('string'), - defaultLocale: attr('string'), + lang: attr('string'), activeTimezone: attr('string', {defaultValue: 'Etc/UTC'}), codeinjectionHead: attr('string'), codeinjectionFoot: attr('string'), diff --git a/ghost/admin/app/services/custom-views.js b/ghost/admin/app/services/custom-views.js index 55420b9178..bcab6919ad 100644 --- a/ghost/admin/app/services/custom-views.js +++ b/ghost/admin/app/services/custom-views.js @@ -126,7 +126,7 @@ export default class CustomViewsService extends Service { return; } - let views = JSON.parse(settings.get('sharedViews') || '{}'); + let views = JSON.parse(settings.get('sharedViews') || '[]'); views = isArray(views) ? views : []; let viewList = []; diff --git a/ghost/admin/app/templates/settings/general.hbs b/ghost/admin/app/templates/settings/general.hbs index 929536c971..12ee03ae23 100644 --- a/ghost/admin/app/templates/settings/general.hbs +++ b/ghost/admin/app/templates/settings/general.hbs @@ -76,23 +76,23 @@
Publication Language
Set the language/locale which is used on your site
- {{#liquid-if this.defaultLocaleOpen}} + {{#liquid-if this.langOpen}}
- + - +

Default: English (en); you can add translation files to your theme for any language

{{/liquid-if}}
- +
diff --git a/ghost/admin/mirage/fixtures/settings.js b/ghost/admin/mirage/fixtures/settings.js index fb347f1343..8f880299d6 100644 --- a/ghost/admin/mirage/fixtures/settings.js +++ b/ghost/admin/mirage/fixtures/settings.js @@ -42,7 +42,7 @@ export default [ }, { id: 5, - key: 'default_locale', + key: 'lang', value: 'en', group: 'site', created_at: '2013-11-25T14:48:11.000Z',