Socket
Socket
Sign inDemoInstall

@automattic/i18n-utils

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@automattic/i18n-utils

WordPress.com i18n utils.


Version published
Weekly downloads
3.8K
decreased by-4.2%
Maintainers
0
Weekly downloads
 
Created
Source

I18n Utils

I18n-related utilities for use by client, server, apps, and packages.

Usage

import { localizeUrl } from '@automattic/i18n-utils';

Setting up the locale slug

In order to make some i18n utils work in React you need to supply a locale slug to <LocaleProvider> somewhere high up in your react tree. How you get this locale slug will depend on the app @automattic/i18n-utils is being used in.

import { LocaleProvider } from '@automattic/i18n-utils';

function renderApp() {
	return (
		<LocaleProvider localeSlug="en">
			<div>... your app components go here ...</div>
		</LocaleProvider>
	);
}

Once a <LocaleProvider> is available near the root of your tree the useLocale() hook can be used in your components.

FAQs

Package last updated on 15 Jul 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