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

@tamkeentech/react-i18n

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tamkeentech/react-i18n - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

6

dist/index.js

@@ -39,8 +39,8 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var init = function init(_ref) {
var _ref$resourses = _ref.resourses,
resourses = _ref$resourses === void 0 ? [] : _ref$resourses,
var _ref$resources = _ref.resources,
resources = _ref$resources === void 0 ? [] : _ref$resources,
givenDefaultLocale = _ref.defaultLocale,
_ref$isPersist = _ref.isPersist,
givenIsPersist = _ref$isPersist === void 0 ? true : _ref$isPersist;
resourses.forEach(function (localeResourse) {
resources.forEach(function (localeResourse) {
addLocale(localeResourse.locale, localeResourse.dictionary, localeResourse.options);

@@ -47,0 +47,0 @@ });

@@ -36,8 +36,8 @@ import React, { useEffect, useState, useCallback } from 'react';

var init = function init(_ref) {
var _ref$resourses = _ref.resourses,
resourses = _ref$resourses === void 0 ? [] : _ref$resourses,
var _ref$resources = _ref.resources,
resources = _ref$resources === void 0 ? [] : _ref$resources,
givenDefaultLocale = _ref.defaultLocale,
_ref$isPersist = _ref.isPersist,
givenIsPersist = _ref$isPersist === void 0 ? true : _ref$isPersist;
resourses.forEach(function (localeResourse) {
resources.forEach(function (localeResourse) {
addLocale(localeResourse.locale, localeResourse.dictionary, localeResourse.options);

@@ -44,0 +44,0 @@ });

{
"name": "@tamkeentech/react-i18n",
"version": "1.0.1",
"version": "1.0.2",
"description": "light weight translation library for react",

@@ -5,0 +5,0 @@ "author": "omaksousa",

@@ -56,3 +56,3 @@ # @TamkeenTech/react-i18n

import React, { useCallback, useState } from 'react'
import { lang, setLocale, init } from 'react-i18n-translator'
import { init } from '@tamkeentech/react-i18n'
import arDictionary from './lang/ar.json'

@@ -63,3 +63,3 @@ import enDictionary from './lang/en.json'

init({
resourses: [
resources: [
{ locale: 'en', dictionary: enDictionary },

@@ -85,3 +85,3 @@ { locale: 'es', dictionary: esDictionary },

import React, { useCallback, useState } from 'react'
import { lang, setLocale, init } from 'react-i18n-translator'
import { init } from '@tamkeentech/react-i18n'
import arDictionary from './lang/ar.json'

@@ -95,3 +95,3 @@ import enDictionary from './lang/en.json'

init({
resourses: [
resources: [
{ locale: 'en', dictionary: enDictionary },

@@ -122,3 +122,3 @@ { locale: 'es', dictionary: esDictionary },

import React from 'react'
import { lang } from 'react-i18n-translator'
import { lang } from '@tamkeentech/react-i18n'

@@ -133,3 +133,3 @@ const Button = () => <button>{lang.submit}</button>

import React from 'react'
import { interpolate } from 'react-i18n-translator'
import { interpolate } from '@tamkeentech/react-i18n'

@@ -144,3 +144,3 @@ const Hello = () => <h1>{interpolate('welcome', { name: "Omar" })}</h1>

import React, { memo } from 'react'
import { lang, useSyncLang } from 'react-i18n-translator'
import { lang, useSyncLang } from '@tamkeentech/react-i18n'

@@ -158,4 +158,4 @@ const Hello = () => {

```jsx
import React, { memo } from 'react'
import { lang, withSyncLang } from 'react-i18n-translator'
import React from 'react'
import { lang, withSyncLang } from '@tamkeentech/react-i18n'

@@ -175,13 +175,18 @@ class Hello extends React.PureComponent {

import React, { useState } from 'react'
import { lang, setLocale} from 'react-i18n-translator'
import { lang, setLocale } from '@tamkeentech/react-i18n'
const App = () => {
const changeLanguage = useState()[1];
const changeLang = (locale) => {
setLocale(locale)
changeLanguage(locale)
const switchToEnglish = () => {
setLocale("en")
changeLanguage("en")
}
return (
<div>
{lang.welcome}
<Hello />
<div>
<button onClick={switchToEnglish}>
{lang.btns.toEnglish}
</button>
</div>
</div>

@@ -188,0 +193,0 @@ )

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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