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

@tolgee/i18next

Package Overview
Dependencies
Maintainers
2
Versions
301
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tolgee/i18next

Tolgee i18n integration.

  • 3.3.0-prerelease-7dd4060.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.1K
increased by5.24%
Maintainers
2
Weekly downloads
 
Created
Source

Tolgee i18next integration

test workflow @tolgee/i18next version types typescript twitter github stars

Tolgee

Tolgee i18next integration. For more information about Tolgee Toolkit, visit our documentation website tolgee.io.

Installation

npm install i18next @tolgee/i18next

Usage

First, create a Tolgee instance and initialize it.

import i18next from 'i18next';
import { withTolgee } from "@tolgee/i18next";

withTolgee(i18n, { ... tolgee config ... })
  .init({ ... i18next config ... })

This will:

  • use add tolgeeBackend as backend plugin
  • use tolgeeProcessor for wrapping translations (with invivisible wrapperMode)
  • will call tolgeeApply on i18n instance to apply listeners and register tolgee (i18n.tolgee)
  • will wrap .init function with custom function, which will use tolgeeOptions to merge config with our custom config that is needed for in-context to work

We also recommend using ICU message format, which is supported by Tolgee platform.

npm install i18next-icu
import ICU from 'i18next-icu';

withTolgee(i18n, ...)
  .use(ICU)
  .init(...)

Language changing

Tolgee will automatically switch language accordingly to i18next. So to get current language do:

const lang = i18n.lang;

To set language:

i18n.changeLanguage(lang);

To learn more, check Tolgee docs.

Keywords

FAQs

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