mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Renamed settings keys from default_locale to lang
refs #10318
refs 2614565d5a
- Renames default_locale settings key as introduced in referenced
migration
This commit is contained in:
parent
8a817050c5
commit
c4dff2d50e
7 changed files with 11 additions and 11 deletions
|
@ -72,7 +72,7 @@ class ThemeI18n extends i18n.I18n {
|
|||
* Load the current locale out of the settings cache
|
||||
*/
|
||||
_loadLocale() {
|
||||
this._locale = settingsCache.get('default_locale');
|
||||
this._locale = settingsCache.get('lang');
|
||||
return this._locale;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ events.on('services.themes.activated', function () {
|
|||
/**
|
||||
* When locale changes, we reload theme translations
|
||||
*/
|
||||
events.on('settings.default_locale.edited', function () {
|
||||
events.on('settings.lang.edited', function () {
|
||||
themeI18n.init();
|
||||
});
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
"accent_color": {
|
||||
"defaultValue": ""
|
||||
},
|
||||
"default_locale": {
|
||||
"lang": {
|
||||
"defaultValue": "en",
|
||||
"validations": {
|
||||
"isEmpty": false
|
||||
|
|
|
@ -15,7 +15,7 @@ module.exports = {
|
|||
cover_image: 'cover_image',
|
||||
facebook: 'facebook',
|
||||
twitter: 'twitter',
|
||||
default_locale: 'lang',
|
||||
lang: 'lang',
|
||||
active_timezone: 'timezone',
|
||||
// TODO: substitute ghost_head and ghost_foot with codeinjection_* when we drop v2 (Ghost 4.0)
|
||||
ghost_head: 'ghost_head',
|
||||
|
|
|
@ -5,7 +5,7 @@ const proxy = require('../../../core/frontend/services/proxy');
|
|||
|
||||
describe('{{lang}} helper', function () {
|
||||
beforeEach(function () {
|
||||
settingsCache.set('default_locale', {value: 'en'});
|
||||
settingsCache.set('lang', {value: 'en'});
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('{{t}} helper', function () {
|
|||
});
|
||||
|
||||
it('theme translation is DE', function () {
|
||||
settingsCache.set('default_locale', {value: 'de'});
|
||||
settingsCache.set('lang', {value: 'de'});
|
||||
themeI18n.init();
|
||||
|
||||
let rendered = helpers.t.call({}, 'Top left Button', {
|
||||
|
@ -28,7 +28,7 @@ describe('{{t}} helper', function () {
|
|||
});
|
||||
|
||||
it('theme translation is EN', function () {
|
||||
settingsCache.set('default_locale', {value: 'en'});
|
||||
settingsCache.set('lang', {value: 'en'});
|
||||
themeI18n.init();
|
||||
|
||||
let rendered = helpers.t.call({}, 'Top left Button', {
|
||||
|
@ -39,7 +39,7 @@ describe('{{t}} helper', function () {
|
|||
});
|
||||
|
||||
it('[fallback] no theme translation file found for FR', function () {
|
||||
settingsCache.set('default_locale', {value: 'fr'});
|
||||
settingsCache.set('lang', {value: 'fr'});
|
||||
themeI18n.init();
|
||||
|
||||
let rendered = helpers.t.call({}, 'Top left Button', {
|
||||
|
@ -51,7 +51,7 @@ describe('{{t}} helper', function () {
|
|||
|
||||
it('[fallback] no theme files at all, use key as translation', function () {
|
||||
settingsCache.set('active_theme', {value: 'casper-1.4'});
|
||||
settingsCache.set('default_locale', {value: 'de'});
|
||||
settingsCache.set('lang', {value: 'de'});
|
||||
themeI18n.init();
|
||||
|
||||
let rendered = helpers.t.call({}, 'Top left Button', {
|
||||
|
|
|
@ -2296,7 +2296,7 @@
|
|||
},
|
||||
{
|
||||
"id": "5c2ca6e0e015a67616182416",
|
||||
"key": "default_locale",
|
||||
"key": "lang",
|
||||
"value": "en",
|
||||
"type": "site",
|
||||
"created_at": "2019-01-02T11:56:16.000Z",
|
||||
|
|
|
@ -1254,7 +1254,7 @@
|
|||
},
|
||||
{
|
||||
"id": "59a952c2ebbf7206b369cdcb",
|
||||
"key": "default_locale",
|
||||
"key": "lang",
|
||||
"value": "en",
|
||||
"type": "site",
|
||||
"created_at": "2017-09-01T12:29:54.000Z",
|
||||
|
|
Loading…
Add table
Reference in a new issue