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

@m6web/react-i18n

Package Overview
Dependencies
Maintainers
6
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@m6web/react-i18n - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

12

es/hooks/useTranslate.js

@@ -5,3 +5,13 @@ import { useContext } from 'react';

export var useTranslate = function useTranslate() {
return useContext(Context);
var t = useContext(Context);
return function (key) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
data = _ref.data,
number = _ref.number,
general = _ref.general,
renderers = _ref.renderers;
return t(key, data, number, general, renderers);
};
};

@@ -13,3 +13,13 @@ 'use strict';

var useTranslate = exports.useTranslate = function useTranslate() {
return (0, _react.useContext)(_i18n.Context);
var t = (0, _react.useContext)(_i18n.Context);
return function (key) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
data = _ref.data,
number = _ref.number,
general = _ref.general,
renderers = _ref.renderers;
return t(key, data, number, general, renderers);
};
};

5

package.json
{
"name": "@m6web/react-i18n",
"version": "1.7.0",
"version": "1.8.0",
"description": "Provider and utils for translation in a react app",

@@ -53,3 +53,4 @@ "main": "lib/index.js",

"release": "yarn lint && yarn test && yarn build && yarn version"
}
},
"gitHead": "b2ec63de8741d9a6dae02580749f37b269fc2121"
}

@@ -154,3 +154,3 @@ # React i18n for 6play apps

export const MyComponent = ({ nbExample }) => {
export const MyComponent = ({ number }) => {
const t = useTranslate();

@@ -160,8 +160,4 @@

<div class="foo">
<h1>
{t('foo.bar')}
</h1>
<p>
{t('foo.exemple', data, nbExample, true)}
</p>
<h1>{t('foo.bar')}</h1>
<p>{t('foo.exemple', { data, number, general: true })}</p>
</div>

@@ -232,3 +228,3 @@ );

<div class="foo">
<p>{t('foo.example', undefined, undefined, undefined, renderers)}</p>
<p>{t('foo.example', { renderers })}</p>
</div>

@@ -235,0 +231,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