-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add multilanguage #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add multilanguage #150
Conversation
Standardize translation keys and improve code readability by fixing formatting issues in locale files. This ensures consistency across the application and enhances maintainability.
This commit introduces internationalization (i18n) support for the user and menu modules by replacing hardcoded strings with localized text. The changes include updating placeholders, labels, and messages in various Vue components to use the `$t` function for translation. Additionally, new translation keys have been added to both `zh-CN.ts` and `en.ts` locale files to support these changes. This enhancement improves the application's usability for non-Chinese speaking users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR internationalizes various BPM views and components by replacing hardcoded text with translation function calls, extends locale files with new i18n keys, and updates some designer plugins and constants to English.
- Replaced static labels and messages in Vue components with
$t()
/t()
calls - Added new translation entries in
zh-CN.ts
anden.ts
- Updated import of translation plugin in
ProcessDesigner.vue
and English constants inconsts.ts
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/views/bpm/model/CategoryDraggableModel.vue | Swapped static strings for t('...') , imported useI18n |
src/views/bpm/category/CategoryForm.vue | Changed form item labels and placeholders to t('...') |
src/locales/zh-CN.ts | Extended Chinese locale with BPM/model/category keys |
src/locales/en.ts | Extended English locale with matching keys |
src/components/.../ProcessDesigner.vue | Updated translation plugin import and tooltip/button titles |
Comments suppressed due to low confidence (5)
src/locales/en.ts:543
- Typo in translation: should be 'Preview' instead of 'Preivew'.
preview: 'Preivew'
src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue:153
- [nitpick] Variable name
translationsCN
conflicts with importing the English file; rename totranslationsEN
for clarity.
import translationsCN from './plugins/translate/en'
src/locales/zh-CN.ts:481
- Missing comma after this entry will cause a syntax error; add a comma at the end of the line.
statusRequired: '菜单状态不能为空'
src/views/bpm/model/CategoryDraggableModel.vue:295
- After importing
useI18n
, destructure the translation function (e.g.const { t } = useI18n()
) so thatt('...')
calls in the template resolve correctly.
import { useI18n } from 'vue-i18n'
src/views/bpm/category/CategoryForm.vue:10
- Translation calls are used but
useI18n
is not imported or initialized; addimport { useI18n } from 'vue-i18n'
andconst { t } = useI18n()
in the script setup.
<el-form-item :label="t('bpm.category.name')" prop="name">
感谢!国际化,我纠结下。 是不是要做整体方案! |
要不先只 pr ,bpmn 设计器那部分? |
Add i18n at some view