Refactor CJS require to ESM (#1841)
Resolves https://github.com/excalidraw/excalidraw/pull/1793#discussion_r447067827
This commit is contained in:
parent
0a3fb70ec7
commit
a679ef7876
@ -1,5 +1,7 @@
|
|||||||
import LanguageDetector from "i18next-browser-languagedetector";
|
import LanguageDetector from "i18next-browser-languagedetector";
|
||||||
|
|
||||||
|
import fallbackLanguageData from "./locales/en.json";
|
||||||
|
|
||||||
export const languages = [
|
export const languages = [
|
||||||
{ lng: "en", label: "English", data: "en.json" },
|
{ lng: "en", label: "English", data: "en.json" },
|
||||||
{ lng: "bg-BG", label: "Български", data: "bg-BG.json" },
|
{ lng: "bg-BG", label: "Български", data: "bg-BG.json" },
|
||||||
@ -30,7 +32,6 @@ export const languages = [
|
|||||||
let currentLanguage = languages[0];
|
let currentLanguage = languages[0];
|
||||||
let currentLanguageData = {};
|
let currentLanguageData = {};
|
||||||
const fallbackLanguage = languages[0];
|
const fallbackLanguage = languages[0];
|
||||||
const fallbackLanguageData = require("./locales/en.json");
|
|
||||||
|
|
||||||
export const setLanguage = async (newLng: string | undefined) => {
|
export const setLanguage = async (newLng: string | undefined) => {
|
||||||
currentLanguage =
|
currentLanguage =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user