make i18n importable instead of needing require

This commit is contained in:
Maroxy 2021-10-23 10:00:31 +02:00
parent dd56953225
commit 7ccd6d7d5a
4 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
import $ from 'cash-dom';
const i18n = new(require('./i18n'));
import i18n from './i18n';
type LauncherState =
'patch-unavailable' |

View file

@ -21,4 +21,4 @@ i18n.prototype.translate = function(phrase: any) {
return translation
}
module.exports = i18n;
export default new (i18n as any);

View file

@ -2,9 +2,9 @@ const path = require('path');
const fs = require('fs');
const { exec } = require('child_process');
const { ipcRenderer } = require('electron');
const i18n = new(require('./i18n'));
import $ from 'cash-dom';
import i18n from './i18n';
import { Genshinlib } from './Genshinlib';
import { LauncherUI } from './LauncherUI';

View file

@ -1,8 +1,8 @@
const fs = require('fs');
const path = require('path');
const i18n = new(require('./i18n'));
import $ from 'cash-dom';
import i18n from './i18n';
import { Genshinlib } from './Genshinlib';
$(() => {