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

i18next-resources-fallback

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-resources-fallback

[![npm](https://img.shields.io/npm/v/i18next-resources-fallback)](https://www.npmjs.com/package/i18next-resources-fallback)

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
decreased by-21.43%
Maintainers
0
Weekly downloads
 
Created
Source

i18next-resources-fallback

npm

Installation

yarn add i18next-resources-fallback

Usage

  import i18next, type { Resource } from "i18next";
+ import resourcesFallback from 'i18next-resources-fallback'

  const resources: Resource = {
    en: {
      translation: {
        key: 'value'
      }
    }
  };

  i18next
    .init({
      // ... your i18next config
    });

+ resourcesFallback(i18n, resources)

Introduction

Why need to use this package?

When you use i18next, your backend resources and bundled resources may differ. When the backend resources are missing, you might want to use the bundled resources as a fallback to avoid issues when certain texts are missing from the backend resources.

How does this package work?

This package adds text using addResourceBundle after the backend resources have finished loading, to supplement the missing texts from the backend as a fallback.

Comparisons

  • i18next-resources-to-backend: It is used as a fallback when a certain file or namespace is missing.
  • i18next-resources-fallback: It is used as a fallback when a certain key is missing in the backend resources.

License

MIT Licensed

FAQs

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