Skip to content

Commit

Permalink
Fix V5.4.0 ERR [Extension Host] Error: Module not found in bundle: ./…
Browse files Browse the repository at this point in the history
…lang-en #2360
  • Loading branch information
PKief committed Jun 13, 2024
1 parent a1f23c6 commit 65b92e4
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 17 deletions.
52 changes: 50 additions & 2 deletions src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import { env } from 'vscode';
import { getObjectPropertyValue } from '../helpers/objects';
import type { Translation } from '../models';
import { translation as langCs } from './lang-cs';
import { translation as langDe } from './lang-de';
import { translation as langEn } from './lang-en';
import { translation as langEs } from './lang-es';
import { translation as langFr } from './lang-fr';
import { translation as langJa } from './lang-ja';
import { translation as langKo } from './lang-ko';
import { translation as langNl } from './lang-nl';
import { translation as langPl } from './lang-pl';
import { translation as langPtBr } from './lang-pt-br';
import { translation as langPtPt } from './lang-pt-pt';
import { translation as langRu } from './lang-ru';
import { translation as langUk } from './lang-uk';
import { translation as langZhCn } from './lang-zh-cn';
import { translation as langZhTw } from './lang-zh-tw';

// Get current language of the vs code workspace
export const getCurrentLanguage = (): string => env.language;
Expand Down Expand Up @@ -31,8 +46,41 @@ const loadTranslation = async (language: string) => {

/** Get the translation object of the separated translation files */
const getTranslationObject = async (language: string): Promise<Translation> => {
const lang = await import(/* webpackMode: "eager" */ `./lang-${language}`);
return lang.translation as Translation;
console.log('Sprache: ' + language)
switch (language) {
case 'cs':
return langCs;
case 'de':
return langDe;
case 'en':
return langEn;
case 'es':
return langEs;
case 'fr':
return langFr;
case 'ja':
return langJa;
case 'ko':
return langKo;
case 'nl':
return langNl;
case 'pl':
return langPl;
case 'pt-br':
return langPtBr;
case 'pt-pt':
return langPtPt;
case 'ru':
return langRu;
case 'uk':
return langUk;
case 'zh-cn':
return langZhCn;
case 'zh-tw':
return langZhTw;
default:
return langEn;
}
};

/**
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-cs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Aktivovat',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-de.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Aktivieren',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-en.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Activate',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-es.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Activar',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-fr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Activer',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-ja.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: '有効化',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-ko.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: '활성화',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-nl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Activeer',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-pl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Aktywuj',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-pt-br.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Ativar',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-pt-pt.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Habilitar',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-ru.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Активировать',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-uk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: 'Активувати',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-zh-cn.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: '激活',
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/lang-zh-tw.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Translation } from '../models';
import { type Translation } from '../models';

export const translation: Translation = {
activate: '激活',
Expand Down

0 comments on commit 65b92e4

Please sign in to comment.