Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add multilanguage #150

wants to merge 3 commits into from

Conversation

huuhoait
Copy link

Add i18n at some view

huuhoait added 3 commits May 17, 2025 20:40
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.
@YunaiV YunaiV requested a review from Copilot June 15, 2025 07:51
Copy link

@Copilot Copilot AI left a 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 and en.ts
  • Updated import of translation plugin in ProcessDesigner.vue and English constants in consts.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 to translationsEN 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 that t('...') 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; add import { useI18n } from 'vue-i18n' and const { t } = useI18n() in the script setup.
<el-form-item :label="t('bpm.category.name')" prop="name">

@YunaiV
Copy link
Contributor

YunaiV commented Jun 15, 2025

感谢!国际化,我纠结下。

是不是要做整体方案!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants