fix: skill i18n

This commit is contained in:
alan.cl
2026-03-14 17:59:00 +08:00
parent cf2c00ff62
commit 4d968dad81
4 changed files with 44 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
import { ChatContext } from '@/app/chat-context';
import { delDialogue, getDialogueList } from '@/client/api/request';
import { apiInterceptors } from '@/client/api/tools/interceptors';
import { DarkSvg, SunnySvg } from '@/components/icons';
import { DarkSvg, ModelSvg, SunnySvg } from '@/components/icons';
import UserBar from '@/new-components/layout/UserBar';
import type { IChatDialogueSchema } from '@/types/chat';
import { STORAGE_LANG_KEY, STORAGE_THEME_KEY } from '@/utils/constants/index';
@@ -68,6 +68,7 @@ function SideBar() {
pathname.startsWith('/construct/flow') ||
pathname.startsWith('/construct/prompt') ||
pathname.startsWith('/construct/dbgpts') ||
pathname.startsWith('/construct/models') ||
pathname === '/models_evaluation';
const { t, i18n } = useTranslation();
const [logo, setLogo] = useState<string>('/logo_zh_latest.png');
@@ -192,6 +193,21 @@ function SideBar() {
<AppstoreOutlined className='text-blue-500' />
<span>{t('app_management')}</span>
</div>
<div
onClick={() => {
router.push('/construct/models');
setSettingsOpen(false);
}}
className={cls(
'flex items-center gap-3 px-3 py-2.5 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 cursor-pointer transition-colors',
{
'bg-blue-50 text-blue-600 dark:bg-blue-900/20 dark:text-blue-400': pathname.startsWith('/construct/models'),
},
)}
>
<Icon component={ModelSvg} className='text-cyan-500' />
<span>{t('model_manage')}</span>
</div>
<div
onClick={() => {
router.push('/construct/flow');

View File

@@ -485,4 +485,13 @@ export const CommonEn = {
skills_github_importing: 'Importing skill...',
skills_github_import_success: 'Skill imported successfully',
skills_github_import_failed: 'Failed to import skill',
skills_import_hint: 'The import address should be the folder directory containing',
skills_import_hint_suffix: '. The system will automatically pull all files in the directory and package them.',
skills_import_folder_label: 'Skill folder address',
skills_import_folder_hint: '— If SKILL.md is in a subdirectory, enter the full path',
skills_import_url_required: 'Please enter the GitHub repository URL',
skills_import_example_label: 'Example:',
skills_import_url_valid: 'URL format is correct, click "Import" to start pulling',
skills_import_url_invalid: 'Please enter a valid GitHub URL',
skills_updated_at: 'Updated on {{date}}',
} as const;

View File

@@ -488,4 +488,13 @@ export const CommonZh: Resources['translation'] = {
skills_github_importing: '正在导入技能...',
skills_github_import_success: '技能导入成功',
skills_github_import_failed: '技能导入失败',
skills_import_hint: '导入地址为包含',
skills_import_hint_suffix: '的文件夹目录地址。系统会自动拉取该目录下的所有文件并打包。',
skills_import_folder_label: 'Skill 文件夹地址',
skills_import_folder_hint: '— 若 SKILL.md 在子目录中,需填写完整路径',
skills_import_url_required: '请输入 GitHub 仓库地址',
skills_import_example_label: '例如:',
skills_import_url_valid: '链接格式正确,点击「导入」开始拉取',
skills_import_url_invalid: '请输入有效的 GitHub 地址',
skills_updated_at: '更新于 {{date}}',
} as const;

View File

@@ -422,7 +422,7 @@ function Skills() {
<span>@{skill.author || 'unknown'}</span>
)}
<span>·</span>
<span>{'更新于 2026年2月6日'}</span>
<span>{t('skills_updated_at', { date: '2026-02-06' })}</span>
</div>
<div
className='opacity-0 group-hover:opacity-100 transition-opacity'
@@ -593,7 +593,7 @@ function Skills() {
}}
>
<span className='text-xs leading-relaxed' style={{ color: token.colorInfoText }}>
{' '}
{t('skills_import_hint')}{' '}
<code
className='px-1 py-0.5 rounded text-[11px]'
style={{
@@ -604,7 +604,7 @@ function Skills() {
>
SKILL.md
</code>{' '}
{t('skills_import_hint_suffix')}
</span>
</div>
@@ -613,17 +613,17 @@ function Skills() {
name='github_url'
label={
<span className='font-medium text-sm text-gray-700 dark:text-gray-300'>
Skill
{t('skills_import_folder_label')}
<span className='font-normal text-gray-400 dark:text-gray-500 ml-1'>
SKILL.md
{t('skills_import_folder_hint')}
</span>
</span>
}
rules={[{ required: true, message: '请输入 GitHub 仓库地址' }]}
rules={[{ required: true, message: t('skills_import_url_required') }]}
className='mb-2'
extra={
<div className='mt-2 flex flex-col gap-1'>
<span className='text-xs text-gray-400 dark:text-gray-500'>:</span>
<span className='text-xs text-gray-400 dark:text-gray-500'>{t('skills_import_example_label')}</span>
<code
className='text-xs px-2 py-1 rounded block w-fit'
style={{
@@ -664,14 +664,14 @@ function Skills() {
<>
<span className='inline-block w-1.5 h-1.5 rounded-full' style={{ background: token.colorSuccess }} />
<span className='text-xs' style={{ color: token.colorSuccess }}>
{t('skills_import_url_valid')}
</span>
</>
) : (
<>
<span className='inline-block w-1.5 h-1.5 rounded-full' style={{ background: token.colorWarning }} />
<span className='text-xs' style={{ color: token.colorWarning }}>
GitHub
{t('skills_import_url_invalid')}
</span>
</>
)}