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

@shopify/react-i18n-universal-provider

Package Overview
Dependencies
Maintainers
25
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-i18n-universal-provider

A self-serializing/deserializing i18n provider that works for isomorphic applications

  • 0.0.0-snapshot-20240207215059
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-73.6%
Maintainers
25
Weekly downloads
 
Created
Source

@shopify/react-i18n-universal-provider

Build Status Build Status License: MIT npm version npm bundle size (minified + gzip)

A self-serializing/deserializing i18n provider that works for isomorphic applications.

Installation

yarn add @shopify/react-i18n-universal-provider

Usage

Props

The component takes an object containing the React children to render and any options to use when configuring the I18nManager to provide to the tree.

The <I18nUniversalProvider> takes the following props:

// from @shopify/react-i18n
I18nDetails {
    locale: string;
    country?: string;
    currency?: string;
    timezone?: string;
    pseudolocalize?: boolean;
    fallbackLocale?: string;
    onError?(error: I18nError): void;
}
Example
// App.tsx
import {I18nUniversalProvider} from '@shopify/react-i18n-universal-provider';

function App({locale}: {locale?: string}) {
  return (
    <I18nUniversalProvider locale={locale}>
      {/* rest of the app */}
    </I18nUniversalProvider>
  );
}

Possible Issues

Missing i18n manager error
Error: Missing i18n manager. Make sure to use an <I18nContext.Provider /> somewhere in your React tree from the @shopify/react-i18n hook.
Cause:

Duplicate and/or unmet versions of react-i18n

Potential Solution:

Deduplicating dependencies for react-i18n-universal-provider and react-i18n.

npx yarn-deduplicate --packages @shopify/react-i18n yarn.lock
npx yarn-deduplicate --packages @shopify/react-html yarn.lock
npx yarn-deduplicate --packages @shopify/react-effect yarn.lock
# deduplicate other dependencies of @shopify/react-i18n
yarn why @shopify/react-i18n # ensure no duplicate / unmet dependencies
yarn list  # ensure no duplicate / unmet dependencies
yarn install

FAQs

Package last updated on 07 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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