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

grunt-i18n-abide

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-i18n-abide - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

20

package.json
{
"name": "grunt-i18n-abide",
"description": "Grunt plugin for running jsxgettext against your codebase.",
"version": "0.0.9",
"version": "0.0.10",
"homepage": "https://github.com/mozilla/grunt-i18n-abide",

@@ -32,11 +32,12 @@ "author": {

"dependencies": {
"jsxgettext": "~0.3.9",
"shelljs": "~0.2.6",
"po2json": "~0.2.3"
"i18n-abide": "0.0.19",
"jsxgettext": "0.4.3",
"po2json": "0.2.3",
"shelljs": "0.3.0"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.6.0",
"grunt": "~0.4.5",
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt": "~0.4.1"
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.3.3"
},

@@ -47,8 +48,9 @@ "peerDependencies": {

"keywords": [
"gettext",
"grunt",
"gruntplugin",
"l10n",
"i18n",
"i18n-abide",
"gettext"
"l10n"
]
}

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

[![Build Status](https://travis-ci.org/mozilla/grunt-i18n-abide.png?branch=master)](https://travis-ci.org/mozilla/grunt-i18n-abide)
[![NPM version](https://badge.fury.io/js/grunt-i18n-abide.png)](http://badge.fury.io/js/grunt-i18n-abide)
[![Dependency Status](https://david-dm.org/mozilla/grunt-i18n-abide.png?theme=shields.io)](https://david-dm.org/mozilla/grunt-i18n-abide)
[![Build Status](https://travis-ci.org/mozilla/grunt-i18n-abide.svg?branch=master)](https://travis-ci.org/mozilla/grunt-i18n-abide)
[![NPM version](https://badge.fury.io/js/grunt-i18n-abide.svg)](http://badge.fury.io/js/grunt-i18n-abide)
[![Dependency Status](https://david-dm.org/mozilla/grunt-i18n-abide.svg?theme=shields.io)](https://david-dm.org/mozilla/grunt-i18n-abide)

@@ -285,2 +285,8 @@

* 0.0.10:
* Use localeFrom and languageFrom from i18n-abide.
* Update jsxgettext 0.4.0 -> 0.4.2
* Update i18n-abide 0.0.17 -> 0.0.19
* Update shelljs 0.2.6 -> 0.3.0
* Update dev deps.
* 0.0.9:

@@ -287,0 +293,0 @@ * Use pretty json for readability.

var fs = require('fs');
var path = require('path');
var lockFilePath = '/tmp/abideCompile.lock';
var po2json = require('po2json');
var shell = require('shelljs');
var i18n = require('i18n-abide');
var helpers = require('./lib/helpers');
var po2json = require('po2json');
var lockFilePath = '/tmp/abideCompile.lock';
var runShellSync = helpers.runShellSync;

@@ -75,3 +78,3 @@ var checkCommand = helpers.checkCommand;

fs.writeFileSync(jsfile, '"locale": "' + locale + '",\n', { flag: 'a' });
fs.writeFileSync(jsfile, '"lang": "' + helpers.languageFrom(locale) + '"\n}', { flag: 'a' });
fs.writeFileSync(jsfile, '"lang": "' + i18n.languageFrom(locale) + '"\n}', { flag: 'a' });
}

@@ -78,0 +81,0 @@ });

var fs = require('fs');
var path = require('path');
var i18n = require('i18n-abide');
var helpers = require('./lib/helpers');

@@ -33,3 +35,3 @@

// en-US -> en_US
var locale = helpers.localeFrom(language);
var locale = i18n.localeFrom(language);

@@ -36,0 +38,0 @@ // Make the dir for the locale.

@@ -24,56 +24,1 @@ var util = require('util');

};
/**
* Given a language code, return a locale code the OS understands.
* Based on: https://github.com/mozilla/i18n-abide/blob/master/lib/i18n.js
*
* language: en-US
* locale: en_US
*/
exports.localeFrom = function(language) {
if (! language || ! language.split) {
return "";
}
if (language.indexOf('_') > -1) {
grunt.log.writeln(util.format("Check this is a language code. Language [%s] already contains a '_'", language));
return language;
}
var parts = language.split('-');
if (parts.length === 1) {
return parts[0].toLowerCase();
} else if (parts.length === 2) {
return util.format('%s_%s', parts[0].toLowerCase(), parts[1].toUpperCase());
} else if (parts.length === 3) {
// sr-Cyrl-RS should be sr_RS
return util.format('%s_%s', parts[0].toLowerCase(), parts[2].toUpperCase());
} else {
grunt.log.writeln(util.format("Unable to map a locale from language code [%s]", language));
return language;
}
};
/**
* Given a locale code, return a language code
* Based on: https://github.com/mozilla/i18n-abide/blob/master/lib/i18n.js
*/
exports.languageFrom = function languageFrom(locale) {
if (!locale || !locale.split) {
return "";
}
var parts = locale.split('_');
if (parts.length === 1) {
return parts[0].toLowerCase();
} else if (parts.length === 2) {
return util.format('%s-%s', parts[0].toLowerCase(), parts[1].toUpperCase());
} else if (parts.length === 3) {
// sr_RS should be sr-RS
return util.format('%s-%s', parts[0].toLowerCase(), parts[2].toUpperCase());
} else {
grunt.log.writeln(util.format("Unable to map a language from locale code [%s]", locale));
return locale;
}
};
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