New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

i18njs

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18njs - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

2

bower.json
{
"name": "i18njs",
"main": "i18njs.js",
"version": "1.2.0",
"version": "1.3.0",
"homepage": "https://github.com/yoannmoinet/i18njs",

@@ -6,0 +6,0 @@ "authors": [

@@ -126,4 +126,12 @@ if (typeof exports === 'object' && typeof define !== 'function') {

};
this.get = function (key, data, options) {
var obj = parse(this.lng + '.' + key, this.string);
this.get = function (key, data, options, lang) {
var lng = lang || this.lng;
if (lang === undefined) {
if (typeof data === 'string') {
lng = data;
} else if (typeof options === 'string') {
lng = options;
}
}
var obj = parse(lng + '.' + key, this.string);
options = options || {};

@@ -130,0 +138,0 @@ if (obj && typeof data === 'object') {

{
"name": "i18njs",
"version": "1.2.0",
"version": "1.3.0",
"description": "A simple i18n for Javascript with a templating feature.",

@@ -5,0 +5,0 @@ "main": "i18njs.js",

@@ -41,4 +41,12 @@ # i18njs

var fr_locales = {
'hello_world': {
'hello': 'Bonjour',
'world': 'Monde'
}
};
// i18n.add(language, [namespace,] locales);
i18n.add('en', 'first_test', en_locales);
i18n.add('fr', 'first_test', fr_locales);

@@ -75,6 +83,9 @@ ```

// i18n.get(key[, data, options]);
// i18n.get(key[, data, options][, lang]);
i18n.get('first_test.hello_world.hello');
// Hello
i18n.get('first_test.hello_world.hello', 'fr');
// Bonjour
```

@@ -81,0 +92,0 @@

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