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

babel-plugin-secullum-i18n

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-secullum-i18n - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

index.js

@@ -14,3 +14,3 @@ let expressions = null;

if (
node.callee.name === state.opts.translateFunction &&
node.callee.name === state.opts.translateFunctionName &&
node.arguments[0].type === "StringLiteral" &&

@@ -20,3 +20,3 @@ !expressions.includes(node.arguments[0].value)

throw path.buildCodeFrameError(
`Untranslated word: ${node.arguments[0].value}`
`Expression not found: ${node.arguments[0].value}`
);

@@ -23,0 +23,0 @@ }

{
"name": "babel-plugin-secullum-i18n",
"version": "1.0.0",
"version": "1.0.1",
"description": "babel plugin to check if a word exist in the translate file",

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

# babel-plugin-secullum-i18n
![npm](https://img.shields.io/npm/v/babel-plugin-secullum-i18n.svg)
![npm](https://img.shields.io/npm/l/babel-plugin-secullum-i18n.svg)
## Install
```sh
yarn add babel-plugin-secullum-i18n --dev
```
## Usage
### Via [`webpack config`](https://webpack.js.org/loaders/babel-loader/)
```js
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
plugins: [
[
"babel-plugin-secullum-i18n",
{
expressionsPath: "./sec-i18n.config.json",
translateFunction: "traduzir",
},
],
],
},
},
},
];
}
```
### Via `babel.config.js`
```js
module.exports = (api) => ({
plugins: [
[
"babel-plugin-secullum-i18n",
{
expressionsPath: "./sec-i18n.config.json",
translateFunction: "translate",
},
],
],
});
```
### Via `config-overrides.js`
```js
module.exports = function override(config, env) {
config.module.rules[2].oneOf.forEach((rule) => {
if (rule.test instanceof RegExp && rule.test.test(".js")) {
rule.options.plugins.push([
"babel-plugin-secullum-i18n",
{
expressionsPath: "./sec-i18n.config.json",
translateFunction: "translate",
},
]);
}
});
return config;
};
```
## Options
- `expressionsPath`: string
- Path to expressions file.
- `translateFunction`: string
- Name of translate function used on project.
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