Skip to content

Commit d67de16

Browse files
committed
切割线面板 i18n
1 parent f7e1884 commit d67de16

File tree

4 files changed

+62
-19
lines changed

4 files changed

+62
-19
lines changed

src/editor/inputs/linear.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
<s-divider>{{ t("data.more.dividerTitle") }}</s-divider>
99
<div class="input-inner-optional">
1010
<div class="fields">
11-
<span class="label"> 切线与割线 </span>
11+
<span class="label"> {{ t("data.derivateAndSecants") }} </span>
1212
<s-popup class="derivate-popup input" align="right">
1313
<s-button type="outlined" slot="trigger">
14-
设置面板 <s-icon name="chevron_right" slot="end"></s-icon>
14+
{{ t("data.derivateAndSecantsPane") }}
15+
<s-icon name="chevron_right" slot="end"></s-icon>
1516
</s-button>
1617
<DerivatePane :self="self" />
1718
</s-popup>
@@ -47,7 +48,7 @@
4748
"
4849
type="warn"
4950
>
50-
“隐藏悬浮提示”启用时,切线与割线跟随鼠标不生效
51+
{{ t("data.more.skipTipWarn") }}
5152
</HelpIcon>
5253
</s-checkbox>
5354
</div>

src/editor/inputs/subblocks/derivatePane.vue

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<s-tab mode="fixed" v-model.lazy="tab">
44
<s-tab-item value="derivate">
55
<div slot="text" class="tab-text">
6-
切线设置
6+
{{ t("data.derivate.title") }}
77
<Transition name="badge">
88
<s-badge class="tab-badge" v-if="derivateEnabled"></s-badge>
99
</Transition>
1010
</div>
1111
</s-tab-item>
1212
<s-tab-item value="secant">
1313
<div slot="text" class="tab-text">
14-
割线设置
14+
{{ t("data.secant.title") }}
1515
<Transition name="badge">
1616
<s-badge class="tab-badge" v-if="secantEnabled"></s-badge>
1717
</Transition>
@@ -26,31 +26,31 @@
2626
:class="{ enabled: derivateEnabled }"
2727
>
2828
<div class="field no-opacity">
29-
<div class="label">启用切线显示</div>
29+
<div class="label">{{ t("data.derivate.enable") }}</div>
3030
<s-switch type="checkbox" v-model.lazy="derivateEnabled"></s-switch>
3131
</div>
3232
<div class="field main-fn">
3333
<span class="label wide styled">y'=</span>
3434
<FunctionField class="styled fn" label="f'(x)" v-model="derivateFn" />
3535
</div>
3636
<div class="field">
37-
<div class="label">切点位置</div>
37+
<div class="label">{{ t("data.derivate.point") }}</div>
3838
<s-segmented-button v-model.lazy="derivFollowMouseStr">
3939
<s-segmented-button-item value="followMouse">
40-
跟随鼠标
40+
{{ t("data.derivate.followMouse") }}
4141
</s-segmented-button-item>
4242
<s-segmented-button-item value="manual">
43-
指定切点
43+
{{ t("data.derivate.manual") }}
4444
</s-segmented-button-item>
4545
</s-segmented-button>
4646
</div>
4747
<s-fold :folded="derivFollowMouse" class="derivate-x-coord-fold">
4848
<div class="field x-coord-field">
49-
<div class="label">切点横坐标</div>
49+
<div class="label">{{ t("data.derivate.sepcify") }}</div>
5050
<s-text-field
51-
class="x-coord styled"
51+
class="x-coord styled-inner"
5252
type="number"
53-
label="x"
53+
:label="t('data.derivate.xcoord')"
5454
v-model="derivateX"
5555
></s-text-field>
5656
</div>
@@ -60,7 +60,7 @@
6060
<!-- secant -->
6161
<div class="content" v-else :class="{ enabled: secantEnabled }">
6262
<div class="field no-opacity">
63-
<div class="label">启用割线显示</div>
63+
<div class="label">{{ t("data.secant.enable") }}</div>
6464
<s-switch type="checkbox" v-model.lazy="secantEnabled"></s-switch>
6565
</div>
6666
<div class="secants">
@@ -72,7 +72,7 @@
7272
v-model="item.followMouse"
7373
class="secant-checkbox"
7474
>
75-
跟随鼠标
75+
{{ t("data.secant.followMouse") }}
7676
</s-checkbox>
7777
<s-text-field
7878
class="sec-coord styled-inner"
@@ -111,7 +111,7 @@
111111
})
112112
"
113113
>
114-
<s-icon slot="start" name="add" /> 添加
114+
<s-icon slot="start" name="add" /> {{ t("data.secant.add") }}
115115
</s-button>
116116
</div>
117117
</div>
@@ -126,6 +126,10 @@ import AnimatedList from "@/ui/animated/animatedList.vue";
126126
import AnimatedListItem from "@/ui/animated/animatedListItem.vue";
127127
import SIconDelete from "@/ui/icons/delete.vue";
128128
129+
import { useI18n } from "vue-i18n";
130+
import { I18nSchema } from "@/i18n";
131+
const { t } = useI18n<{ message: I18nSchema }>();
132+
129133
const props = defineProps<{
130134
self: PrivateDataTypes.Linear;
131135
}>();
@@ -270,9 +274,11 @@ watchEffect(() => {
270274
width: 2.2em;
271275
}
272276
}
273-
.x-coord.styled {
277+
.x-coord.styled-inner {
278+
max-width: 12em;
279+
}
280+
.x-coord.styled-inner::part(input) {
274281
font-size: 20px;
275-
max-width: 10em;
276282
}
277283
.derivate-x-coord-fold {
278284
margin-top: -0.8em;

src/i18n/en-US.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,25 @@
6969
"nSamples": "Sample Count",
7070
"closed": "Close and Fill",
7171
"skipTip": "Hide Hover Tips",
72-
"skipTipHelp": "Hide point and coordinate info on mouse hover"
72+
"skipTipHelp": "Hide point and coordinate info on mouse hover",
73+
"skipTipWarn": "When 'Hide Hover Tips' is enabled, tangent and secant lines will not follow the mouse"
74+
},
75+
"derivateAndSecants": "Tangents and Secants",
76+
"derivateAndSecantsPane": "Open panel",
77+
"derivate": {
78+
"title": "Tangent Settings",
79+
"enable": "Enable Tangent Display",
80+
"point": "Position",
81+
"followMouse": "Dynamic",
82+
"manual": "Specify Point",
83+
"sepcify":"Point Abscissa",
84+
"xcoord": "Abscissa"
85+
},
86+
"secant": {
87+
"title": "Secant Settings",
88+
"enable": "Enable Secant Display",
89+
"followMouse": "Dynamic",
90+
"add": "Add Secant"
7391
}
7492
},
7593
"annotation": {

src/i18n/zh-CN.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,25 @@
6969
"nSamples": "采样数",
7070
"closed": "闭合并填充",
7171
"skipTip": "隐藏悬浮提示",
72-
"skipTipHelp": "隐藏鼠标经过时标出的点与坐标信息"
72+
"skipTipHelp": "隐藏鼠标经过时标出的点与坐标信息",
73+
"skipTipWarn": "“隐藏悬浮提示”启用时,切线与割线跟随鼠标不生效"
74+
},
75+
"derivateAndSecants": "切线与割线",
76+
"derivateAndSecantsPane": "设置面板",
77+
"derivate": {
78+
"title": "切线设置",
79+
"enable": "启用切线显示",
80+
"point": "切点位置",
81+
"followMouse": "跟随鼠标",
82+
"manual": "指定切点",
83+
"sepcify":"切点横坐标",
84+
"xcoord": "横坐标"
85+
},
86+
"secant": {
87+
"title": "割线设置",
88+
"enable": "启用割线显示",
89+
"followMouse": "跟随鼠标",
90+
"add": "添加割线"
7391
}
7492
},
7593
"annotation": {

0 commit comments

Comments
 (0)