Add i18n and release-aware download for repo card

This update adds internationalization to all user-facing strings in the block editor UI and repository card, and refactors download logic to support release ZIPs and branch ZIPs for GitHub, GitLab, Gitea, Forgejo, and custom platforms. The PHP backend now fetches release info, generates appropriate download URLs and filenames, and improves caching and debug logging. The block UI and card rendering are updated to use translated strings and new download button logic.
This commit is contained in:
feibisi 2025-08-01 01:12:42 +08:00
parent 2f811072c5
commit 8beaadc3bc
7 changed files with 992 additions and 767 deletions

View file

@ -131,12 +131,12 @@
const fetchRepoData = () => { const fetchRepoData = () => {
if (!owner || !repo) { if (!owner || !repo) {
setError('Please enter repository owner and name'); setError(__('Please enter repository owner and name', 'git-embed-feicode'));
return; return;
} }
if ((platform === 'gitea' || platform === 'forgejo' || platform === 'gitlab' || platform === 'custom') && !customDomain) { if ((platform === 'gitea' || platform === 'forgejo' || platform === 'gitlab' || platform === 'custom') && !customDomain) {
setError(`Please enter custom domain for ${platform.charAt(0).toUpperCase() + platform.slice(1)}`); setError(__('Please enter custom domain for', 'git-embed-feicode') + ' ' + platform.charAt(0).toUpperCase() + platform.slice(1));
return; return;
} }
@ -163,13 +163,13 @@
setRepoData(data.data); setRepoData(data.data);
setError(''); setError('');
} else { } else {
setError(data.data || 'Failed to fetch repository'); setError(data.data || __('Failed to fetch repository', 'git-embed-feicode'));
setRepoData(null); setRepoData(null);
} }
}) })
.catch(err => { .catch(err => {
setLoading(false); setLoading(false);
setError('Network error occurred'); setError(__('Network error occurred', 'git-embed-feicode'));
setRepoData(null); setRepoData(null);
}); });
}; };
@ -180,7 +180,6 @@
} }
}, [owner, repo, platform, customDomain, customSiteName]); }, [owner, repo, platform, customDomain, customSiteName]);
// 获取显示用的头像 URL优先仓库头像
const getDisplayAvatarUrl = (repoData) => { const getDisplayAvatarUrl = (repoData) => {
if (repoData.repo_avatar_url) { if (repoData.repo_avatar_url) {
return repoData.repo_avatar_url; return repoData.repo_avatar_url;
@ -191,11 +190,15 @@
return ''; return '';
}; };
const handleDownload = (url, filename) => {
window.open(url, '_blank');
};
const renderPreview = () => { const renderPreview = () => {
if (loading) { if (loading) {
return el('div', { className: 'git-embed-loading' }, return el('div', { className: 'git-embed-loading' },
el(Spinner), el(Spinner),
el('p', null, 'Fetching repository data...') el('p', null, __('Fetching repository data...', 'git-embed-feicode'))
); );
} }
@ -210,8 +213,8 @@
return el('div', { className: 'git-embed-placeholder' }, return el('div', { className: 'git-embed-placeholder' },
el('div', { className: 'git-embed-placeholder-content' }, el('div', { className: 'git-embed-placeholder-content' },
el('span', { className: 'dashicons dashicons-admin-links git-embed-placeholder-icon' }), el('span', { className: 'dashicons dashicons-admin-links git-embed-placeholder-icon' }),
el('h3', null, 'Git Repository Embed'), el('h3', null, __('Git Repository Embed', 'git-embed-feicode')),
el('p', null, 'Configure your repository details in the sidebar') el('p', null, __('Configure your repository details in the sidebar', 'git-embed-feicode'))
) )
); );
} }
@ -220,10 +223,13 @@
const avatarClass = `git-embed-avatar git-embed-avatar-${avatarSize}`; const avatarClass = `git-embed-avatar git-embed-avatar-${avatarSize}`;
const buttonClass = `git-embed-button-${buttonSize}`; const buttonClass = `git-embed-button-${buttonSize}`;
// 使用简化的下载地址 const downloadInfo = repoData.download_info || {};
const downloadUrl = repoData.archive_url || ''; const downloadUrl = downloadInfo.url || repoData.archive_url || '';
const downloadFilename = downloadInfo.filename || `${repoData.name}.zip`;
const downloadTitle = downloadInfo.name ?
__('Download', 'git-embed-feicode') + ' ' + downloadInfo.name + ' (' + downloadInfo.version + ')' :
__('Download ZIP', 'git-embed-feicode');
// 获取显示头像
const displayAvatarUrl = getDisplayAvatarUrl(repoData); const displayAvatarUrl = getDisplayAvatarUrl(repoData);
return el('div', { className: cardClass }, return el('div', { className: cardClass },
@ -251,7 +257,7 @@
src: displayAvatarUrl, src: displayAvatarUrl,
alt: repoData.name, alt: repoData.name,
className: avatarClass, className: avatarClass,
title: repoData.repo_avatar_url ? 'Repository Avatar' : 'Owner Avatar' title: repoData.repo_avatar_url ? __('Repository Avatar', 'git-embed-feicode') : __('Owner Avatar', 'git-embed-feicode')
}), }),
el('div', { className: 'git-embed-title-content' }, el('div', { className: 'git-embed-title-content' },
el('h3', { className: 'git-embed-title' }, el('h3', { className: 'git-embed-title' },
@ -272,9 +278,9 @@
}, `@${repoData.owner.login}`), }, `@${repoData.owner.login}`),
repoData.repo_avatar_url && el('span', { repoData.repo_avatar_url && el('span', {
className: 'git-embed-repo-avatar-badge', className: 'git-embed-repo-avatar-badge',
title: 'Repository has custom avatar' title: __('Repository has custom avatar', 'git-embed-feicode')
}, },
el('span', { className: 'dashicons dashicons-format-image' }) el('span', { className: '' })
) )
) )
) )
@ -292,23 +298,23 @@
showDescription && repoData.description && showDescription && repoData.description &&
el('p', { className: 'git-embed-description' }, el('p', { className: 'git-embed-description' },
el('span', { className: 'dashicons dashicons-text-page' }), el('span', { className: 'dashicons dashicons-editor-quote' }),
repoData.description repoData.description
), ),
showStats && el('div', { className: 'git-embed-stats' }, showStats && el('div', { className: 'git-embed-stats' },
el('span', { className: 'git-embed-stat' }, el('span', { className: 'git-embed-stat' },
el('span', { className: 'dashicons dashicons-star-filled' }), el('span', { className: 'dashicons dashicons-star-filled' }),
el('span', { className: 'git-embed-stat-label' }, 'Stars:'), el('span', { className: 'git-embed-stat-label' }, __('Stars:', 'git-embed-feicode')),
el('span', { className: 'git-embed-stat-value' }, repoData.stargazers_count.toLocaleString()) el('span', { className: 'git-embed-stat-value' }, repoData.stargazers_count.toLocaleString())
), ),
el('span', { className: 'git-embed-stat' }, el('span', { className: 'git-embed-stat' },
el('span', { className: 'dashicons dashicons-networking' }), el('span', { className: 'dashicons dashicons-networking' }),
el('span', { className: 'git-embed-stat-label' }, 'Forks:'), el('span', { className: 'git-embed-stat-label' }, __('Forks:', 'git-embed-feicode')),
el('span', { className: 'git-embed-stat-value' }, repoData.forks_count.toLocaleString()) el('span', { className: 'git-embed-stat-value' }, repoData.forks_count.toLocaleString())
), ),
el('span', { className: 'git-embed-stat' }, el('span', { className: 'git-embed-stat' },
el('span', { className: 'dashicons dashicons-editor-help' }), el('span', { className: 'dashicons dashicons-editor-help' }),
el('span', { className: 'git-embed-stat-label' }, 'Issues:'), el('span', { className: 'git-embed-stat-label' }, __('Issues:', 'git-embed-feicode')),
el('span', { className: 'git-embed-stat-value' }, repoData.open_issues_count.toLocaleString()) el('span', { className: 'git-embed-stat-value' }, repoData.open_issues_count.toLocaleString())
) )
), ),
@ -321,22 +327,24 @@
rel: 'noopener' rel: 'noopener'
}, },
el('span', { className: 'dashicons dashicons-external' }), el('span', { className: 'dashicons dashicons-external' }),
'View Repository' __('View Repository', 'git-embed-feicode')
), ),
showCloneButton && el('span', { showCloneButton && el('span', {
className: `git-embed-button git-embed-button-secondary ${buttonClass}`, className: `git-embed-button git-embed-button-secondary ${buttonClass}`,
title: `Clone URL: ${repoData.clone_url}` title: __('Clone URL:', 'git-embed-feicode') + ' ' + repoData.clone_url
}, },
el('span', { className: 'dashicons dashicons-admin-page' }), el('span', { className: 'dashicons dashicons-admin-page' }),
'Clone' __('Clone', 'git-embed-feicode')
), ),
showDownloadButton && downloadUrl && el('a', { showDownloadButton && downloadUrl && el('button', {
href: downloadUrl,
className: `git-embed-button git-embed-button-secondary ${buttonClass}`, className: `git-embed-button git-embed-button-secondary ${buttonClass}`,
download: `${repoData.name}-${repoData.default_branch || 'main'}.zip` onClick: () => handleDownload(downloadUrl, downloadFilename),
title: downloadTitle
}, },
el('span', { className: 'dashicons dashicons-download' }), el('span', { className: 'dashicons dashicons-download' }),
'Download ZIP' downloadInfo.type === 'release' && downloadInfo.version ?
__('Download', 'git-embed-feicode') + ' ' + downloadInfo.version :
__('Download ZIP', 'git-embed-feicode')
), ),
showIssuesButton && el('a', { showIssuesButton && el('a', {
href: `${repoData.html_url}/issues`, href: `${repoData.html_url}/issues`,
@ -345,7 +353,7 @@
rel: 'noopener' rel: 'noopener'
}, },
el('span', { className: 'dashicons dashicons-editor-help' }), el('span', { className: 'dashicons dashicons-editor-help' }),
`Issues (${repoData.open_issues_count.toLocaleString()})` __('Issues', 'git-embed-feicode') + ' (' + repoData.open_issues_count.toLocaleString() + ')'
), ),
showForksButton && el('a', { showForksButton && el('a', {
href: `${repoData.html_url}/forks`, href: `${repoData.html_url}/forks`,
@ -354,7 +362,7 @@
rel: 'noopener' rel: 'noopener'
}, },
el('span', { className: 'dashicons dashicons-networking' }), el('span', { className: 'dashicons dashicons-networking' }),
`Forks (${repoData.forks_count.toLocaleString()})` __('Forks', 'git-embed-feicode') + ' (' + repoData.forks_count.toLocaleString() + ')'
) )
) )
); );
@ -376,14 +384,14 @@
label: __('Platform', 'git-embed-feicode'), label: __('Platform', 'git-embed-feicode'),
value: platform, value: platform,
options: [ options: [
{ label: 'GitHub', value: 'github' }, { label: __('GitHub', 'git-embed-feicode'), value: 'github' },
{ label: 'Gitea', value: 'gitea' }, { label: __('Gitea', 'git-embed-feicode'), value: 'gitea' },
{ label: 'Forgejo', value: 'forgejo' }, { label: __('Forgejo', 'git-embed-feicode'), value: 'forgejo' },
{ label: 'GitLab (Self-hosted)', value: 'gitlab' }, { label: __('GitLab (Self-hosted)', 'git-embed-feicode'), value: 'gitlab' },
{ label: 'Custom Git Service', value: 'custom' } { label: __('Custom Git Service', 'git-embed-feicode'), value: 'custom' }
], ],
onChange: (value) => setAttributes({ platform: value }), onChange: (value) => setAttributes({ platform: value }),
help: platform !== 'github' ? 'Self-hosted Git service requires custom domain' : '', help: platform !== 'github' ? __('Self-hosted Git service requires custom domain', 'git-embed-feicode') : '',
__next40pxDefaultSize: true, __next40pxDefaultSize: true,
__nextHasNoMarginBottom: true __nextHasNoMarginBottom: true
}), }),
@ -391,8 +399,8 @@
label: __('Custom Domain', 'git-embed-feicode'), label: __('Custom Domain', 'git-embed-feicode'),
value: customDomain, value: customDomain,
onChange: (value) => setAttributes({ customDomain: value }), onChange: (value) => setAttributes({ customDomain: value }),
placeholder: 'e.g. git.example.com', placeholder: __('e.g. git.example.com', 'git-embed-feicode'),
help: `Enter the domain of your ${platform.charAt(0).toUpperCase() + platform.slice(1)} instance`, help: __('Enter the domain of your', 'git-embed-feicode') + ' ' + platform.charAt(0).toUpperCase() + platform.slice(1) + ' ' + __('instance', 'git-embed-feicode'),
__next40pxDefaultSize: true, __next40pxDefaultSize: true,
__nextHasNoMarginBottom: true __nextHasNoMarginBottom: true
}), }),
@ -400,8 +408,8 @@
label: __('Custom Site Name (Optional)', 'git-embed-feicode'), label: __('Custom Site Name (Optional)', 'git-embed-feicode'),
value: customSiteName, value: customSiteName,
onChange: (value) => setAttributes({ customSiteName: value }), onChange: (value) => setAttributes({ customSiteName: value }),
placeholder: 'e.g. Company Git', placeholder: __('e.g. Company Git', 'git-embed-feicode'),
help: 'Override the automatically detected site name', help: __('Override the automatically detected site name', 'git-embed-feicode'),
__next40pxDefaultSize: true, __next40pxDefaultSize: true,
__nextHasNoMarginBottom: true __nextHasNoMarginBottom: true
}), }),
@ -409,7 +417,7 @@
label: __('Repository Owner', 'git-embed-feicode'), label: __('Repository Owner', 'git-embed-feicode'),
value: owner, value: owner,
onChange: (value) => setAttributes({ owner: value }), onChange: (value) => setAttributes({ owner: value }),
placeholder: 'e.g. facebook', placeholder: __('e.g. facebook', 'git-embed-feicode'),
__next40pxDefaultSize: true, __next40pxDefaultSize: true,
__nextHasNoMarginBottom: true __nextHasNoMarginBottom: true
}), }),
@ -417,7 +425,7 @@
label: __('Repository Name', 'git-embed-feicode'), label: __('Repository Name', 'git-embed-feicode'),
value: repo, value: repo,
onChange: (value) => setAttributes({ repo: value }), onChange: (value) => setAttributes({ repo: value }),
placeholder: 'e.g. react', placeholder: __('e.g. react', 'git-embed-feicode'),
__next40pxDefaultSize: true, __next40pxDefaultSize: true,
__nextHasNoMarginBottom: true __nextHasNoMarginBottom: true
}), }),
@ -426,7 +434,7 @@
onClick: fetchRepoData, onClick: fetchRepoData,
disabled: loading || !owner || !repo || disabled: loading || !owner || !repo ||
(platform !== 'github' && !customDomain) (platform !== 'github' && !customDomain)
}, loading ? 'Fetching...' : 'Fetch Repository') }, loading ? __('Fetching...', 'git-embed-feicode') : __('Fetch Repository', 'git-embed-feicode'))
), ),
el(PanelBody, { el(PanelBody, {
title: __('Display Options', 'git-embed-feicode'), title: __('Display Options', 'git-embed-feicode'),
@ -441,15 +449,15 @@
label: __('Show Avatar', 'git-embed-feicode'), label: __('Show Avatar', 'git-embed-feicode'),
checked: showAvatar, checked: showAvatar,
onChange: (value) => setAttributes({ showAvatar: value }), onChange: (value) => setAttributes({ showAvatar: value }),
help: 'Shows repository avatar if available, otherwise owner avatar' help: __('Shows repository avatar if available, otherwise owner avatar', 'git-embed-feicode')
}), }),
showAvatar && el(SelectControl, { showAvatar && el(SelectControl, {
label: __('Avatar Size', 'git-embed-feicode'), label: __('Avatar Size', 'git-embed-feicode'),
value: avatarSize, value: avatarSize,
options: [ options: [
{ label: 'Small', value: 'small' }, { label: __('Small', 'git-embed-feicode'), value: 'small' },
{ label: 'Medium', value: 'medium' }, { label: __('Medium', 'git-embed-feicode'), value: 'medium' },
{ label: 'Large', value: 'large' } { label: __('Large', 'git-embed-feicode'), value: 'large' }
], ],
onChange: (value) => setAttributes({ avatarSize: value }), onChange: (value) => setAttributes({ avatarSize: value }),
__next40pxDefaultSize: true, __next40pxDefaultSize: true,
@ -514,11 +522,11 @@
label: __('Button Style', 'git-embed-feicode'), label: __('Button Style', 'git-embed-feicode'),
value: buttonStyle, value: buttonStyle,
options: [ options: [
{ label: 'Default', value: 'default' }, { label: __('Default', 'git-embed-feicode'), value: 'default' },
{ label: 'Primary (Green)', value: 'primary' }, { label: __('Primary (Green)', 'git-embed-feicode'), value: 'primary' },
{ label: 'Secondary (Gray)', value: 'secondary' }, { label: __('Secondary (Gray)', 'git-embed-feicode'), value: 'secondary' },
{ label: 'Outline', value: 'outline' }, { label: __('Outline', 'git-embed-feicode'), value: 'outline' },
{ label: 'Ghost', value: 'ghost' } { label: __('Ghost', 'git-embed-feicode'), value: 'ghost' }
], ],
onChange: (value) => setAttributes({ buttonStyle: value }), onChange: (value) => setAttributes({ buttonStyle: value }),
disabled: !showActions, disabled: !showActions,
@ -529,9 +537,9 @@
label: __('Button Size', 'git-embed-feicode'), label: __('Button Size', 'git-embed-feicode'),
value: buttonSize, value: buttonSize,
options: [ options: [
{ label: 'Small', value: 'small' }, { label: __('Small', 'git-embed-feicode'), value: 'small' },
{ label: 'Medium', value: 'medium' }, { label: __('Medium', 'git-embed-feicode'), value: 'medium' },
{ label: 'Large', value: 'large' } { label: __('Large', 'git-embed-feicode'), value: 'large' }
], ],
onChange: (value) => setAttributes({ buttonSize: value }), onChange: (value) => setAttributes({ buttonSize: value }),
disabled: !showActions, disabled: !showActions,
@ -547,12 +555,12 @@
label: __('Card Style', 'git-embed-feicode'), label: __('Card Style', 'git-embed-feicode'),
value: cardStyle, value: cardStyle,
options: [ options: [
{ label: 'Default', value: 'default' }, { label: __('Default', 'git-embed-feicode'), value: 'default' },
{ label: 'Minimal', value: 'minimal' }, { label: __('Minimal', 'git-embed-feicode'), value: 'minimal' },
{ label: 'Bordered', value: 'bordered' }, { label: __('Bordered', 'git-embed-feicode'), value: 'bordered' },
{ label: 'Shadow', value: 'shadow' }, { label: __('Shadow', 'git-embed-feicode'), value: 'shadow' },
{ label: 'Gradient', value: 'gradient' }, { label: __('Gradient', 'git-embed-feicode'), value: 'gradient' },
{ label: 'Glassmorphism', value: 'glass' } { label: __('Glassmorphism', 'git-embed-feicode'), value: 'glass' }
], ],
onChange: (value) => setAttributes({ cardStyle: value }), onChange: (value) => setAttributes({ cardStyle: value }),
__next40pxDefaultSize: true, __next40pxDefaultSize: true,

File diff suppressed because it is too large Load diff

View file

@ -13,24 +13,129 @@
"Embed a Git repository with information and stats": [ "Embed a Git repository with information and stats": [
"嵌入包含信息和统计数据的 Git 仓库" "嵌入包含信息和统计数据的 Git 仓库"
], ],
"Please enter repository owner and name": [
"请输入仓库所有者和名称"
],
"Please enter custom domain for": [
"请输入自定义域名:"
],
"Failed to fetch repository": [
"获取仓库失败"
],
"Network error occurred": [
"网络错误"
],
"Fetching repository data...": [
"正在获取仓库数据..."
],
"Git Repository Embed": [
"Git 仓库嵌入"
],
"Configure your repository details in the sidebar": [
"在侧边栏配置您的仓库详情"
],
"Download": [
"下载"
],
"Download ZIP": [
"下载 ZIP"
],
"Repository Avatar": [
"仓库头像"
],
"Owner Avatar": [
"所有者头像"
],
"Repository has custom avatar": [
"仓库有自定义头像"
],
"Stars:": [
"星标:"
],
"Forks:": [
"分叉:"
],
"Issues:": [
"议题:"
],
"View Repository": [
"查看仓库"
],
"Clone URL:": [
"克隆链接:"
],
"Clone": [
"克隆"
],
"Issues": [
"议题"
],
"Forks": [
"分叉"
],
"Repository Settings": [ "Repository Settings": [
"仓库设置" "仓库设置"
], ],
"Platform": [ "Platform": [
"平台" "平台"
], ],
"GitHub": [
"GitHub"
],
"Gitea": [
"Gitea"
],
"Forgejo": [
"Forgejo"
],
"GitLab (Self-hosted)": [
"GitLab自托管"
],
"Custom Git Service": [
"自定义 Git 服务"
],
"Self-hosted Git service requires custom domain": [
"自托管 Git 服务需要自定义域名"
],
"Custom Domain": [ "Custom Domain": [
"自定义域名" "自定义域名"
], ],
"e.g. git.example.com": [
"例如git.example.com"
],
"Enter the domain of your": [
"输入您的"
],
"instance": [
"实例域名"
],
"Custom Site Name (Optional)": [ "Custom Site Name (Optional)": [
"自定义站点名称(可选)" "自定义站点名称(可选)"
], ],
"e.g. Company Git": [
"例如:公司 Git"
],
"Override the automatically detected site name": [
"覆盖自动检测的站点名称"
],
"Repository Owner": [ "Repository Owner": [
"仓库所有者" "仓库所有者"
], ],
"e.g. facebook": [
"例如facebook"
],
"Repository Name": [ "Repository Name": [
"仓库名称" "仓库名称"
], ],
"e.g. react": [
"例如react"
],
"Fetch Repository": [
"获取仓库"
],
"Fetching...": [
"正在获取..."
],
"Display Options": [ "Display Options": [
"显示选项" "显示选项"
], ],
@ -40,9 +145,21 @@
"Show Avatar": [ "Show Avatar": [
"显示头像" "显示头像"
], ],
"Shows repository avatar if available, otherwise owner avatar": [
"如果可用,显示仓库头像,否则显示所有者头像"
],
"Avatar Size": [ "Avatar Size": [
"头像大小" "头像大小"
], ],
"Small": [
"小"
],
"Medium": [
"中"
],
"Large": [
"大"
],
"Show Description": [ "Show Description": [
"显示描述" "显示描述"
], ],
@ -76,75 +193,6 @@
"Button Style": [ "Button Style": [
"按钮样式" "按钮样式"
], ],
"Button Size": [
"按钮大小"
],
"Style Options": [
"样式选项"
],
"Card Style": [
"卡片样式"
],
"Please enter repository owner and name": [
"请输入仓库所有者和名称"
],
"Please enter custom domain for %s": [
"请输入 %s 的自定义域名"
],
"Fetching repository data...": [
"正在获取仓库数据..."
],
"Failed to fetch repository": [
"获取仓库失败"
],
"Network error occurred": [
"网络错误"
],
"Configure your repository details in the sidebar": [
"在侧边栏配置您的仓库详情"
],
"Fetch Repository": [
"获取仓库"
],
"Fetching...": [
"正在获取..."
],
"Self-hosted Git service requires custom domain": [
"自托管 Git 服务需要自定义域名"
],
"Enter the domain of your %s instance": [
"输入您的 %s 实例域名"
],
"Override the automatically detected site name": [
"覆盖自动检测的站点名称"
],
"Shows repository avatar if available, otherwise owner avatar": [
"如果可用,显示仓库头像,否则显示所有者头像"
],
"GitHub": [
"GitHub"
],
"Gitea": [
"Gitea"
],
"Forgejo": [
"Forgejo"
],
"GitLab (Self-hosted)": [
"GitLab自托管"
],
"Custom Git Service": [
"自定义 Git 服务"
],
"Small": [
"小"
],
"Medium": [
"中"
],
"Large": [
"大"
],
"Default": [ "Default": [
"默认" "默认"
], ],
@ -160,6 +208,15 @@
"Ghost": [ "Ghost": [
"幽灵" "幽灵"
], ],
"Button Size": [
"按钮大小"
],
"Style Options": [
"样式选项"
],
"Card Style": [
"卡片样式"
],
"Minimal": [ "Minimal": [
"简约" "简约"
], ],
@ -174,6 +231,54 @@
], ],
"Glassmorphism": [ "Glassmorphism": [
"玻璃态" "玻璃态"
],
"Repository information required": [
"需要仓库信息"
],
"Custom domain required for %s": [
"%s 需要自定义域名"
],
"Failed to fetch repository data": [
"获取仓库数据失败"
],
"Latest Code": [
"最新代码"
],
"Git Service": [
"Git 服务"
],
"Organization": [
"组织"
],
"User": [
"用户"
],
"Download %s (%s)": [
"下载 %s (%s)"
],
"Download %s": [
"下载 %s"
],
"Issues (%s)": [
"议题 (%s)"
],
"Forks (%s)": [
"分叉 (%s)"
],
"Click to copy clone URL": [
"点击复制克隆链接"
],
"Copied!": [
"已复制!"
],
"Please enter custom domain for %s": [
"请输入 %s 的自定义域名"
],
"Insufficient permissions": [
"权限不足"
],
"Cache cleared successfully": [
"缓存清理成功"
] ]
} }
} }

Binary file not shown.

View file

@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: Git Embed for feiCode 1.0.1\n" "Project-Id-Version: Git Embed for feiCode 1.0.1\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-embed-feicode\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-embed-feicode\n"
"POT-Creation-Date: 2024-12-31 12:00+0000\n" "POT-Creation-Date: 2024-12-31 12:00+0000\n"
"PO-Revision-Date: 2025-07-31 17:43+0800\n" "PO-Revision-Date: 2025-08-01 01:09+0800\n"
"Last-Translator: feiCode Team\n" "Last-Translator: feiCode Team\n"
"Language-Team: Chinese (China)\n" "Language-Team: Chinese (China)\n"
"Language: zh_CN\n" "Language: zh_CN\n"
@ -200,6 +200,9 @@ msgstr "查看仓库"
msgid "Clone" msgid "Clone"
msgstr "克隆" msgstr "克隆"
msgid "Download %s (%s)"
msgstr "下载 %s (%s)"
msgid "Download ZIP" msgid "Download ZIP"
msgstr "下载 ZIP" msgstr "下载 ZIP"

View file

@ -1,141 +1,338 @@
# Copyright (C) 2024 feiCode # Copyright (C) 2024 feiCode
# This file is distributed under the same license as the Git Embed for feiCode plugin. # This file is distributed under the same license as the Git Embed for feiCode plugin.
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Git Embed for feiCode 1.0.1\n" "Project-Id-Version: Git Embed for feiCode 1.0.2\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-embed-feicode\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/git-embed-feicode\n"
"POT-Creation-Date: 2024-12-31 12:00+0000\n" "POT-Creation-Date: 2024-12-31 12:00+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"X-Generator: WordPress POT Generator\n" "Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#. Plugin Name of the plugin/theme #. Plugin Name of the plugin/theme
msgid "Git Embed for feiCode" msgid "Git Embed for feiCode"
msgstr "" msgstr ""
#. Plugin Description of the plugin/theme #. Plugin Description of the plugin/theme
msgid "Embed Git repositories from GitHub/Gitlab/Gitea/Forgejo and Self-hosted Git service with beautiful cards msgid "Embed Git repositories from GitHub/Gitlab/Gitea/Forgejo and Self-hosted Git service with beautiful cards"
"
msgstr "" msgstr ""
#. Author of the plugin/theme #. Author of the plugin/theme
msgid "feiCode" msgid "feiCode"
msgstr "" msgstr ""
#: block.js:15 #: assets/block.js:15
msgid "Git Repository" msgid "Git Repository"
msgstr "" msgstr ""
#: block.js:16 #: assets/block.js:16
msgid "Embed a Git repository with information and stats" msgid "Embed a Git repository with information and stats"
msgstr "" msgstr ""
#: block.js:170 #: assets/block.js:85
msgid "Please enter repository owner and name"
msgstr ""
#: assets/block.js:89
msgid "Please enter custom domain for"
msgstr ""
#: assets/block.js:104
msgid "Failed to fetch repository"
msgstr ""
#: assets/block.js:109
msgid "Network error occurred"
msgstr ""
#: assets/block.js:127
msgid "Fetching repository data..."
msgstr ""
#: assets/block.js:140
msgid "Git Repository Embed"
msgstr ""
#: assets/block.js:141
msgid "Configure your repository details in the sidebar"
msgstr ""
#: assets/block.js:152
msgid "Download"
msgstr ""
#: assets/block.js:153
msgid "Download ZIP"
msgstr ""
#: assets/block.js:177
msgid "Repository Avatar"
msgstr ""
#: assets/block.js:177
msgid "Owner Avatar"
msgstr ""
#: assets/block.js:197
msgid "Repository has custom avatar"
msgstr ""
#: assets/block.js:217
msgid "Stars:"
msgstr ""
#: assets/block.js:221
msgid "Forks:"
msgstr ""
#: assets/block.js:225
msgid "Issues:"
msgstr ""
#: assets/block.js:237
msgid "View Repository"
msgstr ""
#: assets/block.js:241
msgid "Clone URL:"
msgstr ""
#: assets/block.js:244
msgid "Clone"
msgstr ""
#: assets/block.js:260
msgid "Issues"
msgstr ""
#: assets/block.js:268
msgid "Forks"
msgstr ""
#: assets/block.js:281
msgid "Repository Settings" msgid "Repository Settings"
msgstr "" msgstr ""
#: block.js:174 #: assets/block.js:285
msgid "Platform" msgid "Platform"
msgstr "" msgstr ""
#: block.js:185 #: assets/block.js:287
msgid "GitHub"
msgstr ""
#: assets/block.js:288
msgid "Gitea"
msgstr ""
#: assets/block.js:289
msgid "Forgejo"
msgstr ""
#: assets/block.js:290
msgid "GitLab (Self-hosted)"
msgstr ""
#: assets/block.js:291
msgid "Custom Git Service"
msgstr ""
#: assets/block.js:294
msgid "Self-hosted Git service requires custom domain"
msgstr ""
#: assets/block.js:299
msgid "Custom Domain" msgid "Custom Domain"
msgstr "" msgstr ""
#: block.js:195 #: assets/block.js:302
msgid "e.g. git.example.com"
msgstr ""
#: assets/block.js:303
msgid "Enter the domain of your"
msgstr ""
#: assets/block.js:303
msgid "instance"
msgstr ""
#: assets/block.js:308
msgid "Custom Site Name (Optional)" msgid "Custom Site Name (Optional)"
msgstr "" msgstr ""
#: block.js:205 #: assets/block.js:311
msgid "e.g. Company Git"
msgstr ""
#: assets/block.js:312
msgid "Override the automatically detected site name"
msgstr ""
#: assets/block.js:317
msgid "Repository Owner" msgid "Repository Owner"
msgstr "" msgstr ""
#: block.js:214 #: assets/block.js:320
msgid "e.g. facebook"
msgstr ""
#: assets/block.js:325
msgid "Repository Name" msgid "Repository Name"
msgstr "" msgstr ""
#: block.js:227 #: assets/block.js:328
msgid "e.g. react"
msgstr ""
#: assets/block.js:336
msgid "Fetch Repository"
msgstr ""
#: assets/block.js:336
msgid "Fetching..."
msgstr ""
#: assets/block.js:339
msgid "Display Options" msgid "Display Options"
msgstr "" msgstr ""
#: block.js:231 #: assets/block.js:343
msgid "Show Site Information" msgid "Show Site Information"
msgstr "" msgstr ""
#: block.js:235 #: assets/block.js:347
msgid "Show Avatar" msgid "Show Avatar"
msgstr "" msgstr ""
#: block.js:240 #: assets/block.js:350
msgid "Shows repository avatar if available, otherwise owner avatar"
msgstr ""
#: assets/block.js:353
msgid "Avatar Size" msgid "Avatar Size"
msgstr "" msgstr ""
#: block.js:252 #: assets/block.js:355
msgid "Small"
msgstr ""
#: assets/block.js:356
msgid "Medium"
msgstr ""
#: assets/block.js:357
msgid "Large"
msgstr ""
#: assets/block.js:364
msgid "Show Description" msgid "Show Description"
msgstr "" msgstr ""
#: block.js:256 #: assets/block.js:368
msgid "Show Programming Language" msgid "Show Programming Language"
msgstr "" msgstr ""
#: block.js:260 #: assets/block.js:372
msgid "Show Statistics" msgid "Show Statistics"
msgstr "" msgstr ""
#: block.js:264 #: assets/block.js:376
msgid "Show Action Buttons" msgid "Show Action Buttons"
msgstr "" msgstr ""
#: block.js:269 #: assets/block.js:380
msgid "Button Options" msgid "Button Options"
msgstr "" msgstr ""
#: block.js:273 #: assets/block.js:384
msgid "Show View Repository Button" msgid "Show View Repository Button"
msgstr "" msgstr ""
#: block.js:278 #: assets/block.js:389
msgid "Show Clone Button" msgid "Show Clone Button"
msgstr "" msgstr ""
#: block.js:283 #: assets/block.js:394
msgid "Show Download ZIP Button" msgid "Show Download ZIP Button"
msgstr "" msgstr ""
#: block.js:288 #: assets/block.js:399
msgid "Show Issues Button" msgid "Show Issues Button"
msgstr "" msgstr ""
#: block.js:293 #: assets/block.js:404
msgid "Show Forks Button" msgid "Show Forks Button"
msgstr "" msgstr ""
#: block.js:298 #: assets/block.js:409
msgid "Button Style" msgid "Button Style"
msgstr "" msgstr ""
#: block.js:312 #: assets/block.js:411
msgid "Default"
msgstr ""
#: assets/block.js:412
msgid "Primary (Green)"
msgstr ""
#: assets/block.js:413
msgid "Secondary (Gray)"
msgstr ""
#: assets/block.js:414
msgid "Outline"
msgstr ""
#: assets/block.js:415
msgid "Ghost"
msgstr ""
#: assets/block.js:422
msgid "Button Size" msgid "Button Size"
msgstr "" msgstr ""
#: block.js:326 #: assets/block.js:433
msgid "Style Options" msgid "Style Options"
msgstr "" msgstr ""
#: block.js:330 #: assets/block.js:437
msgid "Card Style" msgid "Card Style"
msgstr "" msgstr ""
#: assets/block.js:440
msgid "Minimal"
msgstr ""
#: assets/block.js:441
msgid "Bordered"
msgstr ""
#: assets/block.js:442
msgid "Shadow"
msgstr ""
#: assets/block.js:443
msgid "Gradient"
msgstr ""
#: assets/block.js:444
msgid "Glassmorphism"
msgstr ""
#: git-embed-feicode.php:85 #: git-embed-feicode.php:85
msgid "Repository information required" msgid "Repository information required"
msgstr "" msgstr ""
#: git-embed-feicode.php:89 #: git-embed-feicode.php:89
#, php-format
msgid "Custom domain required for %s" msgid "Custom domain required for %s"
msgstr "" msgstr ""
@ -143,154 +340,75 @@ msgstr ""
msgid "Failed to fetch repository data" msgid "Failed to fetch repository data"
msgstr "" msgstr ""
#: git-embed-feicode.php:672 #: git-embed-feicode.php:246
msgid "Insufficient permissions" msgid "Latest Code"
msgstr "" msgstr ""
#: git-embed-feicode.php:684 #: git-embed-feicode.php:429
msgid "Cache cleared successfully" msgid "Git Service"
msgstr "" msgstr ""
#. Error messages #: git-embed-feicode.php:537
msgid "Please enter repository owner and name"
msgstr ""
#, javascript-format
msgid "Please enter custom domain for %s"
msgstr ""
msgid "Fetching repository data..."
msgstr ""
msgid "Failed to fetch repository"
msgstr ""
msgid "Network error occurred"
msgstr ""
msgid "Configure your repository details in the sidebar"
msgstr ""
msgid "Fetch Repository"
msgstr ""
msgid "Fetching..."
msgstr ""
#. Help texts
msgid "Self-hosted Git service requires custom domain"
msgstr ""
#, javascript-format
msgid "Enter the domain of your %s instance"
msgstr ""
msgid "Override the automatically detected site name"
msgstr ""
msgid "Shows repository avatar if available, otherwise owner avatar"
msgstr ""
#. Button labels
msgid "View Repository"
msgstr ""
msgid "Clone"
msgstr ""
msgid "Download ZIP"
msgstr ""
msgid "Issues"
msgstr ""
msgid "Forks"
msgstr ""
msgid "Copied!"
msgstr ""
#. Stats labels
msgid "Stars:"
msgstr ""
msgid "Forks:"
msgstr ""
msgid "Issues:"
msgstr ""
#. Options
msgid "GitHub"
msgstr ""
msgid "Gitea"
msgstr ""
msgid "Forgejo"
msgstr ""
msgid "GitLab (Self-hosted)"
msgstr ""
msgid "Custom Git Service"
msgstr ""
msgid "Small"
msgstr ""
msgid "Medium"
msgstr ""
msgid "Large"
msgstr ""
msgid "Default"
msgstr ""
msgid "Primary (Green)"
msgstr ""
msgid "Secondary (Gray)"
msgstr ""
msgid "Outline"
msgstr ""
msgid "Ghost"
msgstr ""
msgid "Minimal"
msgstr ""
msgid "Bordered"
msgstr ""
msgid "Shadow"
msgstr ""
msgid "Gradient"
msgstr ""
msgid "Glassmorphism"
msgstr ""
#. Tooltips and titles
msgid "Click to copy clone URL"
msgstr ""
msgid "Repository Avatar"
msgstr ""
msgid "Owner Avatar"
msgstr ""
msgid "Repository has custom avatar"
msgstr ""
#. Owner types
msgid "Organization" msgid "Organization"
msgstr "" msgstr ""
#: git-embed-feicode.php:542
msgid "User" msgid "User"
msgstr "" msgstr ""
#: git-embed-feicode.php:617
#, php-format
msgid "Download %s (%s)"
msgstr ""
#: git-embed-feicode.php:625
msgid "Download ZIP"
msgstr ""
#: git-embed-feicode.php:679
msgid "View Repository"
msgstr ""
#: git-embed-feicode.php:687
msgid "Clone"
msgstr ""
#: git-embed-feicode.php:698
#, php-format
msgid "Download %s"
msgstr ""
#: git-embed-feicode.php:705
#, php-format
msgid "Issues (%s)"
msgstr ""
#: git-embed-feicode.php:714
#, php-format
msgid "Forks (%s)"
msgstr ""
#: git-embed-feicode.php:754
msgid "Click to copy clone URL"
msgstr ""
#: git-embed-feicode.php:798
msgid "Copied!"
msgstr ""
#: git-embed-feicode.php:816
msgid "Please enter repository owner and name"
msgstr ""
#: git-embed-feicode.php:820
#, php-format
msgid "Please enter custom domain for %s"
msgstr ""
#: git-embed-feicode.php:832
msgid "Insufficient permissions"
msgstr ""
#: git-embed-feicode.php:844
msgid "Cache cleared successfully"
msgstr ""

View file

@ -0,0 +1,35 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Git Embed for feiCode\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-31 16:41+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: \n"
"Language: \n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.8.0; wp-6.8.2; php-8.3.0-dev\n"
"X-Domain: git-embed-feicode"
#. Description of the plugin
msgid ""
"Embed Git repositories from GitHub/Gitlab/Gitea/Forgejo and Self-hosted Git "
"service with beautiful cards"
msgstr ""
#. Author of the plugin
msgid "feiCode"
msgstr ""
#. Name of the plugin
msgid "Git Embed for feiCode"
msgstr ""
#. Author URI of the plugin
msgid "https://cn.feicode.com"
msgstr ""