Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

i18next

Package Overview
Dependencies
Maintainers
1
Versions
516
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next - npm Package Compare versions

Comparing version 1.10.4 to 1.10.5

2

backends/remoteSync/package.json
{
"author": "Jan Muehlemann"
, "name": "i18next.remotesync"
, "version": "1.6.5"
, "version": "1.6.6"
, "contributors": [

@@ -6,0 +6,0 @@ { "name": "Jan Muehlemann", "email": "jan.muehlemann@gmail.com" }

@@ -15,6 +15,7 @@ var request = require('request');

if (err) {
err.i18nSkipOnError = true; // will ignore and not write to resStore --> retry on next access
cb(err);
} else if (res.statusCode && (res.statusCode.toString().indexOf('5') === 0 || res.statusCode === 404)) {
var err = new Error(res.statusMessage);
err.i18nSkipOnError = true;
err.i18nSkipOnError = true; // will ignore and not write to resStore --> retry on next access
cb(err);

@@ -21,0 +22,0 @@ } else {

@@ -0,1 +1,4 @@

### v1.10.5
- [SECURITY] update client to include - merges Reimplement XSS-vulnerable sequential replacement code [PR 443](https://github.com/i18next/i18next/pull/443)
### v1.10.4

@@ -2,0 +5,0 @@ - fixes appending lng in resStore if a namespace is omitted

@@ -5,3 +5,3 @@ {

"description": "i18n made easy - full featured: middleware, template support plus clientside use",
"version": "1.10.4",
"version": "1.10.5",
"repository": {

@@ -21,3 +21,3 @@ "type": "git",

"cookies": ">= 0.2.2",
"i18next-client": "1.10.2",
"i18next-client": "1.10.3",
"json5": "^0.2.0"

@@ -24,0 +24,0 @@ },

@@ -22,39 +22,52 @@ # Introduction

var i18next = require('i18next');
i18next.init(); // for options see i18next-node gh-page
```js
var i18next = require('i18next');
i18next.init(); // for options see i18next-node gh-page
```
Register the express middleware, so we can check current language settings:
// Configuration
app.configure(function() {
app.use(express.bodyParser());
app.use(i18next.handle);
app.use(app.router);
```js
// Configuration
app.configure(function() {
app.use(express.bodyParser());
app.use(i18next.handle);
app.use(app.router);
[...]
});
[...]
});
```
Register AppHelper so you can use the translate function in your template:
i18next.registerAppHelper(app)
```js
i18next.registerAppHelper(app)
```
Now you can (depending on your template language) do something like this in you template:
Now you can (depending on your template language) do something like this in your template(jade example):
// sample in jade
body
span= t('app.name')
```jade
body
span= t('app.name')
```
To serve the clientside script and needed routes for resources and missing keys:
i18next.serveClientScript(app)
.serveDynamicResources(app)
.serveMissingKeyRoute(app);
```js
i18next.serveClientScript(app)
.serveDynamicResources(app)
.serveMissingKeyRoute(app);
```
now you can add the script to you page and use i18next on the client like on the server:
script(src='i18next/i18next.js', type='text/javascript')
```jade
script(src='i18next/i18next.js', type='text/javascript')
```
$.i18n.init([options], function() {
$('#appname').text($.t('app.name'));
});
```js
$.i18n.init([options], function() {
$('#appname').text($.t('app.name'));
});
```

@@ -61,0 +74,0 @@ for more information on clientside usage have a look at [i18next](http://i18next.github.com/i18next/)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc