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

@shopify/react-i18n

Package Overview
Dependencies
Maintainers
19
Versions
289
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-i18n - npm Package Compare versions

Comparing version 7.5.0 to 7.5.1

18

build/cjs/utilities/translate.js

@@ -19,2 +19,4 @@ 'use strict';

const SEPARATOR = '.';
const UNICODE_NUMBERING_SYSTEM = '-u-nu-';
const LATIN = 'latn';

@@ -43,6 +45,14 @@ const isString = value => typeof value === 'string';

function latinLocale(locale) {
if (!locale) return locale;
return new Intl.Locale(locale, {
numberingSystem: 'latn'
}).toString();
if (!locale) return locale; // Intl.Locale was added to iOS in v14. See https://caniuse.com/?search=Intl.Locale
// We still support ios 12/13, so we need to check if this works and fallback to the default behaviour if not
try {
return new Intl.Locale(locale, {
numberingSystem: LATIN
}).toString();
} catch {
const numberingSystemRegex = new RegExp(`(?:-x|${UNICODE_NUMBERING_SYSTEM}).*`, 'g');
const latinNumberingSystem = `${UNICODE_NUMBERING_SYSTEM}${LATIN}`;
return locale.replace(numberingSystemRegex, '').concat(latinNumberingSystem);
}
}

@@ -49,0 +59,0 @@

{
"name": "@shopify/react-i18n",
"version": "7.5.0",
"version": "7.5.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "i18n utilities for React handling translations, formatting, and more",

Sorry, the diff of this file is not supported yet

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