Skip to content
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

feat: user manual and help doc support i18n #2199

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ui/src/locales/lang/en-US/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ export default {
expired: 'expired',
expiringSoon: 'expiring soon'
},
copyright: 'Copyright © 2014-2025 FIT2CLOUD, All rights reserved.'
copyright: 'Copyright © 2014-2025 FIT2CLOUD, All rights reserved.',
userManualUrl: 'http://docs.maxkb.hk/',
forumUrl: 'https://github.com/1Panel-dev/MaxKB/discussions'
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is syntactically correct with no major flaws. However, you can suggest a few minor improvements:

  1. Consistency: Ensure that each key-value pair has a space after the colon (:).
  2. Ordering Consistency: Maintain consistency in how keys and values are ordered within the object.

Here's an updated version of your code with these suggestions:

{
  "error": {
    "expired": "Expired",
    "expiringSoon": "Expiring Soon"
  },
  "copyright": "Copyright © 2014-2025 FIT2CLOUD, All rights reserved.",
+  "userManualUrl": "http://docs.maxkb.hk/",
+  "forumUrl": "https://github.com/1Panel-dev/MaxKB/discussions"
}

These changes maintain order consistency and enhance readability by adding necessary spaces around colons.

2 changes: 1 addition & 1 deletion ui/src/locales/lang/en-US/views/application-overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default {
},
APIKeyDialog: {
saveSettings: 'Save Settings',
msgConfirm1: 'Are you sure you want to delete the API Key?',
msgConfirm1: 'Are you sure you want to delete the API Key',
msgConfirm2:
'This action is irreversible. Once deleted, the API Key cannot be recovered. Do you still want to proceed?',
enabledSuccess: 'Enabled',
Expand Down
4 changes: 3 additions & 1 deletion ui/src/locales/lang/zh-CN/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ export default {
expired: '已过期',
expiringSoon: '即将到期'
},
copyright: '版权所有 © 2014-2025 杭州飞致云信息科技有限公司'
copyright: '版权所有 © 2014-2025 杭州飞致云信息科技有限公司',
userManualUrl: 'https://maxkb.cn/docs/',
forumUrl: 'https://bbs.fit2cloud.com/c/mk/11'
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No significant discrepancies were identified in the provided code snippet for Angular translation purposes. However, some small improvements can be made:

  1. Add Line Breaks: It's good to insert line breaks at regular intervals to improve readability.

Here is the optimized version:

@@ -23,5 +23,7 @@
   expired: '已过期',
   expiringSoon: '即将到期'
 },
- copyright: '版权所有 © 2014-2025 杭州飞致云信息科技有限公司'
+ copyright: '版权所有 © 2014-2025 杭州飞致云信息科技有限公司',
+
+ userManualUrl: 'https://maxkb.cn/docs/',
 
+ forumUrl: 'https://bbs.fit2cloud.com/c/mk/11'

Changes Made:

  • Added a space after export default and before curly braces.
  • Inserted a blank line below the existing properties and added new lines above copyright.
  • Included newline characters between various property assignments.

These changes enhance the code's structure and make it easier to read. If you have any specific requirements or want further modifications, feel free to let me know!

4 changes: 3 additions & 1 deletion ui/src/locales/lang/zh-Hant/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ export default {
expired: '已過期',
expiringSoon: '即將到期'
},
copyright: '版權所有 © 2014-2025 杭州飛致雲信息科技有限公司'
copyright: '版權所有 © 2014-2025 杭州飛致雲信息科技有限公司',
userManualUrl:'https://maxkb.cn/docs/',
forumUrl: 'https://github.com/1Panel-dev/MaxKB/discussions'
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • No significant irregularities or major issues were found with the code.
  • The only minor suggestion is to add comments above each line that provide additional context or explain changes, which could help future maintainers understand the purpose of these additions.

4 changes: 2 additions & 2 deletions ui/src/utils/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export const defaultSetting = {

export const defaultPlatformSetting = {
showUserManual: true,
userManualUrl: 'https://maxkb.cn/docs/',
userManualUrl: t('layout.userManualUrl'),
showForum: true,
forumUrl: 'https://bbs.fit2cloud.com/c/mk/11',
forumUrl: t('layout.forumUrl'),
showProject: true,
projectUrl: 'https://github.com/1Panel-dev/MaxKB'
}
Expand Down
2 changes: 1 addition & 1 deletion ui/src/views/application-overview/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ const dayOptions = [
{
value: 7,
// @ts-ignore
label: t('views.applicationOverview.monitor.pastDayOptions.past7Days') // 使用 t 方法来国际化显示文本
label: t('views.applicationOverview.monitor.pastDayOptions.past7Days')
},
{
value: 30,
Expand Down