mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
build: let webpack bundle i18next
This commit is contained in:
parent
b60f22c6b9
commit
f3148bf478
@ -1,7 +1,6 @@
|
||||
import library_loader from "./library_loader.js";
|
||||
import options from "./options.js";
|
||||
|
||||
await library_loader.requireLibrary(library_loader.I18NEXT);
|
||||
import i18next from "i18next";
|
||||
import i18nextHttpBackend from "i18next-http-backend";
|
||||
|
||||
export async function initLocale() {
|
||||
const locale = (options.get("locale") as string) || "en";
|
||||
|
@ -72,10 +72,6 @@ const MARKJS: Library = {
|
||||
js: ["node_modules/mark.js/dist/jquery.mark.es6.min.js"]
|
||||
};
|
||||
|
||||
const I18NEXT: Library = {
|
||||
js: ["node_modules/i18next/i18next.min.js", "node_modules/i18next-http-backend/i18nextHttpBackend.min.js"]
|
||||
};
|
||||
|
||||
const HIGHLIGHT_JS: Library = {
|
||||
js: () => {
|
||||
const mimeTypes = mimeTypesService.getMimeTypes();
|
||||
@ -194,7 +190,6 @@ export default {
|
||||
WHEEL_ZOOM,
|
||||
MERMAID,
|
||||
MARKJS,
|
||||
I18NEXT,
|
||||
HIGHLIGHT_JS,
|
||||
LEAFLET
|
||||
};
|
||||
|
4
src/public/app/types.d.ts
vendored
4
src/public/app/types.d.ts
vendored
@ -1,7 +1,5 @@
|
||||
import type FNote from "./entities/fnote";
|
||||
import type { BackendModule, i18n } from "i18next";
|
||||
import type { Froca } from "./services/froca-interface";
|
||||
import type { HttpBackendOptions } from "i18next-http-backend";
|
||||
import { Suggestion } from "./services/note_autocomplete.ts";
|
||||
import utils from "./services/utils.ts";
|
||||
import appContext from "./components/app_context.ts";
|
||||
@ -115,8 +113,6 @@ declare global {
|
||||
|
||||
// Libraries
|
||||
// TODO: Replace once library loader is replaced with webpack.
|
||||
var i18next: i18n;
|
||||
var i18nextHttpBackend: BackendModule<HttpBackendOptions>;
|
||||
var hljs: {
|
||||
highlightAuto(text: string);
|
||||
highlight(text: string, {
|
||||
|
@ -73,8 +73,6 @@ async function register(app: express.Application) {
|
||||
app.use(`/${assetPath}/node_modules/panzoom/dist/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/panzoom/dist/")));
|
||||
|
||||
// i18n
|
||||
app.use(`/${assetPath}/node_modules/i18next/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/i18next/")));
|
||||
app.use(`/${assetPath}/node_modules/i18next-http-backend/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/i18next-http-backend/")));
|
||||
app.use(`/${assetPath}/translations/`, persistentCacheStatic(path.join(srcRoot, "public", "translations/")));
|
||||
|
||||
app.use(`/${assetPath}/node_modules/eslint/bin/`, persistentCacheStatic(path.join(srcRoot, "..", "node_modules/eslint/bin/")));
|
||||
|
Loading…
x
Reference in New Issue
Block a user