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

@bothrs/translations

Package Overview
Dependencies
Maintainers
7
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bothrs/translations

A hook which loads the translations from an external source and initializes i18next.

  • 0.1.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40
decreased by-47.37%
Maintainers
7
Weekly downloads
 
Created
Source

Translations

A hook which loads the translations from an external source and initializes i18next.

Getting started

yarn add @bothrs/translations

Usage

import { useTranslations } from '@bothrs/translations

useTranslations return a boolean which indicates if the translations are loaded. This can be used to hide the splashscreen.

const translationsLoaded = useTranslations({
    expirationTime: 60 * 1000,
    startupLanguage: 'en',
    loadPath: airtableUrl + '/Translations' + '?api_key=' + airtableKey,
})


Airtable

For now, airtable is the only supported data-source of @bothrs/translations.

The base should have the folowing columns

column namemandatoryexplanation
keytruethe key that will be used in the i18next t method
en / nl / fr / ...truethe iso code of the supported languages
categoryfalseWe recommend to use a category column to group related records in airtable

Example Airtable base

Example Airtable base

FAQs

Package last updated on 09 Nov 2021

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