1.0.0 • Published 2 years ago
@r3ps4j/i18next-fxserver-language-detector v1.0.0
Introduction
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-detectorTo 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,
});1.0.0
2 years ago