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

react-i18nify

Package Overview
Dependencies
Maintainers
2
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-i18nify - npm Package Compare versions

Comparing version 1.11.1 to 1.11.2

2

package.json
{
"name": "react-i18nify",
"version": "1.11.1",
"version": "1.11.2",
"description": "Simple i18n translation and localization components and helpers for React applications.",

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

@@ -73,21 +73,22 @@ # react-i18nify

<Translate value="application.title" />
// => returns '<span>Toffe app met i18n!</span>' for locale 'nl'
// => <span>Toffe app met i18n!</span>
<Translate value="application.title" style={{ fontWeight: 'bold', fontSize: '14px' }} />
// => returns '<span style="font-weight:bold;font-size:14px;">Toffe app met i18n!</span>' for locale 'nl'
// => <span style="font-weight:bold;font-size:14px;">Toffe app met i18n!</span>
<Translate value="application.hello" name="Aad"/>
// => returns '<span>Hallo, Aad!</span>' for locale 'nl'
// => <span>Hallo, Aad!</span>
<Translate value="export" count={1} />
// => returns '<span>Exporteer 1 ding</span> for locale 'nl'
// => <span>Exporteer 1 ding</span>
<Translate value="export" count={2} />
// => returns '<span>Exporteer 2 dingen</span> for locale 'nl'
// => <span>Exporteer 2 dingen</span>
<Translate value="two_lines" dangerousHTML />
// => returns '<span>Regel 1<br />Regel 2</span>'
// => <span>Regel 1<br />Regel 2</span>
<Translate value="application.title" tag="h1" />
// => returns '<h1>Toffe app met i18n!</h1>' for locale 'nl'
// => <h1>Toffe app met i18n!</h1>
<Localize value="2015-09-03" dateFormat="date.long" />
// => returns '<span>3 september 2015</span> for locale 'nl'
// => <span>3 september 2015</span>
<Localize value="2015-09-03" dateFormat="date.long" tag="div" />
// => returns '<div>3 september 2015</div> for locale 'nl'
// => <div>3 september 2015</div>
<Localize value={10/3} options={{style: 'currency', currency: 'EUR', minimumFractionDigits: 2, maximumFractionDigits: 2}}/>
// => returns '<span>€ 3,33</span> for locale 'nl'
// => <span>€ 3,33</span>
```

@@ -101,12 +102,19 @@

```javascript
const I18n = require('react-i18nify').I18n;
const { I18n } = require('react-i18nify');
I18n.t('application.title'); // => returns 'Toffe app met i18n!' for locale 'nl'
I18n.t('application.hello', {name: 'Aad'}); // => returns 'Hallo, Aad!' for locale 'nl'
I18n.t('export', {count: 0}); // => returns 'Niks te exporteren' for locale 'nl'
I18n.t('application.unknown_translation'); // => returns 'Unknown Translation' as translation is missing
I18n.t('application', {name: 'Aad'}); // => returns {hello: "Hallo, Aad!", title: "Toffe app met i18n!"} for locale 'nl'
I18n.t('application.title');
// => Toffe app met i18n!
I18n.t('application.hello', {name: 'Aad'});
// => Hallo, Aad!'
I18n.t('export', {count: 0});
// => Niks te exporteren
I18n.t('application.unknown_translation');
// => Unknown Translation
I18n.t('application', {name: 'Aad'});
// => {hello: 'Hallo, Aad!', title: 'Toffe app met i18n!'}
I18n.l(1385856000000, { dateFormat: 'date.long' }); // => returns '1 december 2013' for locale 'nl'
I18n.l(Math.PI, { maximumFractionDigits: 2 }); // => returns '3,14' for locale 'nl'
I18n.l(1385856000000, { dateFormat: 'date.long' });
// => 1 december 2013
I18n.l(Math.PI, { maximumFractionDigits: 2 });
// => 3,14
```

@@ -170,3 +178,4 @@

I18n.t('application.unknown_translation'); // => returns 'Missing translation: application.unknown_translation'
I18n.t('application.unknown_translation');
// => Missing translation: application.unknown_translation
```

@@ -173,0 +182,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