@r3ps4j/i18next-fxserver-language-detector
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Introduction

npm version

This is a i18next language detection plugin for FXServer. It will detect the languages based on a convar variable. The language detector will fallback to the locale convar when the specified convar is not found or empty.

Getting started

Install the package via npm.

npm install @r3ps4j/i18next-fxserver-language-detector

To make use of the package, import it and load the detector as a module using i18next.use:

import i18next from "i18next";
import LanguageDetector from "@r3ps4j/i18next-fxserver-language-detector";

i18next.use(LanguageDetector).init(i18nextOptions);

Detector options

{
    convar: "i18next_lng", // Defaults to "i18next_lng"
}

Options can be passed in by setting options.detection in i18next.init:

import i18next from "i18next";
import LanguageDetector from "@r3ps4j/i18next-fxserver-language-detector";

i18next.use(LanguageDetector).init({
    detection: options,
});

Package Sidebar

Install

npm i @r3ps4j/i18next-fxserver-language-detector

Weekly Downloads

2

Version

1.0.0

License

LGPL-3.0-or-later

Unpacked Size

11.7 kB

Total Files

5

Last publish

Collaborators

  • r3ps4j