bc-deeplib 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.types/declarations.d.ts +15 -0
- package/.types/elements.d.ts +38 -0
- package/.types/type-override.d.ts +3 -0
- package/README.md +1 -1
- package/dist/main.js +1894 -0
- package/dist/main.js.map +1 -0
- package/dist/public/styles/DeepLib.css +206 -0
- package/dist/public/styles/Gratitude.css +23 -0
- package/package.json +28 -12
- package/public/styles/DeepLib.css +206 -0
- package/public/styles/Gratitude.css +23 -0
- package/src/DeepLib.ts +33 -0
- package/dist/Base/BaseModule.d.ts +0 -13
- package/dist/Base/BaseModule.js +0 -41
- package/dist/Base/BaseSetting.d.ts +0 -29
- package/dist/Base/BaseSetting.js +0 -152
- package/dist/Base/Modules.d.ts +0 -5
- package/dist/Base/Modules.js +0 -17
- package/dist/Base/SettingDefinitions.d.ts +0 -8
- package/dist/Base/SettingDefinitions.js +0 -19
- package/dist/Base/SettingUtils.d.ts +0 -17
- package/dist/Base/SettingUtils.js +0 -101
- package/dist/DeepLib.d.ts +0 -17
- package/dist/DeepLib.js +0 -33
- package/dist/Models/Base.d.ts +0 -4
- package/dist/Models/Base.js +0 -2
- package/dist/Models/Settings.d.ts +0 -6
- package/dist/Models/Settings.js +0 -2
- package/dist/Modules/Version.d.ts +0 -13
- package/dist/Modules/Version.js +0 -62
- package/dist/Screens/MainMenu.d.ts +0 -11
- package/dist/Screens/MainMenu.js +0 -80
- package/dist/Screens/Support.d.ts +0 -14
- package/dist/Screens/Support.js +0 -99
- package/dist/Utils/Data.d.ts +0 -5
- package/dist/Utils/Data.js +0 -42
- package/dist/Utils/Logger.d.ts +0 -4
- package/dist/Utils/Logger.js +0 -6
- package/dist/Utils/Messages.d.ts +0 -2
- package/dist/Utils/Messages.js +0 -32
- package/dist/Utils/RibbonMenu.d.ts +0 -9
- package/dist/Utils/RibbonMenu.js +0 -32
- package/dist/Utils/SDK.d.ts +0 -21
- package/dist/Utils/SDK.js +0 -75
- package/dist/Utils/String.d.ts +0 -5
- package/dist/Utils/String.js +0 -30
- package/dist/Utils/Translation.d.ts +0 -10
- package/dist/Utils/Translation.js +0 -43
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getText = exports.Localization = void 0;
|
|
4
|
-
class Localization {
|
|
5
|
-
static Translation = {};
|
|
6
|
-
static FallbackTranslation = {};
|
|
7
|
-
static ServerUrl = '';
|
|
8
|
-
static async load(serverUrl) {
|
|
9
|
-
this.ServerUrl = serverUrl;
|
|
10
|
-
const lang = TranslationLanguage.toLowerCase();
|
|
11
|
-
this.Translation = await Localization.fetchLanguageFile(lang);
|
|
12
|
-
if (lang == 'en') {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
this.FallbackTranslation = await Localization.fetchLanguageFile('en');
|
|
16
|
-
}
|
|
17
|
-
static getText(srcTag) {
|
|
18
|
-
return this.Translation[srcTag] || this.FallbackTranslation?.[srcTag] || srcTag || '';
|
|
19
|
-
}
|
|
20
|
-
static async fetchLanguageFile(lang) {
|
|
21
|
-
const response = await fetch(`${this.ServerUrl}/translations/${lang}.lang`);
|
|
22
|
-
if (lang != 'en' && !response.ok) {
|
|
23
|
-
return this.fetchLanguageFile('en');
|
|
24
|
-
}
|
|
25
|
-
const langFileContent = await response.text();
|
|
26
|
-
return this.parseLanguageFile(langFileContent);
|
|
27
|
-
}
|
|
28
|
-
static parseLanguageFile(content) {
|
|
29
|
-
const translations = {};
|
|
30
|
-
const lines = content.split('\n');
|
|
31
|
-
for (const line of lines) {
|
|
32
|
-
if (line.trim() === '' || line.trim().startsWith('#')) {
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
const [key, value] = line.split('=');
|
|
36
|
-
translations[key.trim()] = value.trim();
|
|
37
|
-
}
|
|
38
|
-
return translations;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.Localization = Localization;
|
|
42
|
-
const getText = (string) => Localization.getText(string);
|
|
43
|
-
exports.getText = getText;
|