@ladjs/i18n
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -62,3 +62,4 @@ "use strict"; | ||
}, | ||
register: i18n.api | ||
register: i18n.api, | ||
lastLocaleField: 'last_locale' | ||
}, config); // validate locales against available ones | ||
@@ -196,6 +197,6 @@ | ||
debug('set cookies for locale "%s"', locale); // if the user is logged in and ctx.isAuthenticated() exists, | ||
// then save it as `last_locale` | ||
// then save it as `last_locale` (variable based off lastLocaleField) | ||
if (isFunction(ctx.isAuthenticated) && ctx.isAuthenticated()) { | ||
ctx.state.user.last_locale = locale; | ||
ctx.state.user[_this.config.lastLocaleField] = locale; | ||
@@ -202,0 +203,0 @@ try { |
{ | ||
"name": "@ladjs/i18n", | ||
"description": "i18n wrapper and Koa middleware for Lad", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -6,0 +6,0 @@ "ava": { |
@@ -94,3 +94,3 @@ # [**@ladjs/i18n**](https://github.com/ladjs/i18n) | ||
This also stores the `last_locale` for a user via `ctx.state.user.save()`. | ||
This also stores the `last_locale` (or whatever you configure the property name to be in the config option `lastLocaleField`) for a user via `ctx.state.user.save()`. | ||
@@ -126,3 +126,4 @@ | ||
}, | ||
register: i18n.api | ||
register: i18n.api, | ||
lastLocaleField: 'last_locale' | ||
}); | ||
@@ -129,0 +130,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17155
169
178