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

@superset-ui/translation

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@superset-ui/translation - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

21

package.json
{
"name": "@superset-ui/translation",
"version": "0.1.0",
"version": "0.2.0",
"description": "Superset UI translation",

@@ -12,15 +12,2 @@ "sideEffects": false,

],
"scripts": {
"build:cjs": "beemo babel ./src --out-dir lib/ --minify",
"build:esm": "beemo babel ./src --out-dir esm/ --esm --minify",
"build": "yarn run build:cjs && yarn run build:esm",
"dev": "beemo babel --watch ./src --out-dir esm/ --esm",
"jest": "beemo jest --color --coverage",
"eslint": "beemo eslint \"./{src,test}/**/*.{js,jsx,md}\"",
"lint": "yarn run prettier && yarn run eslint",
"lint:fix": "yarn run prettier --write && yarn run eslint --fix",
"test": "yarn run jest",
"prettier": "beemo prettier \"./{src,test}/**/*.{js,jsx,json,md}\"",
"prepublish": "yarn run build"
},
"repository": {

@@ -46,4 +33,3 @@ "type": "git",

"@babel/runtime": "^7.1.2",
"jed": "^1.1.1",
"sprintf-js": "^1.1.1"
"jed": "^1.1.1"
},

@@ -66,3 +52,4 @@ "beemo": {

"access": "public"
}
},
"gitHead": "098c2fce9f3f6a16b555c2a3ebf4715af76818a8"
}

20

README.md

@@ -12,3 +12,3 @@ ## `@superset-ui/translation`

```js
import { configure, t } from '@superset-ui/translation';
import { configure, t, tn } from '@superset-ui/translation';

@@ -20,2 +20,3 @@ configure({

console.log(t('text to be translated'));
console.log(tn('singular text', 'plural text', value));
```

@@ -32,4 +33,4 @@

- Translate `text` when no `args` is provided.
- Translate `text` and substitute `args` into the placeholders specified within `text`.
- Translate `text`.
- If `args` is provided, substitute `args` into the `sprintf` placeholders specified within `text` translation.

@@ -39,3 +40,3 @@ For example

```js
t('Hello %(name)s', user)
t('Hello %(name)s', user);
```

@@ -45,2 +46,13 @@

`tn(singular, plural, num, [, args])`
- Translate and choose between `singular` and `plural` based on `num`.
- If `args` is provided, substitute `args` into the `sprintf` placeholders specified within `singular` or `plural` translations.
For example
```js
tn('%d duck', '%d ducks', 2, 2);
```
### Development

@@ -47,0 +59,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