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

@solid-aria/i18n

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-aria/i18n

Primitives for dealing with locale and layout direction.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by0.85%
Maintainers
2
Weekly downloads
 
Created
Source

Solid Aria - I18n

@solid-aria/i18n

pnpm turborepo size version stage

Primitives for dealing with locale and layout direction.

Installation

npm install @solid-aria/i18n
# or
yarn add @solid-aria/i18n
# or
pnpm add @solid-aria/i18n

I18nProvider

I18nProvider allows you to override the default locale as determined by the browser/system setting with a locale defined by your application (e.g. application setting). This should be done by wrapping your entire application in the provider, which will be cause all child elements to receive the new locale information via useLocale.

How to use it

import { I18nProvider } from "@solid-aria/i18n";

function App() {
  return (
    <I18nProvider locale="fr-FR">
      <YourApp />
    </I18nProvider>
  );
}

useLocale

useLocale allows components to access the current locale and interface layout direction. By default, this is automatically detected based on the browser or system language, but it can be overridden by using the I18nProvider at the root of your app.

useLocale should be used in the root of your app to define the lang and dir attributes so that the browser knows which language and direction the user interface should be rendered in.

How to use it

import { useLocale } from "@solid-aria/i18n";

function App() {
  const locale = useLocale();

  return (
    <div lang={locale().locale} dir={locale().direction}>
      {/* your app here */}
    </div>
  );
}

Changelog

All notable changes are described in the CHANGELOG.md file.

Keywords

FAQs

Package last updated on 13 Jun 2022

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