summaryrefslogtreecommitdiffstats
path: root/lib/generators/website.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generators/website.js')
-rw-r--r--lib/generators/website.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/generators/website.js b/lib/generators/website.js
index 5dffd14..bb2daa1 100644
--- a/lib/generators/website.js
+++ b/lib/generators/website.js
@@ -70,6 +70,8 @@ Generator.prototype.prepareTemplateEngine = function() {
return fs.readdir(path.resolve(__dirname, "../../theme/i18n"))
.then(function(locales) {
+ var language = that.book.config.normalizeLanguage();
+
locales = _.chain(locales)
.map(function(local) {
local = path.basename(local, ".json");
@@ -78,8 +80,8 @@ Generator.prototype.prepareTemplateEngine = function() {
.object()
.value();
- if (!_.contains(_.keys(locales), that.options.language)) {
- that.book.logWarn("Language '"+that.options.language+"' is not available as a layout locales ("+_.keys(locales).join(", ")+")");
+ if (!_.contains(_.keys(locales), language) && language != "en") {
+ that.book.logWarn("Language '"+language+"' is not available as a layout locales (en, "+_.keys(locales).join(", ")+")");
}
var folders = _.chain(that.templates)
@@ -215,7 +217,7 @@ Generator.prototype._writeTemplate = function(tpl, options, output, interpolate)
title: that.options.title,
description: that.options.description,
- language: that.options.language,
+ language: that.book.config.normalizeLanguage(),
glossary: that.book.glossary,