From 7f312a35e994f8019fb5e69eb8e2c04aba4b959e Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Tue, 21 Dec 2021 15:19:05 +0900 Subject: [PATCH 1/4] fix: language pack code unification --- src/extensions/locales-defaults/index.ts | 3 ++- src/extensions/locales-defaults/locales/en.json | 8 +++++++- .../locales-defaults/locales/zh-CN.json | 16 ++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/extensions/locales-defaults/index.ts b/src/extensions/locales-defaults/index.ts index 4d46cc1e8..61d8bfdbe 100644 --- a/src/extensions/locales-defaults/index.ts +++ b/src/extensions/locales-defaults/index.ts @@ -1,8 +1,9 @@ import { IExtension, IContributeType } from 'mo/model/extension'; +const koKR = require('./locales/ko-KR.json'); const zhCN = require('./locales/zh-CN.json'); const en = require('./locales/en.json'); -const locales = [zhCN, en]; +const locales = [zhCN, en, koKR]; export const ExtendsLocales: IExtension = { id: 'ExtendsLocales', diff --git a/src/extensions/locales-defaults/locales/en.json b/src/extensions/locales-defaults/locales/en.json index 9ea1a92a5..a0ef6d838 100644 --- a/src/extensions/locales-defaults/locales/en.json +++ b/src/extensions/locales-defaults/locales/en.json @@ -3,8 +3,10 @@ "name": "English", "source": { "molecule.welcome": "Welcome to Molecule", + "menubar": "Menu Bar", "menu.file": "File", "menu.settings": "Settings", + "menu.account": "Account", "menu.colorTheme": "Color Theme", "menu.newFile": "New File", "menu.newFolder": "New Folder", @@ -24,14 +26,18 @@ "menu.showSideBar.label": "Toggle Side Bar Visibility", "menu.showStatusBar": "Show Status Bar", "menu.showActivityBar": "Show Activity Bar", + "menu.hideActivityBar": "Hide Activity Bar", "menu.showPanel": "Show Panel", "menu.showPanel.title": "Toggle Panel", + "menu.defaultProjectName": "Default Project Name", "menu.run": "Run", + "menu.runTask": "Run Task", "menu.help": "Help", + "menu.about": "About", "menu.menuBarHorizontal": "Menu Bar Horizontal Mode", "menu.menuBarVertical": "Menu Bar Vertical Mode", - "sidebar.explore.title": "Explorer", "sidebar.explore.folders": "Folders", + "sidebar.explore.title": "Explore", "sidebar.explore.openEditor": "Open Editors", "sidebar.explore.openEditor.group": "Group ${i}", "sidebar.explore.outline": "Outline", diff --git a/src/extensions/locales-defaults/locales/zh-CN.json b/src/extensions/locales-defaults/locales/zh-CN.json index 38e8249f4..9eabded37 100644 --- a/src/extensions/locales-defaults/locales/zh-CN.json +++ b/src/extensions/locales-defaults/locales/zh-CN.json @@ -36,19 +36,27 @@ "menu.about": "关于", "menu.menuBarHorizontal": "菜单栏水平模式", "menu.menuBarVertical": "菜单栏垂直模式", + "sidebar.explore.folders": "文件夹", "sidebar.explore.title": "浏览", "sidebar.explore.openEditor": "打开的编辑器", "sidebar.explore.openEditor.group": "第 ${i} 组", "sidebar.explore.outline": "轮廓", - "sidebar.explore.outlineMore": "更多操作...", - "sidebar.explore.refresh": "刷新浏览", - "sidebar.explore.folders": "文件夹", - "sidebar.explore.collapseFolders": "折叠文件夹", "sidebar.search.title": "搜索", "sidebar.replace.placement": "替换", + "sidebar.explore.refresh": "刷新浏览", + "sidebar.explore.collapseFolders": "折叠文件夹", + "sidebar.explore.toggleVertical": "切换垂直", + "sidebar.explore.saveAll": "全部保存", + "sidebar.explore.actionDesc": "视图和更多操作...", + "sidebar.explore.outlineMore": "更多操作...", "toolbar.refresh": "刷新", "toolbar.clearAll": "清除所有", "toolbar.collapseAll": "折叠所有", + "search.matchCase": "区分大小写", + "search.matchWholeWord": "匹配整个字词", + "search.useRegularExpression": "使用正则表达式", + "search.preserveCase": "保留大小写", + "search.replaceAll": "全部替换", "panel.output.title": "输出", "panel.problems.title": "问题", "panel.problems.empty": "未在工作区检测到问题", From 0cca06a10468903756dc6a8775ffa0e7a7f4d05e Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Tue, 21 Dec 2021 15:19:05 +0900 Subject: [PATCH 2/4] fix: language pack code unification --- src/extensions/locales-defaults/index.ts | 3 +- .../locales-defaults/locales/en.json | 8 +- .../locales-defaults/locales/ko-KR.json | 86 +++++++++++++++++++ .../locales-defaults/locales/zh-CN.json | 16 +++- 4 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 src/extensions/locales-defaults/locales/ko-KR.json diff --git a/src/extensions/locales-defaults/index.ts b/src/extensions/locales-defaults/index.ts index 4d46cc1e8..61d8bfdbe 100644 --- a/src/extensions/locales-defaults/index.ts +++ b/src/extensions/locales-defaults/index.ts @@ -1,8 +1,9 @@ import { IExtension, IContributeType } from 'mo/model/extension'; +const koKR = require('./locales/ko-KR.json'); const zhCN = require('./locales/zh-CN.json'); const en = require('./locales/en.json'); -const locales = [zhCN, en]; +const locales = [zhCN, en, koKR]; export const ExtendsLocales: IExtension = { id: 'ExtendsLocales', diff --git a/src/extensions/locales-defaults/locales/en.json b/src/extensions/locales-defaults/locales/en.json index 9ea1a92a5..a0ef6d838 100644 --- a/src/extensions/locales-defaults/locales/en.json +++ b/src/extensions/locales-defaults/locales/en.json @@ -3,8 +3,10 @@ "name": "English", "source": { "molecule.welcome": "Welcome to Molecule", + "menubar": "Menu Bar", "menu.file": "File", "menu.settings": "Settings", + "menu.account": "Account", "menu.colorTheme": "Color Theme", "menu.newFile": "New File", "menu.newFolder": "New Folder", @@ -24,14 +26,18 @@ "menu.showSideBar.label": "Toggle Side Bar Visibility", "menu.showStatusBar": "Show Status Bar", "menu.showActivityBar": "Show Activity Bar", + "menu.hideActivityBar": "Hide Activity Bar", "menu.showPanel": "Show Panel", "menu.showPanel.title": "Toggle Panel", + "menu.defaultProjectName": "Default Project Name", "menu.run": "Run", + "menu.runTask": "Run Task", "menu.help": "Help", + "menu.about": "About", "menu.menuBarHorizontal": "Menu Bar Horizontal Mode", "menu.menuBarVertical": "Menu Bar Vertical Mode", - "sidebar.explore.title": "Explorer", "sidebar.explore.folders": "Folders", + "sidebar.explore.title": "Explore", "sidebar.explore.openEditor": "Open Editors", "sidebar.explore.openEditor.group": "Group ${i}", "sidebar.explore.outline": "Outline", diff --git a/src/extensions/locales-defaults/locales/ko-KR.json b/src/extensions/locales-defaults/locales/ko-KR.json new file mode 100644 index 000000000..bf15eea8d --- /dev/null +++ b/src/extensions/locales-defaults/locales/ko-KR.json @@ -0,0 +1,86 @@ +{ + "id": "korean", + "name": "한국어", + "source": { + "molecule.welcome": "Molecule에 오신 것을 환영합니다", + "menubar": "메뉴 모음", + "menu.file": "파일", + "menu.settings": "설정", + "menu.account": "계정", + "menu.colorTheme": "색 테마", + "menu.newFile": "새 파일", + "menu.newFolder": "새 폴더", + "menu.open": "열기", + "menu.edit": "편집", + "menu.undo": "되돌리기", + "menu.redo": "다시 실행", + "menu.selection": "선택", + "menu.selectAll": "모두 선택", + "menu.copyLineUp": "위에 줄 복사", + "menu.view": "보기", + "menu.commandPalette": "명령어 팔레트", + "menu.openView": "뷰 열기", + "menu.appearance": "모양", + "menu.showMenuBar": "메뉴 모음 표시", + "menu.showSideBar": "사이드 모음 표시", + "menu.showSideBar.label": "사이드 모음 표시 유형 토글", + "menu.showStatusBar": "상태 표시줄 보기", + "menu.showActivityBar": "작업 막대 표시", + "menu.hideActivityBar": "작업 막대 숨기기", + "menu.showPanel": "패널 표시", + "menu.showPanel.title": "패널 토글", + "menu.defaultProjectName": "기본 프로젝트 이름", + "menu.run": "실행", + "menu.runTask": "작업 실행", + "menu.help": "도움말", + "menu.about": "정보", + "menu.menuBarHorizontal": "메뉴 모음 가로 모드", + "menu.menuBarVertical": "메뉴 모음 새로 모드", + "sidebar.explore.title": "탐색기", + "sidebar.explore.folders": "폴더", + "sidebar.explore.openEditor": "편집기 열기", + "sidebar.explore.openEditor.group": "${i} 그룹", + "sidebar.explore.outline": "개요", + "sidebar.search.title": "검색", + "sidebar.replace.placement": "바꾸기", + "sidebar.explore.refresh": "탐색기 새로 고침", + "sidebar.explore.collapseFolders": "탐색기 내에 폴더 축소", + "sidebar.explore.toggleVertical": "세로로 토글", + "sidebar.explore.saveAll": "모두 저장", + "sidebar.explore.actionDesc": "보기 및 더 기타 작업...", + "sidebar.explore.outlineMore": "더 많은 액션들...", + "toolbar.refresh": "새로 고침", + "toolbar.clearAll": "모두 지우기", + "toolbar.collapseAll": "모두 축소", + "search.matchCase": "대/소문자 구분", + "search.matchWholeWord": "전체 단어 일치", + "search.useRegularExpression": "정규식 사용", + "search.preserveCase": "대/소문자 보존", + "search.replaceAll": "모두 바꾸기", + "panel.output.title": "출력", + "panel.toolbox.closePanel": "패널 닫기", + "panel.toolbox.maximize": "패널 크기 최대화", + "panel.toolbox.restoreSize": "패널 크기 복원", + "panel.problems.title": "문제", + "panel.problems.empty": "작업 영역안에는 문제가 감지되지 않았습니다.", + "notification.title": "알림", + "notification.title.no": "새로운 알림이 없습니다.", + "editor.closeToRight": "오른쪽에 있는 항목 닫기", + "editor.closeToLeft": "왼쪽에 있는 항목 닫기", + "editor.closeAll": "모두 닫기", + "editor.closeSaved": "저장된 항목 닫기", + "editor.closeOthers": "기타 항목 닫기", + "editor.close": "닫기", + "editor.actions.splitRight": "오른쪽으로 분할", + "editor.showOpenEditors": "열려 있는 편집기 표시", + "contextmenu.rename": "이름 바꾸기", + "contextmenu.delete": "삭제", + "contextmenu.newFile": "새 파일", + "contextmenu.newFolder": "새 폴더", + "contextmenu.removeFolder": "폴더 삭제", + "contextmenu.openToTheSide": "사이드에 열기", + "contextmenu.addFolderToSpace": "작업 영역에 폴더 추가...", + "contextmenu.findInSpace": "작업 영역에서 찾기...", + "contextmenu.download": "다운로드..." + } +} diff --git a/src/extensions/locales-defaults/locales/zh-CN.json b/src/extensions/locales-defaults/locales/zh-CN.json index 38e8249f4..9eabded37 100644 --- a/src/extensions/locales-defaults/locales/zh-CN.json +++ b/src/extensions/locales-defaults/locales/zh-CN.json @@ -36,19 +36,27 @@ "menu.about": "关于", "menu.menuBarHorizontal": "菜单栏水平模式", "menu.menuBarVertical": "菜单栏垂直模式", + "sidebar.explore.folders": "文件夹", "sidebar.explore.title": "浏览", "sidebar.explore.openEditor": "打开的编辑器", "sidebar.explore.openEditor.group": "第 ${i} 组", "sidebar.explore.outline": "轮廓", - "sidebar.explore.outlineMore": "更多操作...", - "sidebar.explore.refresh": "刷新浏览", - "sidebar.explore.folders": "文件夹", - "sidebar.explore.collapseFolders": "折叠文件夹", "sidebar.search.title": "搜索", "sidebar.replace.placement": "替换", + "sidebar.explore.refresh": "刷新浏览", + "sidebar.explore.collapseFolders": "折叠文件夹", + "sidebar.explore.toggleVertical": "切换垂直", + "sidebar.explore.saveAll": "全部保存", + "sidebar.explore.actionDesc": "视图和更多操作...", + "sidebar.explore.outlineMore": "更多操作...", "toolbar.refresh": "刷新", "toolbar.clearAll": "清除所有", "toolbar.collapseAll": "折叠所有", + "search.matchCase": "区分大小写", + "search.matchWholeWord": "匹配整个字词", + "search.useRegularExpression": "使用正则表达式", + "search.preserveCase": "保留大小写", + "search.replaceAll": "全部替换", "panel.output.title": "输出", "panel.problems.title": "问题", "panel.problems.empty": "未在工作区检测到问题", From 55a1e6ead098ef734da08fb1ee2bf3d8e1c3421b Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Tue, 21 Dec 2021 15:58:53 +0900 Subject: [PATCH 3/4] Update src/extensions/locales-defaults/locales/en.json Co-authored-by: Ziv --- src/extensions/locales-defaults/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extensions/locales-defaults/locales/en.json b/src/extensions/locales-defaults/locales/en.json index a0ef6d838..c8e69d80d 100644 --- a/src/extensions/locales-defaults/locales/en.json +++ b/src/extensions/locales-defaults/locales/en.json @@ -37,7 +37,7 @@ "menu.menuBarHorizontal": "Menu Bar Horizontal Mode", "menu.menuBarVertical": "Menu Bar Vertical Mode", "sidebar.explore.folders": "Folders", - "sidebar.explore.title": "Explore", + "sidebar.explore.title": "Explorer", "sidebar.explore.openEditor": "Open Editors", "sidebar.explore.openEditor.group": "Group ${i}", "sidebar.explore.outline": "Outline", From 232db8275ec25dc350d24cd4d60ab58986a95635 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Wed, 22 Dec 2021 23:50:26 +0900 Subject: [PATCH 4/4] fix: language pack unit test --- src/extensions/locales-defaults/locales/ko-KR.json | 2 +- src/i18n/__tests__/localeService.test.ts | 14 +++++++------- .../__tests__/__snapshots__/molecule.test.tsx.snap | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/extensions/locales-defaults/locales/ko-KR.json b/src/extensions/locales-defaults/locales/ko-KR.json index bfb53aaa4..b2ae36ecc 100644 --- a/src/extensions/locales-defaults/locales/ko-KR.json +++ b/src/extensions/locales-defaults/locales/ko-KR.json @@ -1,5 +1,5 @@ { - "id": "korean", + "id": "ko-KR", "name": "한국어", "source": { "molecule.welcome": "Molecule에 오신 것을 환영합니다", diff --git a/src/i18n/__tests__/localeService.test.ts b/src/i18n/__tests__/localeService.test.ts index 31c79d573..048de2f45 100644 --- a/src/i18n/__tests__/localeService.test.ts +++ b/src/i18n/__tests__/localeService.test.ts @@ -38,10 +38,10 @@ describe('The Locale Service', () => { expect(defaultLocale).toEqual(BuiltInLocales); }); - test('The size of Built-in Locales should be 2', () => { + test('The size of Built-in Locales should be 3', () => { const localeService = new LocaleService(); const locales = localeService.getLocales(); - expect(locales.length).toBe(2); + expect(locales.length).toBe(3); }); test('Initialize the locales', () => { @@ -50,7 +50,7 @@ describe('The Locale Service', () => { expect(localeService.getCurrentLocale()!.id).toEqual( localeService.getDefaultLocale().id ); - expect(localeService.getLocales().length).toBe(3); + expect(localeService.getLocales().length).toBe(4); localeService.initialize([], 'test'); expect(localeService.getCurrentLocale()!.id).toEqual(BuiltInDefault.id); // Clear the cached locale value @@ -75,14 +75,14 @@ describe('The Locale Service', () => { test('Add locales', () => { const localeService = new LocaleService(); - expect(localeService.getLocales().length).toBe(2); - localeService.addLocales([TestLocale]); expect(localeService.getLocales().length).toBe(3); + localeService.addLocales([TestLocale]); + expect(localeService.getLocales().length).toBe(4); localeService.addLocales([]); - expect(localeService.getLocales().length).toBe(3); + expect(localeService.getLocales().length).toBe(4); // Add an existed locale localeService.addLocales([TestLocale]); - expect(localeService.getLocales().length).toBe(3); + expect(localeService.getLocales().length).toBe(4); }); test('Add an locale inherit the en', () => { diff --git a/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap b/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap index c51b566ce..9b63b5bca 100644 --- a/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap +++ b/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap @@ -218,7 +218,7 @@ exports[`Test MoleculeProvider Match The MoleculeProvider snapshot 1`] = ` - No Open Folder + Default Project Name