New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rw-locales

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rw-locales

Locales for the Assisted Installer UI library

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Assisted Installer locales library

NPM

Installation

yarn add @openshift-assisted/locales

Usage

Internationalization is implemented with i18next and react-i18next. The i18n namespace must be declared at build-time in an environment variable called: TRANSLATION_NAMESPACE in order to avoid naming conflicts.

  • Environment variables:

      TRANSLATION_NAMESPACE: required, name of translation namespace (by default is 'translation')
    
  • We create the wrapper src/common/hooks/use-translation-wrapper.ts that use the useTranslation hook with our namespace.

  • Use in our components :

    import { useTranslation } from 'common/hooks/use-translation-wrapper';
    const { t } = useTranslation();
    
    <Button key="submit" onClick={submitForm}>
      {t('ai:Generate Discovery ISO')}
    </Button>;
    

    Add 'ai:' prefix to all strings.

  • Running yarn i18n updates the JSON files in the locales folder when adding or changing messages.

FAQs

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