From 7f312a35e994f8019fb5e69eb8e2c04aba4b959e Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Tue, 21 Dec 2021 15:19:05 +0900 Subject: [PATCH 01/12] 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 02/12] 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 03/12] 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 04/12] 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
Date: Wed, 22 Dec 2021 23:50:26 +0900 Subject: [PATCH 05/12] fix: language pack unit test --- .../locales-defaults/locales/ko-KR.json | 2 +- src/i18n/__tests__/localeService.test.ts | 26 +++++++++++++------ .../__snapshots__/molecule.test.tsx.snap | 2 +- 3 files changed, 20 insertions(+), 10 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..994d86f63 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', () => { @@ -130,7 +130,7 @@ describe('The Locale Service', () => { expect(localeService.removeLocale(TestLocale.id)); }); - test('Listen to the current locale change event', () => { + test('Listen to the current locale change to Chineses event', () => { const target = 'zh-CN'; const localeService = new LocaleService(); const fn = jest.fn(); @@ -140,6 +140,16 @@ describe('The Locale Service', () => { expect(localeService.getCurrentLocale()!.id).toEqual(target); }); + test('Listen to the current locale change to Korean event', () => { + const target = 'ko-KR'; + const localeService = new LocaleService(); + const fn = jest.fn(); + localeService.onChange(fn); + localeService.setCurrentLocale(target); + expect(fn).toBeCalledTimes(1); + expect(localeService.getCurrentLocale()!.id).toEqual(target); + }); + test('Localize the source key', () => { const localeService = new LocaleService(); let res = localeService.localize('test'); 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
Date: Sat, 25 Dec 2021 20:49:45 +0900 Subject: [PATCH 06/12] docs: add korean README and add test method --- README-koKR.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ README-zhCN.md | 10 ++++- README.md | 14 ++++-- 3 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 README-koKR.md diff --git a/README-koKR.md b/README-koKR.md new file mode 100644 index 000000000..201ed2df9 --- /dev/null +++ b/README-koKR.md @@ -0,0 +1,115 @@ +
+ + watchman-logo +

Molecule

+

A lightweight Web IDE UI Framework

+ +[![CI][ci-image]][ci-url] [![Codecov][codecov-image]][codecov-url] [![NPM downloads][download-img]][download-url] [![NPM version][npm-version]][npm-version-url] + +
+ +[ci-image]: https://github.com/DTStack/molecule/actions/workflows/main.yml/badge.svg +[ci-url]: https://github.com/DTStack/molecule/actions/workflows/main.yml +[codecov-image]: https://codecov.io/gh/DTStack/molecule/branch/main/graph/badge.svg?token=PDjbCBo6qz +[codecov-url]: https://codecov.io/gh/DTStack/molecule +[download-img]: https://img.shields.io/npm/dm/@dtinsight/molecule.svg?style=flat +[download-url]: https://www.npmjs.com/package/@dtinsight/molecule +[npm-version]: https://img.shields.io/npm/v/@dtinsight/molecule.svg?style=flat-square +[npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule + +[中文](./README-zhCN.md) | [English](./README.md) | [한국어](./README-koKR.md) + +**Molecule**은 React.js로 구축되었으며 VSCode에서 영감을 받은 경량 **웹 IDE UI** 프레임워크입니다. 개발자가 워크벤치를 더 쉽게 확장할 수 있도록 VSCode와 유사한 확장 API를 설계했습니다. Molecule을 React.js 애플리케이션과 통합하는 것이 편리합니다. [DTStack](https://www.dtstack.com/)의 많은 제품들에 이 코드가 적용되었습니다. + +[온라인 미리보기](https://dtstack.github.io/molecule-examples/#/) + +## 기능들 + +- Visual Studio Code **워크벤치** UI 제공 + (https://code.visualstudio.com/api/extension-capabilities/extending-workbench) +- VSCode **ColorTheme** 와 호환 +- **React Component**를 통해 워크벤치를 쉽게 사용자 정의 +- Monaco-Editor **Command Palette, Keybinding** 기능 내장 +- **i18n** 지원, 중국어 간체, 영어 , 한국어 지원 +- **설정** 지원 , Extension을 통한 편집 및 확장 지원 +- 기본 **Explorer, Search** 컴포넌트 지원, Extension을 통환 확장 지원 +- **Typescript** 지원 + +## 설치 + +```bash +npm install @dtinsight/molecule +# Or +yarn add @dtinsight/molecule +``` + +## 기본 사용법 + +```javascript +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MoleculeProvider, Workbench } from '@dtinsight/molecule'; +import '@dtinsight/molecule/esm/style/mo.css'; + +const App = () => ( + + + +); + +ReactDOM.render(, document.getElementById('root')); +``` + +`extension`은 확장 응용 프로그램 항목입니다. 확장에 대한 자세한 내용은 [빠른 시작](https://dtstack.github.io/molecule/docs/quick-start)을 참조하십시오. + +## 문서 + +- [소개](https://dtstack.github.io/molecule/docs/introduction) +- [빠른 시작](https://dtstack.github.io/molecule/docs/quick-start) +- [API](https://dtstack.github.io/molecule/docs/api) +- [확장 워크벤치](https://dtstack.github.io/molecule/docs/guides/extend-workbench) +- [예제들](https://github.com/DTStack/molecule-examples) + +## 개발 + +```bash +git clone git@github.com:DTStack/molecule.git +``` + +로컬에 소스코드를 클론 하세요 + +**개발 모드** + +```bash +yarn # Install dependencies + +yarn dev # Start dev mode +``` + +Molecule은 React 컴포넌트를 개발,관리하기 위해 **Storybook**을 사용합니다. +기본 링크는 `http://localhost:6006/` 입니다. + +**테스트** + +```bash +yarn test -u +``` + +**빌드 & 미리보기** + +```bash +yarn build # Compile to ESM +yarn web # Web Preview Mode +``` + +소스 코드를 ES6 모듈로 컴파일하고 **`esm`** 폴더에 출력 합니다. 스토리북 개발 모드 외에도 ESM 모듈을 사용하는 **Web Preview** 모드도 내장되어 있습니다. + +## 기여 + +자세한 사항은 [기여](./CONTRIBUTING.md)을 참조하세요. + +## 라이선스 + +Copyright © DTStack. All rights reserved. + +MIT 라이선스에 따라 라이선스가 부여됩니다. diff --git a/README-zhCN.md b/README-zhCN.md index 253a5071b..7dfe52b91 100644 --- a/README-zhCN.md +++ b/README-zhCN.md @@ -17,7 +17,7 @@ [npm-version]: https://img.shields.io/npm/v/@dtinsight/molecule.svg?style=flat-square [npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule -[中文](./README-zhCN.md) | [English](./README.md) +[中文](./README-zhCN.md) | [English](./README.md) | [한국어](./README-koKR.md) Molecule 是一款受 **VSCode** 启发,使用 **React.js** 构建的 **Web IDE UI** 框架。我们设计了类似 VSCode 的**扩展**(Extension)机制,可以帮助我们使用 React 组件快速完成对 Workbench 的自定义。Molecule 与 **React** 项目集成非常方便,我们已经在 [DTStack](https://www.dtstack.com/) 多个产品、项目中使用。 @@ -29,7 +29,7 @@ Molecule 是一款受 **VSCode** 启发,使用 **React.js** 构建的 **Web ID - 基本兼容 Visual Studio Code 的 **ColorTheme** - 支持使用 React 组件自定义 **Workbench** UI 样式 - 内置 Monaco Editor **Command Palette**、**Keybinding**等模块,并支持扩展 -- 支持 **i18n**,内置简体中文、English 2 种语言 +- 支持 **i18n**,簡体字中国語、英制、朝鲜语 3 种语言 - 内置一个简单的 **Settings** 模块,支持在线编辑修改以及扩展 - 内置默认的 **Explorer**, **Search** 等组件,并支持扩展 - Typescript 支持 @@ -86,6 +86,12 @@ yarn dev # 启动开发模式 Molecule 中的组件是基于 Storybook 开发并管理的,预览地址:`http://localhost:6006/`默认地址浏览。 +**测试** + +```bash +yarn test -u +``` + **构建 & 预览** ```bash diff --git a/README.md b/README.md index 6d8337b83..893777109 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [npm-version]: https://img.shields.io/npm/v/@dtinsight/molecule.svg?style=flat-square [npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule -[中文](./README-zhCN.md) | [English](./README.md) +[中文](./README-zhCN.md) | [English](./README.md) | [한국어](./README-koKR.md) The **Molecule** is a lightweight **Web IDE UI** framework which is built with React.js and inspired by the VSCode. We have designed the Extension APIs similar to the VSCode, to help developers extend the Workbench in an easier way. It's convenient to integrate the Molecule with React.js applications. It has been applied to many products in [DTStack](https://www.dtstack.com/) @@ -25,11 +25,11 @@ The **Molecule** is a lightweight **Web IDE UI** framework which is built with R ## Features -- Built-in the VSCode **Workbench** UI -- Compatible with the VSCode **ColorTheme** +- Built-in the Visual Studio Code **Workbench** UI +- Compatible with the Visual Studio Code **ColorTheme** - Customize the Workbench via **React Component** easily - Built-in Monaco-Editor **Command Palette, Keybinding** features -- Support the **i18n**, built-in zhCN, and English +- Support the **i18n**, built-in Simplified Chinese, Korean and English - Built-in **Settings**, support to edit and extend via the Extension - Built-in basic **Explorer, Search** components, and support extending via the Extension - **Typescript** Ready @@ -87,6 +87,12 @@ yarn dev # Start dev mode The Molecule using the **Storybook** to manage and develop the React components, the default visiting address is `http://localhost:6006/`. +**Test** + +```bash +yarn test -u +``` + **Build & Preview** ```bash From 65d2948d37210c51528c9eddc3e391936d691e66 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Sat, 25 Dec 2021 20:49:45 +0900 Subject: [PATCH 07/12] docs: add korean README and add test method --- README-koKR.md | 115 +++++++++++++++++++++++++++++++++++++++++++++++++ README-zhCN.md | 10 ++++- README.md | 14 ++++-- 3 files changed, 133 insertions(+), 6 deletions(-) create mode 100644 README-koKR.md diff --git a/README-koKR.md b/README-koKR.md new file mode 100644 index 000000000..346406353 --- /dev/null +++ b/README-koKR.md @@ -0,0 +1,115 @@ +
+ + watchman-logo +

Molecule

+

경량 웹 IDE UI 프레임워크

+ +[![CI][ci-image]][ci-url] [![Codecov][codecov-image]][codecov-url] [![NPM downloads][download-img]][download-url] [![NPM version][npm-version]][npm-version-url] + +
+ +[ci-image]: https://github.com/DTStack/molecule/actions/workflows/main.yml/badge.svg +[ci-url]: https://github.com/DTStack/molecule/actions/workflows/main.yml +[codecov-image]: https://codecov.io/gh/DTStack/molecule/branch/main/graph/badge.svg?token=PDjbCBo6qz +[codecov-url]: https://codecov.io/gh/DTStack/molecule +[download-img]: https://img.shields.io/npm/dm/@dtinsight/molecule.svg?style=flat +[download-url]: https://www.npmjs.com/package/@dtinsight/molecule +[npm-version]: https://img.shields.io/npm/v/@dtinsight/molecule.svg?style=flat-square +[npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule + +[中文](./README-zhCN.md) | [English](./README.md) | [한국어](./README-koKR.md) + +**Molecule**은 React.js로 구축되었으며 VSCode에서 영감을 받은 경량 **웹 IDE UI** 프레임워크입니다. 개발자가 워크벤치를 더 쉽게 확장할 수 있도록 VSCode와 유사한 확장 API를 설계했습니다. Molecule을 React.js 애플리케이션과 통합하는 것이 편리합니다. [DTStack](https://www.dtstack.com/)의 많은 제품들에 이 코드가 적용되었습니다. + +[온라인 미리보기](https://dtstack.github.io/molecule-examples/#/) + +## 기능들 + +- Visual Studio Code **워크벤치** UI 제공 + (https://code.visualstudio.com/api/extension-capabilities/extending-workbench) +- VSCode **ColorTheme** 와 호환 +- **React Component**를 통해 워크벤치를 쉽게 사용자 정의 +- Monaco-Editor **Command Palette, Keybinding** 기능 내장 +- **i18n** 지원, 중국어 간체, 영어 , 한국어 지원 +- **설정** 지원 , Extension을 통한 편집 및 확장 지원 +- 기본 **Explorer, Search** 컴포넌트 지원, Extension을 통환 확장 지원 +- **Typescript** 지원 + +## 설치 + +```bash +npm install @dtinsight/molecule +# Or +yarn add @dtinsight/molecule +``` + +## 기본 사용법 + +```javascript +import React from 'react'; +import ReactDOM from 'react-dom'; +import { MoleculeProvider, Workbench } from '@dtinsight/molecule'; +import '@dtinsight/molecule/esm/style/mo.css'; + +const App = () => ( + + + +); + +ReactDOM.render(, document.getElementById('root')); +``` + +`extension`은 확장 응용 프로그램 항목입니다. 확장에 대한 자세한 내용은 [빠른 시작](https://dtstack.github.io/molecule/docs/quick-start)을 참조하십시오. + +## 문서 + +- [소개](https://dtstack.github.io/molecule/docs/introduction) +- [빠른 시작](https://dtstack.github.io/molecule/docs/quick-start) +- [API](https://dtstack.github.io/molecule/docs/api) +- [확장 워크벤치](https://dtstack.github.io/molecule/docs/guides/extend-workbench) +- [예제들](https://github.com/DTStack/molecule-examples) + +## 개발 + +```bash +git clone git@github.com:DTStack/molecule.git +``` + +로컬에 소스코드를 클론 하세요 + +**개발 모드** + +```bash +yarn # Install dependencies + +yarn dev # Start dev mode +``` + +Molecule은 React 컴포넌트를 개발,관리하기 위해 **Storybook**을 사용합니다. +기본 링크는 `http://localhost:6006/` 입니다. + +**테스트** + +```bash +yarn test -u +``` + +**빌드 & 미리보기** + +```bash +yarn build # Compile to ESM +yarn web # Web Preview Mode +``` + +소스 코드를 ES6 모듈로 컴파일하고 **`esm`** 폴더에 출력 합니다. 스토리북 개발 모드 외에도 ESM 모듈을 사용하는 **Web Preview** 모드도 내장되어 있습니다. + +## 기여 + +자세한 사항은 [기여](./CONTRIBUTING.md)을 참조하세요. + +## 라이선스 + +Copyright © DTStack. All rights reserved. + +MIT 라이선스에 따라 라이선스가 부여됩니다. diff --git a/README-zhCN.md b/README-zhCN.md index 253a5071b..7dfe52b91 100644 --- a/README-zhCN.md +++ b/README-zhCN.md @@ -17,7 +17,7 @@ [npm-version]: https://img.shields.io/npm/v/@dtinsight/molecule.svg?style=flat-square [npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule -[中文](./README-zhCN.md) | [English](./README.md) +[中文](./README-zhCN.md) | [English](./README.md) | [한국어](./README-koKR.md) Molecule 是一款受 **VSCode** 启发,使用 **React.js** 构建的 **Web IDE UI** 框架。我们设计了类似 VSCode 的**扩展**(Extension)机制,可以帮助我们使用 React 组件快速完成对 Workbench 的自定义。Molecule 与 **React** 项目集成非常方便,我们已经在 [DTStack](https://www.dtstack.com/) 多个产品、项目中使用。 @@ -29,7 +29,7 @@ Molecule 是一款受 **VSCode** 启发,使用 **React.js** 构建的 **Web ID - 基本兼容 Visual Studio Code 的 **ColorTheme** - 支持使用 React 组件自定义 **Workbench** UI 样式 - 内置 Monaco Editor **Command Palette**、**Keybinding**等模块,并支持扩展 -- 支持 **i18n**,内置简体中文、English 2 种语言 +- 支持 **i18n**,簡体字中国語、英制、朝鲜语 3 种语言 - 内置一个简单的 **Settings** 模块,支持在线编辑修改以及扩展 - 内置默认的 **Explorer**, **Search** 等组件,并支持扩展 - Typescript 支持 @@ -86,6 +86,12 @@ yarn dev # 启动开发模式 Molecule 中的组件是基于 Storybook 开发并管理的,预览地址:`http://localhost:6006/`默认地址浏览。 +**测试** + +```bash +yarn test -u +``` + **构建 & 预览** ```bash diff --git a/README.md b/README.md index 6d8337b83..893777109 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [npm-version]: https://img.shields.io/npm/v/@dtinsight/molecule.svg?style=flat-square [npm-version-url]: https://www.npmjs.com/package/@dtinsight/molecule -[中文](./README-zhCN.md) | [English](./README.md) +[中文](./README-zhCN.md) | [English](./README.md) | [한국어](./README-koKR.md) The **Molecule** is a lightweight **Web IDE UI** framework which is built with React.js and inspired by the VSCode. We have designed the Extension APIs similar to the VSCode, to help developers extend the Workbench in an easier way. It's convenient to integrate the Molecule with React.js applications. It has been applied to many products in [DTStack](https://www.dtstack.com/) @@ -25,11 +25,11 @@ The **Molecule** is a lightweight **Web IDE UI** framework which is built with R ## Features -- Built-in the VSCode **Workbench** UI -- Compatible with the VSCode **ColorTheme** +- Built-in the Visual Studio Code **Workbench** UI +- Compatible with the Visual Studio Code **ColorTheme** - Customize the Workbench via **React Component** easily - Built-in Monaco-Editor **Command Palette, Keybinding** features -- Support the **i18n**, built-in zhCN, and English +- Support the **i18n**, built-in Simplified Chinese, Korean and English - Built-in **Settings**, support to edit and extend via the Extension - Built-in basic **Explorer, Search** components, and support extending via the Extension - **Typescript** Ready @@ -87,6 +87,12 @@ yarn dev # Start dev mode The Molecule using the **Storybook** to manage and develop the React components, the default visiting address is `http://localhost:6006/`. +**Test** + +```bash +yarn test -u +``` + **Build & Preview** ```bash From 60e9cc2ac8b18a904ee9d4c97b105a4cf1d6d5b1 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Sun, 2 Jan 2022 11:26:13 +0900 Subject: [PATCH 08/12] feat: sort the order of language packs in English and terminology not translated in Workbench --- src/components/search/index.tsx | 8 +- .../locales-defaults/locales/en.json | 138 ++++++++++-------- .../locales-defaults/locales/ko-KR.json | 138 ++++++++++-------- .../locales-defaults/locales/zh-CN.json | 138 ++++++++++-------- src/i18n/localization.ts | 129 ++++++++-------- .../__snapshots__/molecule.test.tsx.snap | 4 +- src/services/builtinService/const.ts | 14 +- .../notification/notificationPane/index.tsx | 5 +- .../sidebar/__tests__/folderTree.test.tsx | 6 +- src/workbench/sidebar/explore/folderTree.tsx | 10 +- src/workbench/sidebar/search/searchPanel.tsx | 5 +- stories/extensions/test/index.tsx | 7 +- stories/extensions/test/testPane.tsx | 2 - 13 files changed, 342 insertions(+), 262 deletions(-) diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index 5b47f9ff2..bd7d9bd8c 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -11,6 +11,7 @@ import { searchTargetContainerClassName, } from './base'; import { Icon } from '../icon'; +import { localize } from 'mo/i18n/localize'; export type SearchValues = (string | undefined)[]; @@ -52,8 +53,11 @@ export function Search(props: ISearchProps) { } = props; const [ - searchPlaceholder = 'Search', - replacePlaceholder = 'Replace', + searchPlaceholder = localize('sidebar.search.placeHolder', 'Search'), + replacePlaceholder = localize( + 'sidebar.search.replace.placeHolder', + 'Replace' + ), ] = placeholders; const [searchAddons, replaceAddons] = addons; diff --git a/src/extensions/locales-defaults/locales/en.json b/src/extensions/locales-defaults/locales/en.json index c8e69d80d..2bb694bcf 100644 --- a/src/extensions/locales-defaults/locales/en.json +++ b/src/extensions/locales-defaults/locales/en.json @@ -3,84 +3,98 @@ "name": "English", "source": { "molecule.welcome": "Welcome to Molecule", - "menubar": "Menu Bar", - "menu.file": "File", - "menu.settings": "Settings", + "contextmenu.addFolderToSpace": "Add Folder to Workspace...", + "contextmenu.delete": "Delete", + "contextmenu.download": "Download...", + "contextmenu.findInSpace": "Find in Workspace...", + "contextmenu.newFile": "New File", + "contextmenu.newFolder": "New Folder", + "contextmenu.openToTheSide": "Open to the Side", + "contextmenu.removeFolder": "Remove Folder", + "contextmenu.rename": "Rename", + "editor.actions.splitRight": "Split Editor Right", + "editor.close": "Close", + "editor.closeAll": "Close All", + "editor.closeOthers": "Close Others", + "editor.closeSaved": "Close Saved", + "editor.closeToLeft": "Close To Left", + "editor.closeToRight": "Close To Right", + "editor.showOpenEditors": "Show Opened Editors", + "menu.about": "About", "menu.account": "Account", + "menu.appearance": "Appearance", "menu.colorTheme": "Color Theme", + "menu.commandPalette": "Command Palette", + "menu.copyLineUp": "Copy Line Up", + "menu.defaultProjectName": "Default Project Name", + "menu.edit": "Edit", + "menu.file": "File", + "menu.help": "Help", + "menu.hideActivityBar": "Hide Activity Bar", + "menu.menuBarHorizontal": "Menu Bar Horizontal Mode", + "menu.menuBarVertical": "Menu Bar Vertical Mode", "menu.newFile": "New File", "menu.newFolder": "New Folder", "menu.open": "Open", - "menu.edit": "Edit", - "menu.undo": "Undo", + "menu.openView": "Open View", "menu.redo": "Redo", - "menu.selection": "Selection", + "menu.run": "Run", + "menu.runTask": "Run Task", "menu.selectAll": "Select All", - "menu.copyLineUp": "Copy Line Up", - "menu.view": "View", - "menu.commandPalette": "Command Palette", - "menu.openView": "Open View", - "menu.appearance": "Appearance", + "menu.selection": "Selection", + "menu.settings": "Settings", + "menu.showActivityBar": "Show Activity Bar", "menu.showMenuBar": "Show Menu Bar", - "menu.showSideBar": "Show Side bar", + "menu.showPanel.title": "Toggle Panel", + "menu.showPanel": "Show Panel", "menu.showSideBar.label": "Toggle Side Bar Visibility", + "menu.showSideBar": "Show Side bar", "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", + "menu.undo": "Undo", + "menu.view": "View", + "menubar": "Menu Bar", + "message.noResult": "No results found.", + "message.noFolderButEditorsHelp": "You have not yet opened a folder.", + "message.searchMaxResultsWarning": "The result set only contains a subset of all matches. Be more specific in your search to narrow down the results.", + "notification.clear": "Clear Notification", + "notification.clearAll": "Clear All Notifications", + "notification.hideAll": "Hide Notifications", + "notification.title.no": "No new notifications", + "notification.title": "Notifications", + "panel.output.title": "output", + "panel.problems.empty": "No problems have been detected in the workspace.", + "panel.problems.title": "Problems", + "panel.toolbox.closePanel": "Close Panel", + "panel.toolbox.maximize": "Maximize Panel Size", + "panel.toolbox.restoreSize": "Restore Panel Size", + "search.matchCase": "Match Case", + "search.matchWholeWord": "Match Whole Word", + "search.preserveCase": "Preserve Case", + "search.toolbar.refresh": "Refresh", + "search.toolbar.clearAll": "Clear all", + "search.toolbar.collapseAll": "Collapse all", + "search.replaceAll": "Replace All", + "search.useRegularExpression": "Use Regular Expression", + "searchView.noResultsFound": "No results found. Review your settings for configured exclusions and check your gitignore files - ", + "sidebar.explore.actionDesc": "View and More Actions...", + "sidebar.explore.collapseFolders": "Collapse Folders in Explorer", + "sidebar.explore.closeAllEditors": "Close All Editors", "sidebar.explore.folders": "Folders", - "sidebar.explore.title": "Explorer", - "sidebar.explore.openEditor": "Open Editors", "sidebar.explore.openEditor.group": "Group ${i}", + "sidebar.explore.openEditor": "Open Editors", + "sidebar.explore.openFolder": "Open Folder", "sidebar.explore.outline": "Outline", - "sidebar.search.title": "Search", - "sidebar.replace.placement": "Replace", + "sidebar.explore.outlineMore": "More Actions...", "sidebar.explore.refresh": "Refresh Explorer", - "sidebar.explore.collapseFolders": "Collapse Folders in Explorer", + "sidebar.explore.saveALL": "Save All", + "sidebar.explore.title": "Explorer", "sidebar.explore.toggleVertical": "Toggle Vertical", - "sidebar.explore.saveAll": "Save All", - "sidebar.explore.actionDesc": "View and More Actions...", - "sidebar.explore.outlineMore": "More Actions...", - "toolbar.refresh": "Refresh", + "sidebar.replace.placement": "Replace", + "sidebar.search.placeHolder": "Search", + "sidebar.search.replace.placeHolder": "Replace", + "sidebar.search.title": "Search", "toolbar.clearAll": "Clear all", "toolbar.collapseAll": "Collapse all", - "search.matchCase": "Match Case", - "search.matchWholeWord": "Match Whole Word", - "search.useRegularExpression": "Use Regular Expression", - "search.preserveCase": "Preserve Case", - "search.replaceAll": "Replace All", - "panel.output.title": "output", - "panel.toolbox.closePanel": "Close Panel", - "panel.toolbox.maximize": "Maximize Panel Size", - "panel.toolbox.restoreSize": "Restore Panel Size", - "panel.problems.title": "Problems", - "panel.problems.empty": "No problems have been detected in the workspace.", - "notification.title": "Notifications", - "notification.title.no": "No new notifications", - "editor.closeToRight": "Close To Right", - "editor.closeToLeft": "Close To Left", - "editor.closeAll": "Close All", - "editor.closeSaved": "Close Saved", - "editor.closeOthers": "Close Others", - "editor.close": "Close", - "editor.actions.splitRight": "Split Editor Right", - "editor.showOpenEditors": "Show Opened Editors", - "contextmenu.rename": "Rename", - "contextmenu.delete": "Delete", - "contextmenu.newFile": "New File", - "contextmenu.newFolder": "New Folder", - "contextmenu.removeFolder": "Remove Folder", - "contextmenu.openToTheSide": "Open to the Side", - "contextmenu.addFolderToSpace": "Add Folder to Workspace...", - "contextmenu.findInSpace": "Find in Workspace...", - "contextmenu.download": "Download..." + "toolbar.refresh": "Refresh" } } diff --git a/src/extensions/locales-defaults/locales/ko-KR.json b/src/extensions/locales-defaults/locales/ko-KR.json index b2ae36ecc..b69a5beed 100644 --- a/src/extensions/locales-defaults/locales/ko-KR.json +++ b/src/extensions/locales-defaults/locales/ko-KR.json @@ -3,84 +3,98 @@ "name": "한국어", "source": { "molecule.welcome": "Molecule에 오신 것을 환영합니다", - "menubar": "메뉴 모음", - "menu.file": "파일", - "menu.settings": "설정", + "contextmenu.addFolderToSpace": "작업 영역에 폴더 추가...", + "contextmenu.delete": "삭제", + "contextmenu.download": "다운로드...", + "contextmenu.findInSpace": "작업 영역에서 찾기...", + "contextmenu.newFile": "새 파일", + "contextmenu.newFolder": "새 폴더", + "contextmenu.openToTheSide": "사이드에 열기", + "contextmenu.removeFolder": "폴더 삭제", + "contextmenu.rename": "이름 바꾸기", + "editor.actions.splitRight": "오른쪽으로 분할", + "editor.close": "닫기", + "editor.closeAll": "모두 닫기", + "editor.closeOthers": "기타 항목 닫기", + "editor.closeSaved": "저장된 항목 닫기", + "editor.closeToLeft": "왼쪽에 있는 항목 닫기", + "editor.closeToRight": "오른쪽에 있는 항목 닫기", + "editor.showOpenEditors": "열려 있는 편집기 표시", + "menu.about": "정보", "menu.account": "계정", + "menu.appearance": "모양", "menu.colorTheme": "색 테마", + "menu.commandPalette": "명령어 팔레트", + "menu.copyLineUp": "위에 줄 복사", + "menu.defaultProjectName": "기본 프로젝트 이름", + "menu.edit": "편집", + "menu.file": "파일", + "menu.help": "도움말", + "menu.hideActivityBar": "작업 막대 숨기기", + "menu.menuBarHorizontal": "메뉴 모음 가로 모드", + "menu.menuBarVertical": "메뉴 모음 새로 모드", "menu.newFile": "새 파일", "menu.newFolder": "새 폴더", "menu.open": "열기", - "menu.edit": "편집", - "menu.undo": "되돌리기", + "menu.openView": "뷰 열기", "menu.redo": "다시 실행", - "menu.selection": "선택", + "menu.run": "실행", + "menu.runTask": "작업 실행", "menu.selectAll": "모두 선택", - "menu.copyLineUp": "위에 줄 복사", - "menu.view": "보기", - "menu.commandPalette": "명령어 팔레트", - "menu.openView": "뷰 열기", - "menu.appearance": "모양", + "menu.selection": "선택", + "menu.settings": "설정", + "menu.showActivityBar": "작업 막대 표시", "menu.showMenuBar": "메뉴 모음 표시", - "menu.showSideBar": "사이드 모음 표시", + "menu.showPanel.title": "패널 토글", + "menu.showPanel": "패널 표시", "menu.showSideBar.label": "사이드 모음 표시 유형 토글", + "menu.showSideBar": "사이드 모음 표시", "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": "메뉴 모음 새로 모드", + "menu.undo": "되돌리기", + "menu.view": "보기", + "menubar": "메뉴 모음", + "message.noResult": "결과가 없습니다.", + "message.noFolderButEditorsHelp": "아직 폴더를 열지 않았습니다", + "message.searchMaxResultsWarning": "결과 집합에는 모든 일치 항목의 하위 집합만 포함됩니다. 결과 범위를 좁히려면 검색을 더 세분화하세요.", + "notification.clear": "알림 지우기", + "notification.clearAll": "모든 알림 지우기", + "notification.hideAll": "알림 숨기기", + "notification.title.no": "새로운 알림이 없습니다.", + "notification.title": "알림", + "panel.output.title": "출력", + "panel.problems.empty": "작업 영역안에는 문제가 감지되지 않았습니다.", + "panel.problems.title": "문제", + "panel.toolbox.closePanel": "패널 닫기", + "panel.toolbox.maximize": "패널 크기 최대화", + "panel.toolbox.restoreSize": "패널 크기 복원", + "search.matchCase": "대/소문자 구분", + "search.matchWholeWord": "전체 단어 일치", + "search.preserveCase": "대/소문자 보존", + "search.toolbar.refresh": "새로 고침", + "search.toolbar.clearAll": "모두 지우기", + "search.toolbar.collapseAll": "모두 축소", + "search.replaceAll": "모두 바꾸기", + "search.useRegularExpression": "정규식 사용", + "searchView.noResultsFound": "결과가 없습니다. 구성된 제외에 대한 설정을 검토하고 gitignore 파일을 확인하세요. - ", + "sidebar.explore.actionDesc": "보기 및 더 기타 작업...", + "sidebar.explore.closeAllEditors": "모든 편집기 닫기", + "sidebar.explore.collapseFolders": "탐색기 내에 폴더 축소", "sidebar.explore.folders": "폴더", - "sidebar.explore.title": "탐색기", - "sidebar.explore.openEditor": "편집기 열기", "sidebar.explore.openEditor.group": "${i} 그룹", + "sidebar.explore.openEditor": "편집기 열기", + "sidebar.explore.openFolder": "폴더 열기", "sidebar.explore.outline": "개요", - "sidebar.search.title": "검색", - "sidebar.replace.placement": "바꾸기", + "sidebar.explore.outlineMore": "더 많은 액션들...", "sidebar.explore.refresh": "탐색기 새로 고침", - "sidebar.explore.collapseFolders": "탐색기 내에 폴더 축소", + "sidebar.explore.saveALL": "모두 저장", + "sidebar.explore.title": "탐색기", "sidebar.explore.toggleVertical": "세로로 토글", - "sidebar.explore.saveAll": "모두 저장", - "sidebar.explore.actionDesc": "보기 및 더 기타 작업...", - "sidebar.explore.outlineMore": "더 많은 액션들...", - "toolbar.refresh": "새로 고침", + "sidebar.replace.placement": "바꾸기", + "sidebar.search.placeHolder": "검색", + "sidebar.search.replace.placeHolder": "바꾸기", + "sidebar.search.title": "검색", "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": "다운로드..." + "toolbar.refresh": "새로 고침" } } diff --git a/src/extensions/locales-defaults/locales/zh-CN.json b/src/extensions/locales-defaults/locales/zh-CN.json index 9eabded37..81f2f9ab4 100644 --- a/src/extensions/locales-defaults/locales/zh-CN.json +++ b/src/extensions/locales-defaults/locales/zh-CN.json @@ -3,84 +3,98 @@ "name": "简体中文", "source": { "molecule.welcome": "欢迎!", - "menubar": "菜单栏", - "menu.file": "文件", - "menu.settings": "设置", + "contextmenu.addFolderToSpace": "将文件夹添加到工作区...", + "contextmenu.delete": "删除", + "contextmenu.download": "下载...", + "contextmenu.findInSpace": "在工作区中寻找...", + "contextmenu.newFile": "新建文件", + "contextmenu.newFolder": "新建文件夹", + "contextmenu.openToTheSide": "在侧边打开", + "contextmenu.removeFolder": "删除文件夹", + "contextmenu.rename": "重命名", + "editor.actions.splitRight": "向右拆分编辑器", + "editor.close": "关闭", + "editor.closeAll": "关闭所有", + "editor.closeOthers": "关闭其他", + "editor.closeSaved": "关闭已保存", + "editor.closeToLeft": "关闭左边", + "editor.closeToRight": "关闭右边", + "editor.showOpenEditors": "展示已打开的编辑器", + "menu.about": "关于", "menu.account": "账号", + "menu.appearance": "外观", "menu.colorTheme": "颜色主题", + "menu.commandPalette": "命令面板", + "menu.copyLineUp": "向上拷贝", + "menu.defaultProjectName": "无打开文件夹", + "menu.edit": "编辑", + "menu.file": "文件", + "menu.help": "帮助", + "menu.hideActivityBar": "隐藏活动栏", + "menu.menuBarHorizontal": "菜单栏水平模式", + "menu.menuBarVertical": "菜单栏垂直模式", "menu.newFile": "新建文件", "menu.newFolder": "新建文件夹", "menu.open": "打开", - "menu.edit": "编辑", - "menu.undo": "撤销", + "menu.openView": "打开试图", "menu.redo": "重做", - "menu.selection": "选择", + "menu.run": "运行", + "menu.runTask": "运行任务", "menu.selectAll": "选择全部", - "menu.copyLineUp": "向上拷贝", - "menu.view": "视图", - "menu.commandPalette": "命令面板", - "menu.openView": "打开试图", - "menu.appearance": "外观", + "menu.selection": "选择", + "menu.settings": "设置", + "menu.showActivityBar": "显示活动栏", "menu.showMenuBar": "显示菜单栏", - "menu.showSideBar": "显示边栏", + "menu.showPanel.title": "切换面板", + "menu.showPanel": "显示面板", "menu.showSideBar.label": "切换侧边栏", + "menu.showSideBar": "显示边栏", "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": "菜单栏垂直模式", + "menu.undo": "撤销", + "menu.view": "视图", + "menubar": "菜单栏", + "message.noResult": "未找到结果。", + "message.noFolderButEditorsHelp": "尚未打开文件夹。", + "message.searchMaxResultsWarning": "结果集仅包含所有匹配项的子集。请使你的搜索更加具体以减少结果。", + "notification.clear": "清除通知", + "notification.clearAll": "清除所有通知", + "notification.hideAll": "隐藏通知", + "notification.title.no": "没有新通知", + "notification.title": "通知", + "panel.output.title": "输出", + "panel.problems.empty": "未在工作区检测到问题", + "panel.problems.title": "问题", + "panel.toolbox.closePanel": "关闭面板", + "panel.toolbox.maximize": "最大化面板", + "panel.toolbox.restoreSize": "恢复面板大小", + "search.matchCase": "区分大小写", + "search.matchWholeWord": "匹配整个字词", + "search.preserveCase": "保留大小写", + "search.toolbar.refresh": "刷新浏览", + "search.toolbar.clearAll": "清除所有", + "search.toolbar.collapseAll": "折叠所有", + "search.replaceAll": "全部替换", + "search.useRegularExpression": "使用正则表达式", + "searchView.noResultsFound": "未找到结果。查看您的设置配置排除, 并检查您的 gitignore 文件-", + "sidebar.explore.actionDesc": "视图和更多操作...", + "sidebar.explore.collapseFolders": "折叠文件夹", + "sidebar.explore.closeAllEditors": "关闭所有编辑器", "sidebar.explore.folders": "文件夹", - "sidebar.explore.title": "浏览", - "sidebar.explore.openEditor": "打开的编辑器", "sidebar.explore.openEditor.group": "第 ${i} 组", + "sidebar.explore.openEditor": "打开的编辑器", + "sidebar.explore.openFolder": "打开文件夹", "sidebar.explore.outline": "轮廓", - "sidebar.search.title": "搜索", - "sidebar.replace.placement": "替换", + "sidebar.explore.outlineMore": "更多操作...", "sidebar.explore.refresh": "刷新浏览", - "sidebar.explore.collapseFolders": "折叠文件夹", + "sidebar.explore.saveALL": "全部保存", + "sidebar.explore.title": "浏览", "sidebar.explore.toggleVertical": "切换垂直", - "sidebar.explore.saveAll": "全部保存", - "sidebar.explore.actionDesc": "视图和更多操作...", - "sidebar.explore.outlineMore": "更多操作...", - "toolbar.refresh": "刷新", + "sidebar.replace.placement": "替换", + "sidebar.search.placeHolder": "搜索", + "sidebar.search.replace.placeHolder": "替换", + "sidebar.search.title": "搜索", "toolbar.clearAll": "清除所有", "toolbar.collapseAll": "折叠所有", - "search.matchCase": "区分大小写", - "search.matchWholeWord": "匹配整个字词", - "search.useRegularExpression": "使用正则表达式", - "search.preserveCase": "保留大小写", - "search.replaceAll": "全部替换", - "panel.output.title": "输出", - "panel.problems.title": "问题", - "panel.problems.empty": "未在工作区检测到问题", - "panel.toolbox.closePanel": "关闭面板", - "panel.toolbox.maximize": "最大化面板", - "panel.toolbox.restoreSize": "恢复面板大小", - "notification.title": "通知", - "notification.title.no": "没有新通知", - "editor.closeToRight": "关闭右边", - "editor.closeToLeft": "关闭左边", - "editor.closeAll": "关闭所有", - "editor.closeOthers": "关闭其他", - "editor.closeSaved": "关闭已保存", - "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": "下载..." + "toolbar.refresh": "刷新" } } diff --git a/src/i18n/localization.ts b/src/i18n/localization.ts index ebe4dba39..1d05008ab 100644 --- a/src/i18n/localization.ts +++ b/src/i18n/localization.ts @@ -10,79 +10,94 @@ export enum LocalizationEvent { } export type LocaleSourceIdType = { - 'menu.file': string; - 'menu.settings': string; + 'contextmenu.addFolderToSpace': string; + 'contextmenu.delete': string; + 'contextmenu.download': string; + 'contextmenu.findInSpace': string; + 'contextmenu.newFile': string; + 'contextmenu.newFolder': string; + 'contextmenu.openToTheSide': string; + 'contextmenu.removeFolder': string; + 'contextmenu.rename': string; + 'editor.actions.splitRight': string; + 'editor.close': string; + 'editor.closeAll': string; + 'editor.closeOthers': string; + 'editor.closeSaved': string; + 'editor.closeToLeft': string; + 'editor.closeToRight': string; + 'editor.showOpenEditors': string; + 'menu.appearance': string; 'menu.colorTheme': string; + 'menu.commandPalette': string; + 'menu.copyLineUp': string; + 'menu.edit': string; + 'menu.file': string; + 'menu.help': string; + 'menu.menuBarHorizontal': string; + 'menu.menuBarVertical': string; 'menu.newFile': string; 'menu.newFolder': string; 'menu.open': string; - 'menu.edit': string; - 'menu.undo': string; + 'menu.openView': string; 'menu.redo': string; - 'menu.selection': string; + 'menu.run': string; 'menu.selectAll': string; - 'menu.copyLineUp': string; - 'menu.view': string; - 'menu.commandPalette': string; - 'menu.openView': string; - 'menu.appearance': string; + 'menu.selection': string; + 'menu.settings': string; + 'menu.showActivityBar': string; 'menu.showMenuBar': string; - 'menu.showSideBar': string; + 'menu.showPanel.title': string; + 'menu.showPanel': string; 'menu.showSideBar.label': string; + 'menu.showSideBar': string; 'menu.showStatusBar': string; - 'menu.showActivityBar': string; - 'menu.showPanel': string; - 'menu.showPanel.title': string; - 'menu.run': string; - 'menu.help': string; - 'menu.menuBarHorizontal': string; - 'menu.menuBarVertical': string; - 'sidebar.explore.title': string; + 'menu.undo': string; + 'menu.view': string; + menubar: string; + 'message.noResult': string; + 'message.noFolderButEditorsHelp': string; + 'message.searchMaxResultsWarning': string; + 'notification.clear': string; + 'notification.clearAll': string; + 'notification.hideAll': string; + 'notification.title.no': string; + 'notification.title': string; + 'panel.output.title': string; + 'panel.problems.empty': string; + 'panel.problems.title': string; + 'panel.toolbox.closePanel': string; + 'panel.toolbox.maximize': string; + 'panel.toolbox.restoreSize': string; + 'search.matchCase': string; + 'search.matchWholeWord': string; + 'search.preserveCase': string; + 'search.replaceAll': string; + 'search.toolbar.refresh': string; + 'search.toolbar.clearAll': string; + 'search.toolbar.collapseAll': string; + 'search.useRegularExpression': string; + 'searchView.noResultsFound': string; + 'sidebar.explore.actionDesc': string; + 'sidebar.explore.closeAllEditors': string; + 'sidebar.explore.collapseFolders': string; 'sidebar.explore.folders': string; - 'sidebar.explore.openEditor': string; 'sidebar.explore.openEditor.group': string; + 'sidebar.explore.openEditor': string; + 'sidebar.explore.openFolder': string; 'sidebar.explore.outline': string; - 'sidebar.search.title': string; - 'sidebar.replace.placement': string; + 'sidebar.explore.outlineMore': string; 'sidebar.explore.refresh': string; - 'sidebar.explore.collapseFolders': string; + 'sidebar.explore.saveALL': string; + 'sidebar.explore.title': string; 'sidebar.explore.toggleVertical': string; - 'sidebar.explore.saveAll': string; - 'sidebar.explore.actionDesc': string; - 'sidebar.explore.outlineMore': string; - 'toolbar.refresh': string; + 'sidebar.replace.placement': string; + 'sidebar.search.title': string; + 'sidebar.search.placeHolder': string; + 'sidebar.search.replace.placeHolder': string; 'toolbar.clearAll': string; 'toolbar.collapseAll': string; - 'search.matchCase': string; - 'search.matchWholeWord': string; - 'search.useRegularExpression': string; - 'search.preserveCase': string; - 'search.replaceAll': string; - 'panel.output.title': string; - 'panel.toolbox.closePanel': string; - 'panel.toolbox.maximize': string; - 'panel.toolbox.restoreSize': string; - 'panel.problems.title': string; - 'panel.problems.empty': string; - 'notification.title': string; - 'notification.title.no': string; - 'editor.closeToRight': string; - 'editor.closeToLeft': string; - 'editor.closeAll': string; - 'editor.closeSaved': string; - 'editor.closeOthers': string; - 'editor.close': string; - 'editor.actions.splitRight': string; - 'editor.showOpenEditors': string; - 'contextmenu.rename': string; - 'contextmenu.delete': string; - 'contextmenu.newFile': string; - 'contextmenu.newFolder': string; - 'contextmenu.removeFolder': string; - 'contextmenu.openToTheSide': string; - 'contextmenu.addFolderToSpace': string; - 'contextmenu.findInSpace': string; - 'contextmenu.download': string; + 'toolbar.refresh': string; }; export interface ILocale { diff --git a/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap b/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap index 77923be8f..4d123567e 100644 --- a/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap +++ b/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap @@ -896,12 +896,12 @@ dmlldzJfOV8xNjM4ODQ4MDI1NDI2MTE4Ml8zOF9bMF0TNSl1AAAAAElFTkSuQmCC" } } > - you have not yet opened a folder + You have not yet opened a folder. - Add Folder + Open Folder
diff --git a/src/services/builtinService/const.ts b/src/services/builtinService/const.ts index 11452cb67..4bac69e09 100644 --- a/src/services/builtinService/const.ts +++ b/src/services/builtinService/const.ts @@ -46,8 +46,8 @@ export const constants = { SETTING_ID: 'Setting', PROBLEM_MODEL_ID: 'MO_PROBLEMS', PROBLEM_MODEL_NAME: 'Problems', - NOTIFICATION_CLEAR_ALL_ID: 'ClearAll', - NOTIFICATION_HIDE_ID: 'HideNotifications', + NOTIFICATION_CLEAR_ALL_ID: 'notification.clearAll', + NOTIFICATION_HIDE_ID: 'notification.hideAll', NOTIFICATION_MODEL_ID: 'MO_NOTIFICATION', NOTIFICATION_MODEL_NAME: 'Notification', STATUS_BAR_HIDE_ID: 'hide', @@ -362,14 +362,20 @@ export const modules = { NOTIFICATION_CLEAR_ALL: () => ({ id: constants.NOTIFICATION_CLEAR_ALL_ID, - title: 'Clear All Notifications', + title: localize( + constants.NOTIFICATION_CLEAR_ALL_ID, + 'Clear All Notifications' + ), icon: 'clear-all', } as IActionBarItemProps), NOTIFICATION_HIDE: () => ({ id: constants.NOTIFICATION_HIDE_ID, - title: 'Hide Notifications', + title: localize( + constants.NOTIFICATION_HIDE_ID, + 'Hide Notifications' + ), icon: 'chevron-down', } as IActionBarItemProps), diff --git a/src/workbench/notification/notificationPane/index.tsx b/src/workbench/notification/notificationPane/index.tsx index a78aeea9f..4724b58d5 100644 --- a/src/workbench/notification/notificationPane/index.tsx +++ b/src/workbench/notification/notificationPane/index.tsx @@ -61,7 +61,10 @@ export function NotificationPane( ? item.render(item) : item.value} onCloseNotification?.(item)} className={notificationCloseClassName} type="close" diff --git a/src/workbench/sidebar/__tests__/folderTree.test.tsx b/src/workbench/sidebar/__tests__/folderTree.test.tsx index 83718a3ac..47cbb323e 100644 --- a/src/workbench/sidebar/__tests__/folderTree.test.tsx +++ b/src/workbench/sidebar/__tests__/folderTree.test.tsx @@ -62,9 +62,9 @@ describe('The FolderTree Component', () => { ); const wrapper = container.querySelector('div[data-content="test"]'); - expect(wrapper?.innerHTML).toContain( - 'you have not yet opened a folder' - ); + // expect(wrapper?.innerHTML).toContain( + // 'you have not yet opened a folder' + // ); fireEvent.click(wrapper?.querySelector('a')!); diff --git a/src/workbench/sidebar/explore/folderTree.tsx b/src/workbench/sidebar/explore/folderTree.tsx index 0a92698db..d5ad03b14 100644 --- a/src/workbench/sidebar/explore/folderTree.tsx +++ b/src/workbench/sidebar/explore/folderTree.tsx @@ -16,6 +16,7 @@ import { import { classNames } from 'mo/common/className'; import { Scrollable } from 'mo/components'; import { ICollapseItem } from 'mo/components/collapse'; +import { localize } from 'mo/i18n/localize'; export interface IFolderTreeProps extends IFolderTreeController, IFolderTree { panel: ICollapseItem; @@ -93,8 +94,13 @@ const FolderTree: React.FunctionComponent = (props) => { <>{entry} ) : (
- you have not yet opened a folder - + {localize( + 'message.noFolderButEditorsHelp', + 'You have not yet opened a folder.' + )} +
)} diff --git a/src/workbench/sidebar/search/searchPanel.tsx b/src/workbench/sidebar/search/searchPanel.tsx index 06de11c9f..59ebc6cce 100644 --- a/src/workbench/sidebar/search/searchPanel.tsx +++ b/src/workbench/sidebar/search/searchPanel.tsx @@ -125,7 +125,10 @@ const SearchPanel = ({ /> {value && result.length === 0 ? (
- 未找到结果,请重新修改您的搜索条件 + {localize( + 'searchView.noResultsFound', + 'No results found. Review your settings for configured exclusions and check your gitignore files - ' + )}
) : (

Select a localization language:

{this.renderLocales()} - {localize('test.id', 'aaaa')}

Add a new Panel:

From 760af10f0e3763cbdbe1ec8261e496b2191a8014 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Sun, 2 Jan 2022 11:26:13 +0900 Subject: [PATCH 09/12] feat: sort the order of language packs in English and terminology not translated in Workbench --- README-zhCN.md | 2 +- src/components/search/index.tsx | 8 +- .../locales-defaults/locales/en.json | 138 ++++++++++-------- .../locales-defaults/locales/ko-KR.json | 138 ++++++++++-------- .../locales-defaults/locales/zh-CN.json | 138 ++++++++++-------- src/i18n/localization.ts | 129 ++++++++-------- .../__snapshots__/molecule.test.tsx.snap | 4 +- src/services/builtinService/const.ts | 14 +- .../notification/notificationPane/index.tsx | 5 +- .../sidebar/__tests__/folderTree.test.tsx | 6 +- src/workbench/sidebar/explore/folderTree.tsx | 10 +- src/workbench/sidebar/search/searchPanel.tsx | 5 +- stories/extensions/test/index.tsx | 7 +- stories/extensions/test/testPane.tsx | 2 - 14 files changed, 343 insertions(+), 263 deletions(-) diff --git a/README-zhCN.md b/README-zhCN.md index 7dfe52b91..4e3c104e9 100644 --- a/README-zhCN.md +++ b/README-zhCN.md @@ -29,7 +29,7 @@ Molecule 是一款受 **VSCode** 启发,使用 **React.js** 构建的 **Web ID - 基本兼容 Visual Studio Code 的 **ColorTheme** - 支持使用 React 组件自定义 **Workbench** UI 样式 - 内置 Monaco Editor **Command Palette**、**Keybinding**等模块,并支持扩展 -- 支持 **i18n**,簡体字中国語、英制、朝鲜语 3 种语言 +- 支持 **i18n**,简体中文、English 、한국어 3 种语言 - 内置一个简单的 **Settings** 模块,支持在线编辑修改以及扩展 - 内置默认的 **Explorer**, **Search** 等组件,并支持扩展 - Typescript 支持 diff --git a/src/components/search/index.tsx b/src/components/search/index.tsx index 5b47f9ff2..bd7d9bd8c 100644 --- a/src/components/search/index.tsx +++ b/src/components/search/index.tsx @@ -11,6 +11,7 @@ import { searchTargetContainerClassName, } from './base'; import { Icon } from '../icon'; +import { localize } from 'mo/i18n/localize'; export type SearchValues = (string | undefined)[]; @@ -52,8 +53,11 @@ export function Search(props: ISearchProps) { } = props; const [ - searchPlaceholder = 'Search', - replacePlaceholder = 'Replace', + searchPlaceholder = localize('sidebar.search.placeHolder', 'Search'), + replacePlaceholder = localize( + 'sidebar.search.replace.placeHolder', + 'Replace' + ), ] = placeholders; const [searchAddons, replaceAddons] = addons; diff --git a/src/extensions/locales-defaults/locales/en.json b/src/extensions/locales-defaults/locales/en.json index c8e69d80d..2bb694bcf 100644 --- a/src/extensions/locales-defaults/locales/en.json +++ b/src/extensions/locales-defaults/locales/en.json @@ -3,84 +3,98 @@ "name": "English", "source": { "molecule.welcome": "Welcome to Molecule", - "menubar": "Menu Bar", - "menu.file": "File", - "menu.settings": "Settings", + "contextmenu.addFolderToSpace": "Add Folder to Workspace...", + "contextmenu.delete": "Delete", + "contextmenu.download": "Download...", + "contextmenu.findInSpace": "Find in Workspace...", + "contextmenu.newFile": "New File", + "contextmenu.newFolder": "New Folder", + "contextmenu.openToTheSide": "Open to the Side", + "contextmenu.removeFolder": "Remove Folder", + "contextmenu.rename": "Rename", + "editor.actions.splitRight": "Split Editor Right", + "editor.close": "Close", + "editor.closeAll": "Close All", + "editor.closeOthers": "Close Others", + "editor.closeSaved": "Close Saved", + "editor.closeToLeft": "Close To Left", + "editor.closeToRight": "Close To Right", + "editor.showOpenEditors": "Show Opened Editors", + "menu.about": "About", "menu.account": "Account", + "menu.appearance": "Appearance", "menu.colorTheme": "Color Theme", + "menu.commandPalette": "Command Palette", + "menu.copyLineUp": "Copy Line Up", + "menu.defaultProjectName": "Default Project Name", + "menu.edit": "Edit", + "menu.file": "File", + "menu.help": "Help", + "menu.hideActivityBar": "Hide Activity Bar", + "menu.menuBarHorizontal": "Menu Bar Horizontal Mode", + "menu.menuBarVertical": "Menu Bar Vertical Mode", "menu.newFile": "New File", "menu.newFolder": "New Folder", "menu.open": "Open", - "menu.edit": "Edit", - "menu.undo": "Undo", + "menu.openView": "Open View", "menu.redo": "Redo", - "menu.selection": "Selection", + "menu.run": "Run", + "menu.runTask": "Run Task", "menu.selectAll": "Select All", - "menu.copyLineUp": "Copy Line Up", - "menu.view": "View", - "menu.commandPalette": "Command Palette", - "menu.openView": "Open View", - "menu.appearance": "Appearance", + "menu.selection": "Selection", + "menu.settings": "Settings", + "menu.showActivityBar": "Show Activity Bar", "menu.showMenuBar": "Show Menu Bar", - "menu.showSideBar": "Show Side bar", + "menu.showPanel.title": "Toggle Panel", + "menu.showPanel": "Show Panel", "menu.showSideBar.label": "Toggle Side Bar Visibility", + "menu.showSideBar": "Show Side bar", "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", + "menu.undo": "Undo", + "menu.view": "View", + "menubar": "Menu Bar", + "message.noResult": "No results found.", + "message.noFolderButEditorsHelp": "You have not yet opened a folder.", + "message.searchMaxResultsWarning": "The result set only contains a subset of all matches. Be more specific in your search to narrow down the results.", + "notification.clear": "Clear Notification", + "notification.clearAll": "Clear All Notifications", + "notification.hideAll": "Hide Notifications", + "notification.title.no": "No new notifications", + "notification.title": "Notifications", + "panel.output.title": "output", + "panel.problems.empty": "No problems have been detected in the workspace.", + "panel.problems.title": "Problems", + "panel.toolbox.closePanel": "Close Panel", + "panel.toolbox.maximize": "Maximize Panel Size", + "panel.toolbox.restoreSize": "Restore Panel Size", + "search.matchCase": "Match Case", + "search.matchWholeWord": "Match Whole Word", + "search.preserveCase": "Preserve Case", + "search.toolbar.refresh": "Refresh", + "search.toolbar.clearAll": "Clear all", + "search.toolbar.collapseAll": "Collapse all", + "search.replaceAll": "Replace All", + "search.useRegularExpression": "Use Regular Expression", + "searchView.noResultsFound": "No results found. Review your settings for configured exclusions and check your gitignore files - ", + "sidebar.explore.actionDesc": "View and More Actions...", + "sidebar.explore.collapseFolders": "Collapse Folders in Explorer", + "sidebar.explore.closeAllEditors": "Close All Editors", "sidebar.explore.folders": "Folders", - "sidebar.explore.title": "Explorer", - "sidebar.explore.openEditor": "Open Editors", "sidebar.explore.openEditor.group": "Group ${i}", + "sidebar.explore.openEditor": "Open Editors", + "sidebar.explore.openFolder": "Open Folder", "sidebar.explore.outline": "Outline", - "sidebar.search.title": "Search", - "sidebar.replace.placement": "Replace", + "sidebar.explore.outlineMore": "More Actions...", "sidebar.explore.refresh": "Refresh Explorer", - "sidebar.explore.collapseFolders": "Collapse Folders in Explorer", + "sidebar.explore.saveALL": "Save All", + "sidebar.explore.title": "Explorer", "sidebar.explore.toggleVertical": "Toggle Vertical", - "sidebar.explore.saveAll": "Save All", - "sidebar.explore.actionDesc": "View and More Actions...", - "sidebar.explore.outlineMore": "More Actions...", - "toolbar.refresh": "Refresh", + "sidebar.replace.placement": "Replace", + "sidebar.search.placeHolder": "Search", + "sidebar.search.replace.placeHolder": "Replace", + "sidebar.search.title": "Search", "toolbar.clearAll": "Clear all", "toolbar.collapseAll": "Collapse all", - "search.matchCase": "Match Case", - "search.matchWholeWord": "Match Whole Word", - "search.useRegularExpression": "Use Regular Expression", - "search.preserveCase": "Preserve Case", - "search.replaceAll": "Replace All", - "panel.output.title": "output", - "panel.toolbox.closePanel": "Close Panel", - "panel.toolbox.maximize": "Maximize Panel Size", - "panel.toolbox.restoreSize": "Restore Panel Size", - "panel.problems.title": "Problems", - "panel.problems.empty": "No problems have been detected in the workspace.", - "notification.title": "Notifications", - "notification.title.no": "No new notifications", - "editor.closeToRight": "Close To Right", - "editor.closeToLeft": "Close To Left", - "editor.closeAll": "Close All", - "editor.closeSaved": "Close Saved", - "editor.closeOthers": "Close Others", - "editor.close": "Close", - "editor.actions.splitRight": "Split Editor Right", - "editor.showOpenEditors": "Show Opened Editors", - "contextmenu.rename": "Rename", - "contextmenu.delete": "Delete", - "contextmenu.newFile": "New File", - "contextmenu.newFolder": "New Folder", - "contextmenu.removeFolder": "Remove Folder", - "contextmenu.openToTheSide": "Open to the Side", - "contextmenu.addFolderToSpace": "Add Folder to Workspace...", - "contextmenu.findInSpace": "Find in Workspace...", - "contextmenu.download": "Download..." + "toolbar.refresh": "Refresh" } } diff --git a/src/extensions/locales-defaults/locales/ko-KR.json b/src/extensions/locales-defaults/locales/ko-KR.json index b2ae36ecc..b69a5beed 100644 --- a/src/extensions/locales-defaults/locales/ko-KR.json +++ b/src/extensions/locales-defaults/locales/ko-KR.json @@ -3,84 +3,98 @@ "name": "한국어", "source": { "molecule.welcome": "Molecule에 오신 것을 환영합니다", - "menubar": "메뉴 모음", - "menu.file": "파일", - "menu.settings": "설정", + "contextmenu.addFolderToSpace": "작업 영역에 폴더 추가...", + "contextmenu.delete": "삭제", + "contextmenu.download": "다운로드...", + "contextmenu.findInSpace": "작업 영역에서 찾기...", + "contextmenu.newFile": "새 파일", + "contextmenu.newFolder": "새 폴더", + "contextmenu.openToTheSide": "사이드에 열기", + "contextmenu.removeFolder": "폴더 삭제", + "contextmenu.rename": "이름 바꾸기", + "editor.actions.splitRight": "오른쪽으로 분할", + "editor.close": "닫기", + "editor.closeAll": "모두 닫기", + "editor.closeOthers": "기타 항목 닫기", + "editor.closeSaved": "저장된 항목 닫기", + "editor.closeToLeft": "왼쪽에 있는 항목 닫기", + "editor.closeToRight": "오른쪽에 있는 항목 닫기", + "editor.showOpenEditors": "열려 있는 편집기 표시", + "menu.about": "정보", "menu.account": "계정", + "menu.appearance": "모양", "menu.colorTheme": "색 테마", + "menu.commandPalette": "명령어 팔레트", + "menu.copyLineUp": "위에 줄 복사", + "menu.defaultProjectName": "기본 프로젝트 이름", + "menu.edit": "편집", + "menu.file": "파일", + "menu.help": "도움말", + "menu.hideActivityBar": "작업 막대 숨기기", + "menu.menuBarHorizontal": "메뉴 모음 가로 모드", + "menu.menuBarVertical": "메뉴 모음 새로 모드", "menu.newFile": "새 파일", "menu.newFolder": "새 폴더", "menu.open": "열기", - "menu.edit": "편집", - "menu.undo": "되돌리기", + "menu.openView": "뷰 열기", "menu.redo": "다시 실행", - "menu.selection": "선택", + "menu.run": "실행", + "menu.runTask": "작업 실행", "menu.selectAll": "모두 선택", - "menu.copyLineUp": "위에 줄 복사", - "menu.view": "보기", - "menu.commandPalette": "명령어 팔레트", - "menu.openView": "뷰 열기", - "menu.appearance": "모양", + "menu.selection": "선택", + "menu.settings": "설정", + "menu.showActivityBar": "작업 막대 표시", "menu.showMenuBar": "메뉴 모음 표시", - "menu.showSideBar": "사이드 모음 표시", + "menu.showPanel.title": "패널 토글", + "menu.showPanel": "패널 표시", "menu.showSideBar.label": "사이드 모음 표시 유형 토글", + "menu.showSideBar": "사이드 모음 표시", "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": "메뉴 모음 새로 모드", + "menu.undo": "되돌리기", + "menu.view": "보기", + "menubar": "메뉴 모음", + "message.noResult": "결과가 없습니다.", + "message.noFolderButEditorsHelp": "아직 폴더를 열지 않았습니다", + "message.searchMaxResultsWarning": "결과 집합에는 모든 일치 항목의 하위 집합만 포함됩니다. 결과 범위를 좁히려면 검색을 더 세분화하세요.", + "notification.clear": "알림 지우기", + "notification.clearAll": "모든 알림 지우기", + "notification.hideAll": "알림 숨기기", + "notification.title.no": "새로운 알림이 없습니다.", + "notification.title": "알림", + "panel.output.title": "출력", + "panel.problems.empty": "작업 영역안에는 문제가 감지되지 않았습니다.", + "panel.problems.title": "문제", + "panel.toolbox.closePanel": "패널 닫기", + "panel.toolbox.maximize": "패널 크기 최대화", + "panel.toolbox.restoreSize": "패널 크기 복원", + "search.matchCase": "대/소문자 구분", + "search.matchWholeWord": "전체 단어 일치", + "search.preserveCase": "대/소문자 보존", + "search.toolbar.refresh": "새로 고침", + "search.toolbar.clearAll": "모두 지우기", + "search.toolbar.collapseAll": "모두 축소", + "search.replaceAll": "모두 바꾸기", + "search.useRegularExpression": "정규식 사용", + "searchView.noResultsFound": "결과가 없습니다. 구성된 제외에 대한 설정을 검토하고 gitignore 파일을 확인하세요. - ", + "sidebar.explore.actionDesc": "보기 및 더 기타 작업...", + "sidebar.explore.closeAllEditors": "모든 편집기 닫기", + "sidebar.explore.collapseFolders": "탐색기 내에 폴더 축소", "sidebar.explore.folders": "폴더", - "sidebar.explore.title": "탐색기", - "sidebar.explore.openEditor": "편집기 열기", "sidebar.explore.openEditor.group": "${i} 그룹", + "sidebar.explore.openEditor": "편집기 열기", + "sidebar.explore.openFolder": "폴더 열기", "sidebar.explore.outline": "개요", - "sidebar.search.title": "검색", - "sidebar.replace.placement": "바꾸기", + "sidebar.explore.outlineMore": "더 많은 액션들...", "sidebar.explore.refresh": "탐색기 새로 고침", - "sidebar.explore.collapseFolders": "탐색기 내에 폴더 축소", + "sidebar.explore.saveALL": "모두 저장", + "sidebar.explore.title": "탐색기", "sidebar.explore.toggleVertical": "세로로 토글", - "sidebar.explore.saveAll": "모두 저장", - "sidebar.explore.actionDesc": "보기 및 더 기타 작업...", - "sidebar.explore.outlineMore": "더 많은 액션들...", - "toolbar.refresh": "새로 고침", + "sidebar.replace.placement": "바꾸기", + "sidebar.search.placeHolder": "검색", + "sidebar.search.replace.placeHolder": "바꾸기", + "sidebar.search.title": "검색", "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": "다운로드..." + "toolbar.refresh": "새로 고침" } } diff --git a/src/extensions/locales-defaults/locales/zh-CN.json b/src/extensions/locales-defaults/locales/zh-CN.json index 9eabded37..81f2f9ab4 100644 --- a/src/extensions/locales-defaults/locales/zh-CN.json +++ b/src/extensions/locales-defaults/locales/zh-CN.json @@ -3,84 +3,98 @@ "name": "简体中文", "source": { "molecule.welcome": "欢迎!", - "menubar": "菜单栏", - "menu.file": "文件", - "menu.settings": "设置", + "contextmenu.addFolderToSpace": "将文件夹添加到工作区...", + "contextmenu.delete": "删除", + "contextmenu.download": "下载...", + "contextmenu.findInSpace": "在工作区中寻找...", + "contextmenu.newFile": "新建文件", + "contextmenu.newFolder": "新建文件夹", + "contextmenu.openToTheSide": "在侧边打开", + "contextmenu.removeFolder": "删除文件夹", + "contextmenu.rename": "重命名", + "editor.actions.splitRight": "向右拆分编辑器", + "editor.close": "关闭", + "editor.closeAll": "关闭所有", + "editor.closeOthers": "关闭其他", + "editor.closeSaved": "关闭已保存", + "editor.closeToLeft": "关闭左边", + "editor.closeToRight": "关闭右边", + "editor.showOpenEditors": "展示已打开的编辑器", + "menu.about": "关于", "menu.account": "账号", + "menu.appearance": "外观", "menu.colorTheme": "颜色主题", + "menu.commandPalette": "命令面板", + "menu.copyLineUp": "向上拷贝", + "menu.defaultProjectName": "无打开文件夹", + "menu.edit": "编辑", + "menu.file": "文件", + "menu.help": "帮助", + "menu.hideActivityBar": "隐藏活动栏", + "menu.menuBarHorizontal": "菜单栏水平模式", + "menu.menuBarVertical": "菜单栏垂直模式", "menu.newFile": "新建文件", "menu.newFolder": "新建文件夹", "menu.open": "打开", - "menu.edit": "编辑", - "menu.undo": "撤销", + "menu.openView": "打开试图", "menu.redo": "重做", - "menu.selection": "选择", + "menu.run": "运行", + "menu.runTask": "运行任务", "menu.selectAll": "选择全部", - "menu.copyLineUp": "向上拷贝", - "menu.view": "视图", - "menu.commandPalette": "命令面板", - "menu.openView": "打开试图", - "menu.appearance": "外观", + "menu.selection": "选择", + "menu.settings": "设置", + "menu.showActivityBar": "显示活动栏", "menu.showMenuBar": "显示菜单栏", - "menu.showSideBar": "显示边栏", + "menu.showPanel.title": "切换面板", + "menu.showPanel": "显示面板", "menu.showSideBar.label": "切换侧边栏", + "menu.showSideBar": "显示边栏", "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": "菜单栏垂直模式", + "menu.undo": "撤销", + "menu.view": "视图", + "menubar": "菜单栏", + "message.noResult": "未找到结果。", + "message.noFolderButEditorsHelp": "尚未打开文件夹。", + "message.searchMaxResultsWarning": "结果集仅包含所有匹配项的子集。请使你的搜索更加具体以减少结果。", + "notification.clear": "清除通知", + "notification.clearAll": "清除所有通知", + "notification.hideAll": "隐藏通知", + "notification.title.no": "没有新通知", + "notification.title": "通知", + "panel.output.title": "输出", + "panel.problems.empty": "未在工作区检测到问题", + "panel.problems.title": "问题", + "panel.toolbox.closePanel": "关闭面板", + "panel.toolbox.maximize": "最大化面板", + "panel.toolbox.restoreSize": "恢复面板大小", + "search.matchCase": "区分大小写", + "search.matchWholeWord": "匹配整个字词", + "search.preserveCase": "保留大小写", + "search.toolbar.refresh": "刷新浏览", + "search.toolbar.clearAll": "清除所有", + "search.toolbar.collapseAll": "折叠所有", + "search.replaceAll": "全部替换", + "search.useRegularExpression": "使用正则表达式", + "searchView.noResultsFound": "未找到结果。查看您的设置配置排除, 并检查您的 gitignore 文件-", + "sidebar.explore.actionDesc": "视图和更多操作...", + "sidebar.explore.collapseFolders": "折叠文件夹", + "sidebar.explore.closeAllEditors": "关闭所有编辑器", "sidebar.explore.folders": "文件夹", - "sidebar.explore.title": "浏览", - "sidebar.explore.openEditor": "打开的编辑器", "sidebar.explore.openEditor.group": "第 ${i} 组", + "sidebar.explore.openEditor": "打开的编辑器", + "sidebar.explore.openFolder": "打开文件夹", "sidebar.explore.outline": "轮廓", - "sidebar.search.title": "搜索", - "sidebar.replace.placement": "替换", + "sidebar.explore.outlineMore": "更多操作...", "sidebar.explore.refresh": "刷新浏览", - "sidebar.explore.collapseFolders": "折叠文件夹", + "sidebar.explore.saveALL": "全部保存", + "sidebar.explore.title": "浏览", "sidebar.explore.toggleVertical": "切换垂直", - "sidebar.explore.saveAll": "全部保存", - "sidebar.explore.actionDesc": "视图和更多操作...", - "sidebar.explore.outlineMore": "更多操作...", - "toolbar.refresh": "刷新", + "sidebar.replace.placement": "替换", + "sidebar.search.placeHolder": "搜索", + "sidebar.search.replace.placeHolder": "替换", + "sidebar.search.title": "搜索", "toolbar.clearAll": "清除所有", "toolbar.collapseAll": "折叠所有", - "search.matchCase": "区分大小写", - "search.matchWholeWord": "匹配整个字词", - "search.useRegularExpression": "使用正则表达式", - "search.preserveCase": "保留大小写", - "search.replaceAll": "全部替换", - "panel.output.title": "输出", - "panel.problems.title": "问题", - "panel.problems.empty": "未在工作区检测到问题", - "panel.toolbox.closePanel": "关闭面板", - "panel.toolbox.maximize": "最大化面板", - "panel.toolbox.restoreSize": "恢复面板大小", - "notification.title": "通知", - "notification.title.no": "没有新通知", - "editor.closeToRight": "关闭右边", - "editor.closeToLeft": "关闭左边", - "editor.closeAll": "关闭所有", - "editor.closeOthers": "关闭其他", - "editor.closeSaved": "关闭已保存", - "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": "下载..." + "toolbar.refresh": "刷新" } } diff --git a/src/i18n/localization.ts b/src/i18n/localization.ts index ebe4dba39..1d05008ab 100644 --- a/src/i18n/localization.ts +++ b/src/i18n/localization.ts @@ -10,79 +10,94 @@ export enum LocalizationEvent { } export type LocaleSourceIdType = { - 'menu.file': string; - 'menu.settings': string; + 'contextmenu.addFolderToSpace': string; + 'contextmenu.delete': string; + 'contextmenu.download': string; + 'contextmenu.findInSpace': string; + 'contextmenu.newFile': string; + 'contextmenu.newFolder': string; + 'contextmenu.openToTheSide': string; + 'contextmenu.removeFolder': string; + 'contextmenu.rename': string; + 'editor.actions.splitRight': string; + 'editor.close': string; + 'editor.closeAll': string; + 'editor.closeOthers': string; + 'editor.closeSaved': string; + 'editor.closeToLeft': string; + 'editor.closeToRight': string; + 'editor.showOpenEditors': string; + 'menu.appearance': string; 'menu.colorTheme': string; + 'menu.commandPalette': string; + 'menu.copyLineUp': string; + 'menu.edit': string; + 'menu.file': string; + 'menu.help': string; + 'menu.menuBarHorizontal': string; + 'menu.menuBarVertical': string; 'menu.newFile': string; 'menu.newFolder': string; 'menu.open': string; - 'menu.edit': string; - 'menu.undo': string; + 'menu.openView': string; 'menu.redo': string; - 'menu.selection': string; + 'menu.run': string; 'menu.selectAll': string; - 'menu.copyLineUp': string; - 'menu.view': string; - 'menu.commandPalette': string; - 'menu.openView': string; - 'menu.appearance': string; + 'menu.selection': string; + 'menu.settings': string; + 'menu.showActivityBar': string; 'menu.showMenuBar': string; - 'menu.showSideBar': string; + 'menu.showPanel.title': string; + 'menu.showPanel': string; 'menu.showSideBar.label': string; + 'menu.showSideBar': string; 'menu.showStatusBar': string; - 'menu.showActivityBar': string; - 'menu.showPanel': string; - 'menu.showPanel.title': string; - 'menu.run': string; - 'menu.help': string; - 'menu.menuBarHorizontal': string; - 'menu.menuBarVertical': string; - 'sidebar.explore.title': string; + 'menu.undo': string; + 'menu.view': string; + menubar: string; + 'message.noResult': string; + 'message.noFolderButEditorsHelp': string; + 'message.searchMaxResultsWarning': string; + 'notification.clear': string; + 'notification.clearAll': string; + 'notification.hideAll': string; + 'notification.title.no': string; + 'notification.title': string; + 'panel.output.title': string; + 'panel.problems.empty': string; + 'panel.problems.title': string; + 'panel.toolbox.closePanel': string; + 'panel.toolbox.maximize': string; + 'panel.toolbox.restoreSize': string; + 'search.matchCase': string; + 'search.matchWholeWord': string; + 'search.preserveCase': string; + 'search.replaceAll': string; + 'search.toolbar.refresh': string; + 'search.toolbar.clearAll': string; + 'search.toolbar.collapseAll': string; + 'search.useRegularExpression': string; + 'searchView.noResultsFound': string; + 'sidebar.explore.actionDesc': string; + 'sidebar.explore.closeAllEditors': string; + 'sidebar.explore.collapseFolders': string; 'sidebar.explore.folders': string; - 'sidebar.explore.openEditor': string; 'sidebar.explore.openEditor.group': string; + 'sidebar.explore.openEditor': string; + 'sidebar.explore.openFolder': string; 'sidebar.explore.outline': string; - 'sidebar.search.title': string; - 'sidebar.replace.placement': string; + 'sidebar.explore.outlineMore': string; 'sidebar.explore.refresh': string; - 'sidebar.explore.collapseFolders': string; + 'sidebar.explore.saveALL': string; + 'sidebar.explore.title': string; 'sidebar.explore.toggleVertical': string; - 'sidebar.explore.saveAll': string; - 'sidebar.explore.actionDesc': string; - 'sidebar.explore.outlineMore': string; - 'toolbar.refresh': string; + 'sidebar.replace.placement': string; + 'sidebar.search.title': string; + 'sidebar.search.placeHolder': string; + 'sidebar.search.replace.placeHolder': string; 'toolbar.clearAll': string; 'toolbar.collapseAll': string; - 'search.matchCase': string; - 'search.matchWholeWord': string; - 'search.useRegularExpression': string; - 'search.preserveCase': string; - 'search.replaceAll': string; - 'panel.output.title': string; - 'panel.toolbox.closePanel': string; - 'panel.toolbox.maximize': string; - 'panel.toolbox.restoreSize': string; - 'panel.problems.title': string; - 'panel.problems.empty': string; - 'notification.title': string; - 'notification.title.no': string; - 'editor.closeToRight': string; - 'editor.closeToLeft': string; - 'editor.closeAll': string; - 'editor.closeSaved': string; - 'editor.closeOthers': string; - 'editor.close': string; - 'editor.actions.splitRight': string; - 'editor.showOpenEditors': string; - 'contextmenu.rename': string; - 'contextmenu.delete': string; - 'contextmenu.newFile': string; - 'contextmenu.newFolder': string; - 'contextmenu.removeFolder': string; - 'contextmenu.openToTheSide': string; - 'contextmenu.addFolderToSpace': string; - 'contextmenu.findInSpace': string; - 'contextmenu.download': string; + 'toolbar.refresh': string; }; export interface ILocale { diff --git a/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap b/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap index 77923be8f..4d123567e 100644 --- a/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap +++ b/src/provider/__tests__/__snapshots__/molecule.test.tsx.snap @@ -896,12 +896,12 @@ dmlldzJfOV8xNjM4ODQ4MDI1NDI2MTE4Ml8zOF9bMF0TNSl1AAAAAElFTkSuQmCC" } } > - you have not yet opened a folder + You have not yet opened a folder. - Add Folder + Open Folder
diff --git a/src/services/builtinService/const.ts b/src/services/builtinService/const.ts index 11452cb67..4bac69e09 100644 --- a/src/services/builtinService/const.ts +++ b/src/services/builtinService/const.ts @@ -46,8 +46,8 @@ export const constants = { SETTING_ID: 'Setting', PROBLEM_MODEL_ID: 'MO_PROBLEMS', PROBLEM_MODEL_NAME: 'Problems', - NOTIFICATION_CLEAR_ALL_ID: 'ClearAll', - NOTIFICATION_HIDE_ID: 'HideNotifications', + NOTIFICATION_CLEAR_ALL_ID: 'notification.clearAll', + NOTIFICATION_HIDE_ID: 'notification.hideAll', NOTIFICATION_MODEL_ID: 'MO_NOTIFICATION', NOTIFICATION_MODEL_NAME: 'Notification', STATUS_BAR_HIDE_ID: 'hide', @@ -362,14 +362,20 @@ export const modules = { NOTIFICATION_CLEAR_ALL: () => ({ id: constants.NOTIFICATION_CLEAR_ALL_ID, - title: 'Clear All Notifications', + title: localize( + constants.NOTIFICATION_CLEAR_ALL_ID, + 'Clear All Notifications' + ), icon: 'clear-all', } as IActionBarItemProps), NOTIFICATION_HIDE: () => ({ id: constants.NOTIFICATION_HIDE_ID, - title: 'Hide Notifications', + title: localize( + constants.NOTIFICATION_HIDE_ID, + 'Hide Notifications' + ), icon: 'chevron-down', } as IActionBarItemProps), diff --git a/src/workbench/notification/notificationPane/index.tsx b/src/workbench/notification/notificationPane/index.tsx index a78aeea9f..4724b58d5 100644 --- a/src/workbench/notification/notificationPane/index.tsx +++ b/src/workbench/notification/notificationPane/index.tsx @@ -61,7 +61,10 @@ export function NotificationPane( ? item.render(item) : item.value} onCloseNotification?.(item)} className={notificationCloseClassName} type="close" diff --git a/src/workbench/sidebar/__tests__/folderTree.test.tsx b/src/workbench/sidebar/__tests__/folderTree.test.tsx index 83718a3ac..47cbb323e 100644 --- a/src/workbench/sidebar/__tests__/folderTree.test.tsx +++ b/src/workbench/sidebar/__tests__/folderTree.test.tsx @@ -62,9 +62,9 @@ describe('The FolderTree Component', () => { ); const wrapper = container.querySelector('div[data-content="test"]'); - expect(wrapper?.innerHTML).toContain( - 'you have not yet opened a folder' - ); + // expect(wrapper?.innerHTML).toContain( + // 'you have not yet opened a folder' + // ); fireEvent.click(wrapper?.querySelector('a')!); diff --git a/src/workbench/sidebar/explore/folderTree.tsx b/src/workbench/sidebar/explore/folderTree.tsx index 0a92698db..d5ad03b14 100644 --- a/src/workbench/sidebar/explore/folderTree.tsx +++ b/src/workbench/sidebar/explore/folderTree.tsx @@ -16,6 +16,7 @@ import { import { classNames } from 'mo/common/className'; import { Scrollable } from 'mo/components'; import { ICollapseItem } from 'mo/components/collapse'; +import { localize } from 'mo/i18n/localize'; export interface IFolderTreeProps extends IFolderTreeController, IFolderTree { panel: ICollapseItem; @@ -93,8 +94,13 @@ const FolderTree: React.FunctionComponent = (props) => { <>{entry} ) : (
- you have not yet opened a folder - + {localize( + 'message.noFolderButEditorsHelp', + 'You have not yet opened a folder.' + )} +
)} diff --git a/src/workbench/sidebar/search/searchPanel.tsx b/src/workbench/sidebar/search/searchPanel.tsx index 06de11c9f..59ebc6cce 100644 --- a/src/workbench/sidebar/search/searchPanel.tsx +++ b/src/workbench/sidebar/search/searchPanel.tsx @@ -125,7 +125,10 @@ const SearchPanel = ({ /> {value && result.length === 0 ? (
- 未找到结果,请重新修改您的搜索条件 + {localize( + 'searchView.noResultsFound', + 'No results found. Review your settings for configured exclusions and check your gitignore files - ' + )}
) : (

Select a localization language:

{this.renderLocales()} - {localize('test.id', 'aaaa')}

Add a new Panel:

From 40bb25ec8978467708678cf3d70a5ea7fb66b546 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Sun, 2 Jan 2022 22:07:04 +0900 Subject: [PATCH 10/12] fix: if there are many tabs, the scrollbar will appear large --- src/components/scrollable/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scrollable/style.scss b/src/components/scrollable/style.scss index 5dce76e86..03ad09e7a 100644 --- a/src/components/scrollable/style.scss +++ b/src/components/scrollable/style.scss @@ -20,6 +20,6 @@ $react-custom-scrollbars: '.ScrollbarsCustom'; &-Scroller, &-Content, &-Wrapper { - height: 100%; + //height: 100%; } } From d7f266fd2a006231d42d053820389f8090d0f1f9 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Sun, 2 Jan 2022 22:13:29 +0900 Subject: [PATCH 11/12] fix: the shortcut key is WordWrap in the welcome page --- src/workbench/editor/welcome/style.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/workbench/editor/welcome/style.scss b/src/workbench/editor/welcome/style.scss index c8b6d8a7e..0c5198ce1 100644 --- a/src/workbench/editor/welcome/style.scss +++ b/src/workbench/editor/welcome/style.scss @@ -57,7 +57,7 @@ $border-color: rgba(115, 115, 115, 0.4); .keys { display: grid; grid-gap: 32px; - grid-template-columns: 1fr minmax(47px, min-content); + grid-template-columns: 1fr minmax(47px, max-content); text-align: left; } } From a3b41703710b39a55ed6b8dcc8c9b7ae2cdb9897 Mon Sep 17 00:00:00 2001 From: Benjamin Yang Date: Sun, 2 Jan 2022 22:33:46 +0900 Subject: [PATCH 12/12] feat: increase the readability of small samples in the Workbench of the Storybook #591 --- .../localeNotification.test.tsx.snap | 68 +++++++++++-------- .../notificationPane/localeNotification.tsx | 42 +++++++----- src/workbench/notification/style.scss | 3 + stories/extensions/test/testPane.tsx | 40 ++++++----- 4 files changed, 89 insertions(+), 64 deletions(-) diff --git a/src/workbench/notification/__tests__/__snapshots__/localeNotification.test.tsx.snap b/src/workbench/notification/__tests__/__snapshots__/localeNotification.test.tsx.snap index b7dc1f770..3a32c84e7 100644 --- a/src/workbench/notification/__tests__/__snapshots__/localeNotification.test.tsx.snap +++ b/src/workbench/notification/__tests__/__snapshots__/localeNotification.test.tsx.snap @@ -1,39 +1,51 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`The LocaleNotification Component Match Snapshot 1`] = ` -
-

- The current locale has changed to - chinese - , click the button to reload the Page and applying the changes. -

-

+

- Notice: Reload the Page could lose the data, Please confirm you have saved before. -

- + The current locale has changed to + chinese + , click the button to reload the Page and applying the changes. +

+

- Confirm Reload - + > + Notice: Reload the Page could lose the data, Please confirm you have saved before. +

+
+
`; diff --git a/src/workbench/notification/notificationPane/localeNotification.tsx b/src/workbench/notification/notificationPane/localeNotification.tsx index 31ec8e425..8fa75c1f2 100644 --- a/src/workbench/notification/notificationPane/localeNotification.tsx +++ b/src/workbench/notification/notificationPane/localeNotification.tsx @@ -13,24 +13,30 @@ export function LocaleNotification(props: ILocaleNotificationProps) { }, []); return ( -
-

- The current locale has changed to {locale}, click the button to - reload the Page and applying the changes. -

-

- Notice: Reload the Page could lose the data, Please confirm you - have saved before. -

- +
+
+

+ The current locale has changed to {locale}, click the button + to reload the Page and applying the changes. +

+

+ Notice: Reload the Page could lose the data, Please confirm + you have saved before. +

+
+
+

+ +

+
); } diff --git a/src/workbench/notification/style.scss b/src/workbench/notification/style.scss index 629aca276..4589b1ceb 100644 --- a/src/workbench/notification/style.scss +++ b/src/workbench/notification/style.scss @@ -10,6 +10,7 @@ $icon-size: 22px; position: fixed; right: 8px; z-index: 1000; + padding: 0 0 5px; &__header { align-items: center; @@ -41,11 +42,13 @@ $icon-size: 22px; overflow-y: auto; padding: 0 8px; position: relative; + direction: ltr; > div { padding-right: 30px; position: relative; text-align: left; + line-height: 1.5; } } diff --git a/stories/extensions/test/testPane.tsx b/stories/extensions/test/testPane.tsx index 4a1b99da3..0b6ce2b6a 100644 --- a/stories/extensions/test/testPane.tsx +++ b/stories/extensions/test/testPane.tsx @@ -86,7 +86,7 @@ export default class TestPane extends React.Component { molecule.statusBar.add( { id: globalTempId, - name: 'test' + globalTempId, + name: 'StatusBar-' + globalTempId, sortIndex: 2, }, Float.right @@ -109,7 +109,7 @@ export default class TestPane extends React.Component { const id = Math.random() * 10 + 1; molecule.panel.open({ id: 'Pane' + id, - name: 'Panel' + id, + name: 'Panel-' + id, closable: true, renderPane: () =>

Test Pane

, }); @@ -168,7 +168,8 @@ export default class TestPane extends React.Component { name: `editor${key}.ts`, icon: Math.random() >= 0.5 ? 'selection' : undefined, data: { - value: `${key}export interface Type { new(...args: any[]): T;} + value: `// editor${key} +export interface Type { new(...args: any[]): T;} export type GenericClassDecorator = (target: T) => void;`, path: 'desktop/molecule/editor1', language: 'typescript', @@ -239,7 +240,7 @@ export type GenericClassDecorator = (target: T) => void;`, molecule.menuBar.append( { id: id + '', - name: 'menuBar' + id, + name: 'MenuBar-' + id, icon: '', }, 'Edit' @@ -269,7 +270,7 @@ export type GenericClassDecorator = (target: T) => void;`, const panels = [ { id: `Panel-${id}`, - name: 'Panel-' + id, + name: 'Sample-Panel-' + id, toolbar: [ { icon: 'remove', @@ -287,28 +288,31 @@ export type GenericClassDecorator = (target: T) => void;`, (_, index) => new TreeNodeModel({ id: index, - name: `test_sql_${index}.txt`, + name: `test_sql_${index}.sql`, fileType: FileTypes.File, isLeaf: true, - content: `show tables; + content: `SHOW TABLES; + SELECT 1; + DESC 6d_target_test; -create table if not exists ods_order_header1213 ( -order_header_id string comment '订单头id' -,order_date bigint comment '订单日期' -,shop_id string comment '店铺id' -,customer_id string comment '客户id' -,order_status bigint comment '订单状态' -,pay_date bigint comment '支付日期' -)comment '销售订单明细表' -PARTITIONED BY (ds string) lifecycle 1000; + +CREATE TABLE IF NOT EXISTS ods_order_header1213 ( +order_header_id STRING COMMENT '订单头id', +order_date STRING COMMENT '订单日期', +shop_id STRING COMMENT '店铺id', +customer_id STRING COMMENT '客户id', +order_status BIGINT COMMENT '订单状态', +pay_date BIGINT COMMENT '支付日期' +) COMMENT '销售订单明细表' +PARTITIONED BY (DE STRING) LIFECYCLE 1000; `, }) ); molecule.folderTree.add( new TreeNodeModel({ id: randomId(), - name: 'molecule_temp', + name: 'Sample SQLs', fileType: FileTypes.RootFolder, children, }) @@ -367,7 +371,7 @@ PARTITIONED BY (ds string) lifecycle 1000;
-
+

StatusBar:

Add a StatusBar