0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Added 'locale' property to public settings

refs https://github.com/TryGhost/Team/issues/509

- During 3.x we standardised on "lang" instead of "default_locale" for the site setting, which was an assumption based on an earlier change to @site.lang to make <html lang="@site.lang"> read nicer. This was a mistake as the field represents more than "lang" its a "locale". With this changeset we introduce a transition to use "locale" name for the value instead of "lang"
- Adds `@site.locale" value in as well as new 'locale' property in Content API's response
- "lang" will be considered as deprecated starting with API v4 and will be dropped completely with API v5
This commit is contained in:
Naz 2021-03-04 16:00:02 +13:00
parent e133c45314
commit 41c93f982d
2 changed files with 3 additions and 1 deletions

View file

@ -16,6 +16,7 @@ module.exports = {
facebook: 'facebook', facebook: 'facebook',
twitter: 'twitter', twitter: 'twitter',
lang: 'lang', lang: 'lang',
locale: 'lang',
timezone: 'timezone', timezone: 'timezone',
codeinjection_head: 'codeinjection_head', codeinjection_head: 'codeinjection_head',
codeinjection_foot: 'codeinjection_foot', codeinjection_foot: 'codeinjection_foot',

View file

@ -19,6 +19,7 @@ const defaultSettingsKeys = [
'facebook', 'facebook',
'twitter', 'twitter',
'lang', 'lang',
'locale',
'timezone', 'timezone',
'codeinjection_head', 'codeinjection_head',
'codeinjection_foot', 'codeinjection_foot',
@ -82,7 +83,7 @@ describe('Settings Content API', function () {
settings.should.have.properties(publicProperties); settings.should.have.properties(publicProperties);
// The length below should only change when public settings have been removed or added // The length below should only change when public settings have been removed or added
Object.keys(settings).length.should.equal(24); Object.keys(settings).length.should.equal(25);
Object.keys(settings).should.deepEqual(defaultSettingsKeys); Object.keys(settings).should.deepEqual(defaultSettingsKeys);
// Verify that we are returning the defaults for each value // Verify that we are returning the defaults for each value