Skip to content

Commit 2baa907

Browse files
authored
feat: multi-lang (#224)
feat: multi-lang Refs: #142 Signed-off-by: seven <[email protected]>
1 parent eb96515 commit 2baa907

File tree

3 files changed

+42
-13
lines changed

3 files changed

+42
-13
lines changed

src/lang/enUS.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ export const enUS = {
216216
attributeValueRequired: 'Attribute value is required',
217217
operatorRequired: 'Filter operator is required',
218218
createItemSuccess: 'Item created successfully!',
219+
filterLabels: {
220+
eq: 'Equals',
221+
ne: 'Not equals',
222+
lte: 'Less than or equal to',
223+
lt: 'Less Than',
224+
gte: 'Greater than or equal to',
225+
gt: 'Greater than',
226+
between: 'Between',
227+
exists: 'Exists',
228+
notExists: 'Not Exists',
229+
contains: 'Contains',
230+
notContains: 'Not Contains',
231+
beginsWith: 'Begins With',
232+
},
219233
},
220234
},
221235
file: {

src/lang/zhCN.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ export const zhCN = {
216216
attributeValueRequired: '请输入属性值',
217217
operatorRequired: '请输入滤器操作符',
218218
createItemSuccess: '数据添加成功!',
219+
filterLabels: {
220+
eq: '等于',
221+
ne: '不等于',
222+
lt: '小于',
223+
lte: '小于等于',
224+
gt: '大于',
225+
gte: '大于等于',
226+
between: '介于',
227+
exists: '存在',
228+
notExists: '不存在',
229+
contains: '包含',
230+
notContains: '不包含',
231+
beginsWith: '开头为',
232+
},
219233
},
220234
},
221235
file: {

src/views/editor/dynamo-editor/components/ui-editor.vue

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ import {
196196
import { CustomError, inputProps } from '../../../../common';
197197
import { useLang } from '../../../../lang';
198198
199+
const lang = useLang();
200+
199201
const connectionStore = useConnectionStore();
200202
201203
const { fetchIndices } = connectionStore;
@@ -210,24 +212,23 @@ const { dynamoData } = storeToRefs(dbDataStore);
210212
211213
const dynamoQueryFormRef = ref();
212214
const filterConditions = ref([
213-
{ label: '=', value: '=' },
214-
{ label: '!=', value: '!=' },
215-
{ label: '<=', value: '<=' },
216-
{ label: '<', value: '<' },
217-
{ label: '>=', value: '>=' },
218-
{ label: '>', value: '>' },
219-
{ label: 'Between', value: 'between' },
220-
{ label: 'Exists', value: 'attribute_exists' },
221-
{ label: 'Not exists', value: 'attribute_not_exists' },
222-
{ label: 'Contain', value: 'contains' },
223-
{ label: 'Not contain', value: 'not contain' },
224-
{ label: 'Begins with', value: 'begins_with' },
215+
{ label: lang.t('editor.dynamo.filterLabels.eq'), value: '=' },
216+
{ label: lang.t('editor.dynamo.filterLabels.ne'), value: '!=' },
217+
{ label: lang.t('editor.dynamo.filterLabels.lte'), value: '<=' },
218+
{ label: lang.t('editor.dynamo.filterLabels.lt'), value: '<' },
219+
{ label: lang.t('editor.dynamo.filterLabels.gte'), value: '>=' },
220+
{ label: lang.t('editor.dynamo.filterLabels.gt'), value: '>' },
221+
{ label: lang.t('editor.dynamo.filterLabels.between'), value: 'between' },
222+
{ label: lang.t('editor.dynamo.filterLabels.exists'), value: 'attribute_exists' },
223+
{ label: lang.t('editor.dynamo.filterLabels.notExists'), value: 'attribute_not_exists' },
224+
{ label: lang.t('editor.dynamo.filterLabels.contains'), value: 'contains' },
225+
{ label: lang.t('editor.dynamo.filterLabels.notContains'), value: 'not contain' },
226+
{ label: lang.t('editor.dynamo.filterLabels.beginsWith'), value: 'begins_with' },
225227
]);
226228
227229
const loadingRef = ref({ index: false, queryResult: false });
228230
229231
const message = useMessage();
230-
const lang = useLang();
231232
232233
const dynamoQueryForm = ref<{
233234
index: string | null;

0 commit comments

Comments
 (0)