Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/extensions/locales-defaults/index.ts
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
8 changes: 7 additions & 1 deletion src/extensions/locales-defaults/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": "Explorer",
"sidebar.explore.openEditor": "Open Editors",
"sidebar.explore.openEditor.group": "Group ${i}",
"sidebar.explore.outline": "Outline",
Expand Down
86 changes: 86 additions & 0 deletions src/extensions/locales-defaults/locales/ko-KR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"id": "ko-KR",
"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.folders": "폴더",
"sidebar.explore.title": "탐색기",
"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": "다운로드..."
}
}
16 changes: 12 additions & 4 deletions src/extensions/locales-defaults/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "未在工作区检测到问题",
Expand Down
14 changes: 7 additions & 7 deletions src/i18n/__tests__/localeService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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
Expand All @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ exports[`Test MoleculeProvider Match The MoleculeProvider snapshot 1`] = `
<span
className="mo-collapse__header__title"
>
No Open Folder
Default Project Name
</span>
<div
className="mo-collapse__extra"
Expand Down