0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Merge pull request #637 from sebgie/issue#625

This commit is contained in:
Hannah Wolfe 2013-09-06 18:47:18 +01:00
commit 4a0309a527
5 changed files with 15 additions and 22 deletions

View file

@ -3,22 +3,6 @@
var path = require('path'),
config = {};
// ## Admin settings
// Default language
config.defaultLang = 'en';
// Force i18n to be on
config.forceI18n = true;
// ## Plugins
// Current active plugins
config.activePlugins = [
'FancyFirstChar'
];
// ## Default Navigation Items
// Add new objects here to extend the menu output by {{nav}}
config.nav = [

View file

@ -146,11 +146,11 @@ Ghost.prototype.init = function () {
instance.mail.init(self)
).then(function () {
return models.Settings.populateDefaults();
}).then(function () {
return self.initPlugins();
}).then(function () {
// Initialize the settings cache
return self.updateSettingsCache();
}).then(function () {
return self.initPlugins();
}).then(function () {
// Initialize the permissions actions and objects
return permissions.init();
@ -301,7 +301,7 @@ Ghost.prototype.doFilter = function (name, args, callback) {
// Initialise plugins. Will load from config.activePlugins by default
Ghost.prototype.initPlugins = function (pluginsToLoad) {
pluginsToLoad = pluginsToLoad || config.activePlugins;
pluginsToLoad = pluginsToLoad || models.Settings.activePlugins;
var self = this;

View file

@ -44,10 +44,19 @@
"value": "",
"type": "blog"
},
{
"key": "defaultLang",
"value": "en",
"type": "blog"
},
{
"key": "forceI18n",
"value": true,
"type": "blog"
},
{
"key": "postsPerPage",
"value": "6",
"type": "blog"
}
]

View file

@ -223,7 +223,7 @@ coreHelpers = function (ghost) {
ghost.registerThemeHelper('e', function (key, defaultString, options) {
var output;
if (ghost.config().defaultLang === 'en' && _.isEmpty(options.hash) && !ghost.config().forceI18n) {
if (ghost.settings().defaultLang === 'en' && _.isEmpty(options.hash) && !ghost.settings().forceI18n) {
output = defaultString;
} else {
output = ghost.polyglot().t(key, options.hash);

View file

@ -8,7 +8,7 @@ var fs = require('fs'),
I18n = function (ghost) {
// TODO: validate
var lang = ghost.config().defaultLang,
var lang = ghost.settings().defaultLang,
path = ghost.paths().lang,
langFilePath = path + lang + '.json';