Add Vietnamese#972
Merged
Merged
Conversation
Contributor
审查者指南通过将越南语翻译追加到所有现有的 i18n 字符串数组,并在客户端 i18n 配置中的受支持语言列表中记录新语言区域,将越南语(vi-VN)添加为新的 UI 语言。 文件级变更
技巧与命令与 Sourcery 交互
自定义你的使用体验访问你的 仪表盘 以:
获取帮助Original review guide in EnglishReviewer's GuideAdds Vietnamese (vi-VN) as a new UI language by appending Vietnamese translations to all existing i18n string arrays and documenting the new locale in the supported language list in the client i18n configuration. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
嗨,我发现了 6 个问题,并留下了一些总体反馈:
- 由于在新增的越南语条目前缺少逗号,若干模板字符串数组现在在语法上是无效的(例如
_DEFAULT_GRAVATAR、_HIGHLIGHT_THEME、_HIGHLIGHT_PLUGIN、_IMAGE_CDN、_PUSHOO_CHANNEL、_SMTP_SERVICE),这会在运行时导致 i18n 模块出错。 - 请确保每个翻译数组的元素数量和语言顺序与文档中声明的语言列表保持一致(zh-CN, zh-HK, zh-TW, en, uz-UZ, ja-JP, ko-KR, vi-VN);目前有若干条目(例如
ADMIN_CONFIG_CAPTCHA、_TURNSTILE_SECRET_KEY、_GEETEST_CAPTCHA_KEY、_CAP_SECRET_KEY、_QCLOUD_SECRET_KEY、_MAIL_TEMPLATE、_MAIL_TEMPLATE_ADMIN)增加的是多条英文/韩文字符串,而不是单个越南语字符串,这会导致语言不对齐。 - 对于你已经添加了越南语的键,请再次检查:确保每个数组末尾(右方括号前)只新增一个越南语字符串,而不是插入到中间,否则会改变既有语言的顺序,破坏那些依赖数组索引进行语言映射的调用方。
给 AI 工具的提示词
Please address the comments from this code review:
## Overall Comments
- Several of the template-literal arrays are now syntactically invalid because the new Vietnamese entries are added without a comma after the previous element (e.g. `_DEFAULT_GRAVATAR`, `_HIGHLIGHT_THEME`, `_HIGHLIGHT_PLUGIN`, `_IMAGE_CDN`, `_PUSHOO_CHANNEL`, `_SMTP_SERVICE`), which will break the i18n module at runtime.
- Please ensure each translation array keeps a consistent element count and language order matching the documented locales (zh-CN, zh-HK, zh-TW, en, uz-UZ, ja-JP, ko-KR, vi-VN); several entries (e.g. `ADMIN_CONFIG_CAPTCHA`, `_TURNSTILE_SECRET_KEY`, `_GEETEST_CAPTCHA_KEY`, `_CAP_SECRET_KEY`, `_QCLOUD_SECRET_KEY`, `_MAIL_TEMPLATE`, `_MAIL_TEMPLATE_ADMIN`) currently add extra English/Korean strings instead of a single Vietnamese string, which will misalign languages.
- For keys where you added Vietnamese, double-check that you added exactly one Vietnamese string at the end of each array (before closing bracket) rather than inserting it in the middle, to avoid shifting existing languages and breaking consumers that rely on index-based language mapping.
## Individual Comments
### Comment 1
<location path="src/client/utils/i18n/i18n.js" line_range="567-568" />
<code_context>
`Аватар тўлдирувчиси. Стандарт (агар бўш қолдирилса): «идентификатор». Қуйидагилардан танланг: ${defaultGravatar.join(', ')}`,
`デフォルトのプロフィール画像表示。デフォルト(空欄時)は "initials" で、選択肢は:${defaultGravatar.join('、')} です`,
`프로필 기본 이미지. 기본값(비워둘 경우): "initials". 사용 가능 스타일: ${defaultGravatar.join(', ')}`
+ `Ảnh đại diện mặc định. Mặc định (để trống): "initials".`
],
[S.ACI + '_EMOTION_CDN']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Add commas between the template literal entries in the DEFAULT_GRAVATAR array to avoid a syntax error.
In `[S.ACI + '_DEFAULT_GRAVATAR']`, the new Korean and Vietnamese template literals are missing commas between them and before the closing bracket, which makes the array invalid and breaks module parsing. Please add commas after both the Korean and Vietnamese entries.
</issue_to_address>
### Comment 2
<location path="src/client/utils/i18n/i18n.js" line_range="657-658" />
<code_context>
`Плагин подсветки кода, опционально: ${highlightPlugins.join(',')}, соответственно: показывать язык кода, показывать кнопку копирования кода. Вы можете установить несколько опций одновременно, если вы хотите не добавлять плагин подсветки кода, установите значение none. по умолчанию: none.`,
`コード・ハイライト・プラグイン。オプション: ${highlightPlugins.join(',')}, それぞれ: コード言語の表示、コード・コピー・ボタンの表示。複数のオプションを同時に設定できますが、コード・ハイライト・プラグインを追加したくない場合は、noneに設定してください。`,
`코드 하이라이트 추가 기능. 선택 가능: ${highlightPlugins.join(', ')}. (코드 언어 표시, 복사 버튼) 여러 기능을 동시에 설정할 수 있으며, 추가하지 않으려면 none으로 설정하세요. 기본값: none.`
+ `Plugin tô sáng code. Để không dùng plugin, đặt thành none. Mặc định: none.`
],
[S.ACI + '_IMAGE_CDN']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Add missing commas between HIGHLIGHT_PLUGIN array items.
In the `[S.ACI + '_HIGHLIGHT_PLUGIN']` array, the new Korean and Vietnamese template literals also need commas after each entry (including before the closing bracket), otherwise this will result in a syntax error.
</issue_to_address>
### Comment 3
<location path="src/client/utils/i18n/i18n.js" line_range="667-668" />
<code_context>
`Расм юклаш учун расм тўшаги. Қуйидагилардан танланг: ${imageBedServices.join(', ')}`,
`画像のアップロードに使用する画像ホスティングサービス。次のうちから選択してください:${imageBedServices.join('、')}`,
`댓글 이미지 업로드 기능에 사용될 호스팅 서비스. 사용 가능 목록: ${imageBedServices.join(', ')}`
+ `Dịch vụ lưu trữ ảnh khi tải lên bình luận.`
],
// 翻译来自 Deepseek
</code_context>
<issue_to_address>
**issue (bug_risk):** Insert commas between IMAGE_CDN template literal entries.
The Vietnamese template literal needs commas on both sides so the array stays valid. Please add a comma after the Korean entry and another after the Vietnamese entry.
</issue_to_address>
### Comment 4
<location path="src/client/utils/i18n/i18n.js" line_range="676-679" />
<code_context>
`IMAGE_CDN томонидан белгиланган расм тўшаги URL. Агар сизнинг IMAGE_CDN шулардан бири бўлса: ${customImageBedServices.join(', ')}`, // 乌兹别克语
`IMAGE_CDNで設定した画像ホスティングサービスのURL。IMAGE_CDNが以下のいずれかの場合は入力が必要です:${customImageBedServices.join('、')}`, // 日语
- '이미지 저장소 URL. IMAGE_CDN 설정이 다음 중 하나인 경우 필요합니다: ${customImageBedServices.join(', ')}'
+ '이미지 저장소 URL. IMAGE_CDN 설정이 다음 중 하나인 경우 필요합니다: ${customImageBedServices.join(', ')}',
+ 'URL của dịch vụ lưu trữ ảnh. Bắt buộc nếu IMAGE_CDN là một trong các giá trị tùy chỉnh.'
],
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Use a template literal instead of a normal string where ${customImageBedServices.join(...)} is intended to interpolate.
This Korean string uses single quotes, so `${customImageBedServices.join(', ')}` will appear literally instead of being interpolated like in the other entries. To keep behavior consistent, switch this to a template literal with backticks so the expression evaluates at runtime.
```suggestion
`IMAGE_CDN томонидан белгиланган расм тўшаги URL. Агар сизнинг IMAGE_CDN шулардан бири бўлса: ${customImageBedServices.join(', ')}`, // 乌兹别克语
`IMAGE_CDNで設定した画像ホスティングサービスのURL。IMAGE_CDNが以下のいずれかの場合は入力が必要です:${customImageBedServices.join('、')}`, // 日语
`이미지 저장소 URL. IMAGE_CDN 설정이 다음 중 하나인 경우 필요합니다: ${customImageBedServices.join(', ')}`,
'URL của dịch vụ lưu trữ ảnh. Bắt buộc nếu IMAGE_CDN là một trong các giá trị tùy chỉnh.'
```
</issue_to_address>
### Comment 5
<location path="src/client/utils/i18n/i18n.js" line_range="986-987" />
<code_context>
`ИМ билдиришномаси суриш канали. Қўллаб-қувватлаш: ${pushooChannels.join(', ')}`,
`即時メッセージプッシュプラットフォームの名前。${pushooChannels.join('、')} などに対応しています。`,
`실시간 알림을 받을 서비스 설정. 지원: ${pushooChannels.join(', ')}`
+ `Kênh gửi thông báo IM tức thì.`
],
[S.ACI + '_PUSHOO_TOKEN']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Add missing commas between Pushoo channel description entries.
Between the new Korean and Vietnamese template literals in `[S.ACI + '_PUSHOO_CHANNEL']`, and after the Vietnamese entry, commas are missing, making the array invalid. Please add commas so each element is properly separated.
</issue_to_address>
### Comment 6
<location path="src/client/utils/i18n/i18n.js" line_range="1177-1178" />
<code_context>
`Электрон почта хабарномаси учун электрон почта хизмати провайдери. Қўллаб-қувватлаш: ${smtpServices.join(', ')}`,
`メール通知メールボックスサービスプロバイダ。サポート: ${smtpServices.join(',')}.`,
`알림 발송 이메일 서비스 선택. 지원 목록: ${smtpServices.join(', ')}`
+ `Nhà cung cấp dịch vụ email gửi thông báo.`
],
[S.ACI + '_SMTP_USER']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Separate SMTP_SERVICE template literals with commas.
The `[S.ACI + '_SMTP_SERVICE']` array has the same issue: the new Vietnamese template literal is missing a comma after the Korean entry, so the array will not parse. Please add the missing comma between these entries (and before the closing bracket if needed).
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据这些反馈改进后续评审。
Original comment in English
Hey - I've found 6 issues, and left some high level feedback:
- Several of the template-literal arrays are now syntactically invalid because the new Vietnamese entries are added without a comma after the previous element (e.g.
_DEFAULT_GRAVATAR,_HIGHLIGHT_THEME,_HIGHLIGHT_PLUGIN,_IMAGE_CDN,_PUSHOO_CHANNEL,_SMTP_SERVICE), which will break the i18n module at runtime. - Please ensure each translation array keeps a consistent element count and language order matching the documented locales (zh-CN, zh-HK, zh-TW, en, uz-UZ, ja-JP, ko-KR, vi-VN); several entries (e.g.
ADMIN_CONFIG_CAPTCHA,_TURNSTILE_SECRET_KEY,_GEETEST_CAPTCHA_KEY,_CAP_SECRET_KEY,_QCLOUD_SECRET_KEY,_MAIL_TEMPLATE,_MAIL_TEMPLATE_ADMIN) currently add extra English/Korean strings instead of a single Vietnamese string, which will misalign languages. - For keys where you added Vietnamese, double-check that you added exactly one Vietnamese string at the end of each array (before closing bracket) rather than inserting it in the middle, to avoid shifting existing languages and breaking consumers that rely on index-based language mapping.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Several of the template-literal arrays are now syntactically invalid because the new Vietnamese entries are added without a comma after the previous element (e.g. `_DEFAULT_GRAVATAR`, `_HIGHLIGHT_THEME`, `_HIGHLIGHT_PLUGIN`, `_IMAGE_CDN`, `_PUSHOO_CHANNEL`, `_SMTP_SERVICE`), which will break the i18n module at runtime.
- Please ensure each translation array keeps a consistent element count and language order matching the documented locales (zh-CN, zh-HK, zh-TW, en, uz-UZ, ja-JP, ko-KR, vi-VN); several entries (e.g. `ADMIN_CONFIG_CAPTCHA`, `_TURNSTILE_SECRET_KEY`, `_GEETEST_CAPTCHA_KEY`, `_CAP_SECRET_KEY`, `_QCLOUD_SECRET_KEY`, `_MAIL_TEMPLATE`, `_MAIL_TEMPLATE_ADMIN`) currently add extra English/Korean strings instead of a single Vietnamese string, which will misalign languages.
- For keys where you added Vietnamese, double-check that you added exactly one Vietnamese string at the end of each array (before closing bracket) rather than inserting it in the middle, to avoid shifting existing languages and breaking consumers that rely on index-based language mapping.
## Individual Comments
### Comment 1
<location path="src/client/utils/i18n/i18n.js" line_range="567-568" />
<code_context>
`Аватар тўлдирувчиси. Стандарт (агар бўш қолдирилса): «идентификатор». Қуйидагилардан танланг: ${defaultGravatar.join(', ')}`,
`デフォルトのプロフィール画像表示。デフォルト(空欄時)は "initials" で、選択肢は:${defaultGravatar.join('、')} です`,
`프로필 기본 이미지. 기본값(비워둘 경우): "initials". 사용 가능 스타일: ${defaultGravatar.join(', ')}`
+ `Ảnh đại diện mặc định. Mặc định (để trống): "initials".`
],
[S.ACI + '_EMOTION_CDN']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Add commas between the template literal entries in the DEFAULT_GRAVATAR array to avoid a syntax error.
In `[S.ACI + '_DEFAULT_GRAVATAR']`, the new Korean and Vietnamese template literals are missing commas between them and before the closing bracket, which makes the array invalid and breaks module parsing. Please add commas after both the Korean and Vietnamese entries.
</issue_to_address>
### Comment 2
<location path="src/client/utils/i18n/i18n.js" line_range="657-658" />
<code_context>
`Плагин подсветки кода, опционально: ${highlightPlugins.join(',')}, соответственно: показывать язык кода, показывать кнопку копирования кода. Вы можете установить несколько опций одновременно, если вы хотите не добавлять плагин подсветки кода, установите значение none. по умолчанию: none.`,
`コード・ハイライト・プラグイン。オプション: ${highlightPlugins.join(',')}, それぞれ: コード言語の表示、コード・コピー・ボタンの表示。複数のオプションを同時に設定できますが、コード・ハイライト・プラグインを追加したくない場合は、noneに設定してください。`,
`코드 하이라이트 추가 기능. 선택 가능: ${highlightPlugins.join(', ')}. (코드 언어 표시, 복사 버튼) 여러 기능을 동시에 설정할 수 있으며, 추가하지 않으려면 none으로 설정하세요. 기본값: none.`
+ `Plugin tô sáng code. Để không dùng plugin, đặt thành none. Mặc định: none.`
],
[S.ACI + '_IMAGE_CDN']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Add missing commas between HIGHLIGHT_PLUGIN array items.
In the `[S.ACI + '_HIGHLIGHT_PLUGIN']` array, the new Korean and Vietnamese template literals also need commas after each entry (including before the closing bracket), otherwise this will result in a syntax error.
</issue_to_address>
### Comment 3
<location path="src/client/utils/i18n/i18n.js" line_range="667-668" />
<code_context>
`Расм юклаш учун расм тўшаги. Қуйидагилардан танланг: ${imageBedServices.join(', ')}`,
`画像のアップロードに使用する画像ホスティングサービス。次のうちから選択してください:${imageBedServices.join('、')}`,
`댓글 이미지 업로드 기능에 사용될 호스팅 서비스. 사용 가능 목록: ${imageBedServices.join(', ')}`
+ `Dịch vụ lưu trữ ảnh khi tải lên bình luận.`
],
// 翻译来自 Deepseek
</code_context>
<issue_to_address>
**issue (bug_risk):** Insert commas between IMAGE_CDN template literal entries.
The Vietnamese template literal needs commas on both sides so the array stays valid. Please add a comma after the Korean entry and another after the Vietnamese entry.
</issue_to_address>
### Comment 4
<location path="src/client/utils/i18n/i18n.js" line_range="676-679" />
<code_context>
`IMAGE_CDN томонидан белгиланган расм тўшаги URL. Агар сизнинг IMAGE_CDN шулардан бири бўлса: ${customImageBedServices.join(', ')}`, // 乌兹别克语
`IMAGE_CDNで設定した画像ホスティングサービスのURL。IMAGE_CDNが以下のいずれかの場合は入力が必要です:${customImageBedServices.join('、')}`, // 日语
- '이미지 저장소 URL. IMAGE_CDN 설정이 다음 중 하나인 경우 필요합니다: ${customImageBedServices.join(', ')}'
+ '이미지 저장소 URL. IMAGE_CDN 설정이 다음 중 하나인 경우 필요합니다: ${customImageBedServices.join(', ')}',
+ 'URL của dịch vụ lưu trữ ảnh. Bắt buộc nếu IMAGE_CDN là một trong các giá trị tùy chỉnh.'
],
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Use a template literal instead of a normal string where ${customImageBedServices.join(...)} is intended to interpolate.
This Korean string uses single quotes, so `${customImageBedServices.join(', ')}` will appear literally instead of being interpolated like in the other entries. To keep behavior consistent, switch this to a template literal with backticks so the expression evaluates at runtime.
```suggestion
`IMAGE_CDN томонидан белгиланган расм тўшаги URL. Агар сизнинг IMAGE_CDN шулардан бири бўлса: ${customImageBedServices.join(', ')}`, // 乌兹别克语
`IMAGE_CDNで設定した画像ホスティングサービスのURL。IMAGE_CDNが以下のいずれかの場合は入力が必要です:${customImageBedServices.join('、')}`, // 日语
`이미지 저장소 URL. IMAGE_CDN 설정이 다음 중 하나인 경우 필요합니다: ${customImageBedServices.join(', ')}`,
'URL của dịch vụ lưu trữ ảnh. Bắt buộc nếu IMAGE_CDN là một trong các giá trị tùy chỉnh.'
```
</issue_to_address>
### Comment 5
<location path="src/client/utils/i18n/i18n.js" line_range="986-987" />
<code_context>
`ИМ билдиришномаси суриш канали. Қўллаб-қувватлаш: ${pushooChannels.join(', ')}`,
`即時メッセージプッシュプラットフォームの名前。${pushooChannels.join('、')} などに対応しています。`,
`실시간 알림을 받을 서비스 설정. 지원: ${pushooChannels.join(', ')}`
+ `Kênh gửi thông báo IM tức thì.`
],
[S.ACI + '_PUSHOO_TOKEN']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Add missing commas between Pushoo channel description entries.
Between the new Korean and Vietnamese template literals in `[S.ACI + '_PUSHOO_CHANNEL']`, and after the Vietnamese entry, commas are missing, making the array invalid. Please add commas so each element is properly separated.
</issue_to_address>
### Comment 6
<location path="src/client/utils/i18n/i18n.js" line_range="1177-1178" />
<code_context>
`Электрон почта хабарномаси учун электрон почта хизмати провайдери. Қўллаб-қувватлаш: ${smtpServices.join(', ')}`,
`メール通知メールボックスサービスプロバイダ。サポート: ${smtpServices.join(',')}.`,
`알림 발송 이메일 서비스 선택. 지원 목록: ${smtpServices.join(', ')}`
+ `Nhà cung cấp dịch vụ email gửi thông báo.`
],
[S.ACI + '_SMTP_USER']: [
</code_context>
<issue_to_address>
**issue (bug_risk):** Separate SMTP_SERVICE template literals with commas.
The `[S.ACI + '_SMTP_SERVICE']` array has the same issue: the new Vietnamese template literal is missing a comma after the Korean entry, so the array will not parse. Please add the missing comma between these entries (and before the closing bracket if needed).
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
由 Sourcery 提供的摘要
在客户端 i18n 目录中添加越南语语言支持。
新功能:
Original summary in English
Summary by Sourcery
Add Vietnamese language support across the client i18n catalogue.
New Features: