Give option to go english only

master
Mark Moffat 2019-11-06 19:13:16 +10:30
parent 2aa973a692
commit c92194dd56
4 changed files with 9 additions and 2 deletions

View File

@ -115,6 +115,10 @@
}, },
"defaultLocale": { "defaultLocale": {
"type": "string" "type": "string"
},
"enableLanguages": {
"type": "boolean",
"default": true
} }
}, },
"required": [ "required": [

View File

@ -161,5 +161,6 @@
"Leave a comment?": "Lascia un commento?", "Leave a comment?": "Lascia un commento?",
"Cart contents": "Contenuto del carrello", "Cart contents": "Contenuto del carrello",
"Shipping": "Spedizione:", "Shipping": "Spedizione:",
"Empty cart": "Svuota carrello" "Empty cart": "Svuota carrello",
"Payment ID": "Payment ID"
} }

View File

@ -615,7 +615,7 @@ router.get('/:page?', async (req, res, next) => {
message: clearSessionValue(req.session, 'message'), message: clearSessionValue(req.session, 'message'),
messageType: clearSessionValue(req.session, 'messageType'), messageType: clearSessionValue(req.session, 'messageType'),
pageCloseBtn: showCartCloseBtn('page'), pageCloseBtn: showCartCloseBtn('page'),
config: req.app.config, config,
productsPerPage: numberProducts, productsPerPage: numberProducts,
totalProductCount: results.totalProducts, totalProductCount: results.totalProducts,
pageNum: 1, pageNum: 1,

View File

@ -103,6 +103,7 @@
</div> </div>
<div id="navbar" class="navbar-collapse collapse"> <div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
{{#ifCond @root.config.enableLanguages "!=" false}}
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ @root.__ "Languages" }} <span class="caret"></span></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ @root.__ "Languages" }} <span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
@ -111,6 +112,7 @@
{{/availableLanguages}} {{/availableLanguages}}
</ul> </ul>
</li> </li>
{{/ifCond}}
{{#unless admin}} {{#unless admin}}
{{#ifCond page '!=' 'checkout'}} {{#ifCond page '!=' 'checkout'}}
{{#ifCond page '!=' 'pay'}} {{#ifCond page '!=' 'pay'}}