Skip to content

Commit 385d23a

Browse files
committed
chore: add i18n and fix ci path problem
1 parent 430c44d commit 385d23a

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

packages/i18n/src/common/en-US.lang.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,7 @@ export const localizationBundle = {
13261326
'main-layout.bottom-panel.toggle': 'Toggle Bottom Side Bar',
13271327
'main-layout.bottom-panel.show': 'Show Bottom Side Bar',
13281328
'main-layout.bottom-panel.hide': 'Hide Bottom Side Bar',
1329+
'main-layout.drop-area.tip': 'drop here',
13291330

13301331
'refactor-preview.title': 'REFACTOR PREVIEW',
13311332
'refactor-preview.title.clear': 'Discard Refactoring',

packages/i18n/src/common/zh-CN.lang.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ export const localizationBundle = {
924924
'main-layout.bottom-panel.toggle': '切换底部面板',
925925
'main-layout.bottom-panel.show': '显示底部面板',
926926
'main-layout.bottom-panel.hide': '隐藏底部面板',
927+
'main-layout.drop-area.tip': '放置此处',
927928

928929
'refactor-preview.title': '重构预览',
929930
'refactor-preview.title.clear': '放弃重构',

packages/main-layout/src/browser/drop-area/drop-area.tsx

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
22

3-
import { useInjectable } from '@opensumi/ide-core-browser';
4-
import { IMainLayoutService } from '@opensumi/ide-main-layout';
3+
import { localize, useInjectable } from '@opensumi/ide-core-browser';
4+
5+
import { IMainLayoutService } from '../../common';
56

67
import styles from './styles.module.less';
78

@@ -13,18 +14,23 @@ const DropArea: React.FC<IDropAreaProps> = (props) => {
1314
const { location } = props;
1415
const layoutService = useInjectable<IMainLayoutService>(IMainLayoutService);
1516

17+
const handleDrop = React.useCallback(
18+
(e: React.DragEvent) => {
19+
const containerId = e.dataTransfer?.getData('containerId');
20+
layoutService.moveContainerTo(containerId, location);
21+
},
22+
[layoutService, location],
23+
);
24+
1625
return (
1726
<div
1827
className={styles.drop_area}
19-
onDrop={(e) => {
20-
const containerId = e.dataTransfer?.getData('containerId');
21-
layoutService.moveContainerTo(containerId, location);
22-
}}
28+
onDrop={handleDrop}
2329
onDragOver={(e) => {
2430
e.preventDefault();
2531
}}
2632
>
27-
drop here
33+
{localize('main-layout.drop-area.tip')}
2834
</div>
2935
);
3036
};

0 commit comments

Comments
 (0)