Skip to content

Commit a673429

Browse files
committed
Revert ":alembic: Inject translations with webpack"
This reverts commit 91fc2b3.
1 parent 91fc2b3 commit a673429

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

bin/webpack.common.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import fs from 'fs-extra';
22
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
33
import webpack from 'webpack';
4-
import translations from '../src/script/translations.js';
54

65
const BUILD = fs.readJsonSync('.build.json');
76

@@ -36,7 +35,6 @@ export default {
3635
},
3736
plugins: [
3837
new webpack.DefinePlugin({ __BUILD__: JSON.stringify(BUILD) }),
39-
new webpack.DefinePlugin({ __TRANSLATIONS__: JSON.stringify(translations) }),
4038
],
4139
resolve: {
4240
extensions: ['.js', '.ts'],

src/script/translation.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import i18next, { i18n } from 'i18next';
2+
import translations from '@APF/translations.js';
23
import { stringArray } from '@APF/lib/helper';
34

4-
// __TRANSLATIONS__ is injected by webpack from ROOT/src/script/
5-
/* eslint-disable-next-line @typescript-eslint/naming-convention */
6-
declare const __TRANSLATIONS__: any;
7-
85
export default class Translation {
96
i18next: i18n;
107

11-
static readonly translations = typeof __TRANSLATIONS__ == 'undefined' ? { common: {} } : __TRANSLATIONS__;
12-
138
//#region Class reference helpers
149
// Can be overridden in children classes
1510
get Class() { return (this.constructor as typeof Translation); }
@@ -22,7 +17,7 @@ export default class Translation {
2217
lng: language,
2318
fallbackLng: 'en',
2419
ns: namespaces,
25-
resources: this.Class.translations,
20+
resources: translations
2621
});
2722
}
2823

0 commit comments

Comments
 (0)