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

@snack-uikit/locale

Package Overview
Dependencies
Maintainers
3
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snack-uikit/locale

## Installation `npm i @snack-uikit/locale`

  • 0.2.2-preview-3e45f5dd.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
76
decreased by-64.81%
Maintainers
3
Weekly downloads
 
Created
Source

Locale

Installation

npm i @snack-uikit/locale

Usage

You need to wrap your app into <LocaleProvider> to make translations work.

If you don't do it then default (en_GB) translations will be applied if applicable.

Also you can pass custom translations or replace/modify existing.

Note

When changing translations of existing languages, you can specify only the fields you want to change, as they will be merged with the default fields.

But when passing a custom language, you will have to specify all translations.

Example

import { LocaleProvider, OverrideLocales } from '@snack-uikit/locale';

const customTraslations: OverrideLocales = {
  en_GB: {
    Table: {
      searchPlaceholder: 'custom',
    },
  },
  custom_LANG: {
    Table: {
      searchPlaceholder: 'custom',
      // ...
    },
  },
};

const lang = 'en_GB'; // or 'ru_RU' or 'custom_LANG'

  // ...
  <LocaleProvider lang={lang} locales={customTranslations}>
    {content}
  </LocaleProvider>

Changelog

LocaleProvider

Props

nametypedefault valuedescription
lang*string-
localesOverrideLocales-

useLocale

helper

Inner hook to use translations

FAQs

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