If you need to get the current path without locale use this Fix
Add to: var options = _.extend({
, 'helper_path_current' : '__c'
Add to: this.middleware = function(req, res, next){
res.locals[self.options['helper_path_current']] = self.pathCurrentHelper(req.path);
Add to: var i18n = function(){
this.pathCurrentHelper = function(path) {
return function(locale) {
var current = path.replace(new RegExp("^(/("+self.options.enabled.join("|")+"))?", "i"), '');
if(locale!=undefined)
locale = locale.replace(///, '');
var langIndex = self.options.enabled.indexOf(locale);
if(langIndex>=0&&self.options.default!=locale)
current = '/' + self.options.enabled[langIndex] + current;
return current;
};
};
You can use __c() you get the current Path without locale.
If you would change current path to a locale use it like __c('de'), __('en')...
If you need to get the current path without locale use this Fix
Add to: var options = _.extend({
, 'helper_path_current' : '__c'
Add to: this.middleware = function(req, res, next){
res.locals[self.options['helper_path_current']] = self.pathCurrentHelper(req.path);
Add to: var i18n = function(){
this.pathCurrentHelper = function(path) {
return function(locale) {
var current = path.replace(new RegExp("^(/("+self.options.enabled.join("|")+"))?", "i"), '');
if(locale!=undefined)
locale = locale.replace(///, '');
var langIndex = self.options.enabled.indexOf(locale);
if(langIndex>=0&&self.options.default!=locale)
current = '/' + self.options.enabled[langIndex] + current;
return current;
};
};
You can use __c() you get the current Path without locale.
If you would change current path to a locale use it like __c('de'), __('en')...