@ladjs/i18n
Advanced tools
Comparing version 3.0.11 to 3.0.12
@@ -38,7 +38,4 @@ "use strict"; | ||
const _require5 = require('qs'), | ||
stringify = _require5.stringify; // expose global | ||
stringify = _require5.stringify; | ||
i18n.api = {}; | ||
class I18N { | ||
@@ -69,3 +66,2 @@ constructor(config = {}) { | ||
}, | ||
register: i18n.api, | ||
lastLocaleField: 'last_locale', | ||
@@ -106,3 +102,3 @@ ignoredRedirectGlobs: [], | ||
if (typeof phrase !== 'string') throw new Error(`translation key missing: ${key}`); | ||
return i18n.api.t({ | ||
return this.api.t({ | ||
phrase, | ||
@@ -127,3 +123,3 @@ locale | ||
i18n.init(ctx.request, ctx.state); // expose a helper function to `ctx.state.l` | ||
this.init(ctx.request, ctx.state); // expose a helper function to `ctx.state.l` | ||
// which prefixes a link/path with the locale | ||
@@ -175,3 +171,3 @@ | ||
i18n.setLocale([ctx.request, ctx.state], locale); | ||
this.setLocale([ctx.request, ctx.state], locale); | ||
ctx.locale = ctx.request.locale; | ||
@@ -178,0 +174,0 @@ ctx.set('Content-Language', ctx.locale); // if the locale was not available then redirect user |
{ | ||
"name": "@ladjs/i18n", | ||
"description": "i18n wrapper and Koa middleware for Lad", | ||
"version": "3.0.11", | ||
"version": "3.0.12", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -6,0 +6,0 @@ "ava": { |
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
21690
211