You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
167 lines
9.7 KiB
PHP
167 lines
9.7 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Source-language manifest for user-visible interface copy.
|
|
*
|
|
* Only stable keys, Chinese safety baselines and rendering metadata belong
|
|
* here. English and every other target-locale translation are maintained by
|
|
* administrators and must never be committed to this source manifest.
|
|
*/
|
|
$entry = require __DIR__ . '/entry.php';
|
|
$manifestCommon = static function (
|
|
string $key,
|
|
string $source,
|
|
string $kind = 'label',
|
|
array $parameters = [],
|
|
string $criticality = 'required',
|
|
?string $toastTone = null,
|
|
?string $editorSurface = null,
|
|
?string $editorGroup = null
|
|
) use ($entry): array {
|
|
return $entry(
|
|
$key,
|
|
'common',
|
|
'cloud.instances',
|
|
$source,
|
|
$kind,
|
|
$parameters,
|
|
$criticality,
|
|
false,
|
|
$toastTone,
|
|
$editorSurface,
|
|
$editorGroup
|
|
);
|
|
};
|
|
|
|
$pageEntries = [];
|
|
$pageEntryFiles = glob(__DIR__ . '/entries/*.php');
|
|
if (is_array($pageEntryFiles)) {
|
|
sort($pageEntryFiles, SORT_STRING);
|
|
foreach ($pageEntryFiles as $pageEntryFile) {
|
|
$fragment = require $pageEntryFile;
|
|
if (!is_array($fragment) || !array_is_list($fragment)) {
|
|
throw new RuntimeException(
|
|
'用户界面文案分片必须返回词条列表:' . $pageEntryFile
|
|
);
|
|
}
|
|
array_push($pageEntries, ...$fragment);
|
|
}
|
|
}
|
|
|
|
// Entry fragments share this file scope and may use a local $common helper.
|
|
// Restore the manifest helper after loading them so the shared shell entries
|
|
// below always use the same editor metadata policy as every other fragment.
|
|
$common = $manifestCommon;
|
|
|
|
return [
|
|
'version' => 1,
|
|
'pages' => [
|
|
'auth.login' => ['label' => '登录页', 'scopes' => ['common', 'auth']],
|
|
'auth.password' => ['label' => '重置密码页', 'scopes' => ['common', 'auth']],
|
|
'auth.register' => ['label' => '注册页', 'scopes' => ['common', 'auth']],
|
|
'cloud.backups' => ['label' => '云备份页', 'scopes' => ['common', 'backups']],
|
|
'cloud.deploy' => ['label' => '实例部署页', 'scopes' => ['common', 'deploy']],
|
|
'cloud.detail' => ['label' => '实例详情页', 'scopes' => ['common', 'instance_detail']],
|
|
'cloud.invoice_detail' => ['label' => '账单详情页', 'scopes' => ['common', 'billing']],
|
|
'cloud.invoices' => ['label' => '账单列表页', 'scopes' => ['common', 'billing']],
|
|
'cloud.instances' => ['label' => '实例列表页', 'scopes' => ['common', 'instances']],
|
|
'cloud.isos' => ['label' => 'ISO镜像页', 'scopes' => ['common', 'isos']],
|
|
'cloud.keys' => ['label' => 'SSH公钥页', 'scopes' => ['common', 'ssh_keys']],
|
|
'cloud.reinstall' => ['label' => '重装系统页', 'scopes' => ['common', 'reinstall']],
|
|
'cloud.snapshots' => ['label' => '云快照页', 'scopes' => ['common', 'snapshots']],
|
|
'cloud.traffic' => ['label' => '流量池页', 'scopes' => ['common', 'traffic']],
|
|
'cloud.vpcs' => ['label' => 'VPC私网页', 'scopes' => ['common', 'vpc']],
|
|
'legal.privacy' => ['label' => '隐私政策页', 'scopes' => ['common', 'legal']],
|
|
'legal.terms' => ['label' => '服务条款页', 'scopes' => ['common', 'legal']],
|
|
'public.error' => ['label' => '公共错误页', 'scopes' => ['common', 'public_error']],
|
|
'public.home' => ['label' => '落地页', 'scopes' => ['common', 'home']],
|
|
'user.account' => ['label' => '账户设置页', 'scopes' => ['common', 'account']],
|
|
'user.announcements' => ['label' => '公告抽屉', 'scopes' => ['common', 'announcements']],
|
|
'user.invite' => ['label' => '推广页', 'scopes' => ['common', 'invite']],
|
|
'user.recharge' => ['label' => '充值页', 'scopes' => ['common', 'recharge']],
|
|
'user.tasks' => ['label' => '任务中心', 'scopes' => ['common', 'tasks']],
|
|
'user.tickets' => ['label' => '工单页', 'scopes' => ['common', 'tickets']],
|
|
],
|
|
'entries' => array_merge([
|
|
$common('common.shell.user_center', '用户中心', 'navigation'),
|
|
$common('common.shell.sidebar.aria', '用户中心侧栏', 'aria_label'),
|
|
$common('common.shell.navigation.aria', '用户中心主导航', 'aria_label'),
|
|
$common('common.shell.navigation.toggle', '导航', 'button'),
|
|
$common('common.shell.navigation.expand.aria', '展开用户中心导航', 'aria_label'),
|
|
$common('common.shell.navigation.collapse.aria', '收起用户中心导航', 'aria_label'),
|
|
$common('common.shell.section.cloud', '云资源', 'navigation'),
|
|
$common('common.shell.section.support', '支持', 'navigation'),
|
|
$common('common.shell.nav.instances', '我的实例', 'navigation'),
|
|
$common('common.shell.nav.deploy', '部署实例', 'navigation'),
|
|
$common('common.shell.nav.backups', '云备份', 'navigation'),
|
|
$common('common.shell.nav.snapshots', '云快照', 'navigation'),
|
|
$common('common.shell.nav.traffic', '流量池', 'navigation'),
|
|
$common('common.shell.nav.vpc', 'VPC 私网', 'navigation'),
|
|
$common('common.shell.nav.iso', 'ISO 上传', 'navigation'),
|
|
$common('common.shell.nav.ssh_keys', 'SSH 公钥', 'navigation'),
|
|
$common('common.shell.nav.billing', '账单信息', 'navigation'),
|
|
$common('common.shell.nav.tickets', '工单支持', 'navigation'),
|
|
$common('common.shell.nav.admin', '管理员后台', 'navigation'),
|
|
$common('common.shell.nav.logout', '退出登录', 'navigation'),
|
|
$common('common.shell.task_center.open.aria', '打开任务中心', 'aria_label'),
|
|
$common('common.shell.task_center.title', '任务中心', 'tooltip'),
|
|
$common('common.shell.announcements.open.aria', '查看公告与维护信息', 'aria_label'),
|
|
$common('common.shell.announcements.title', '公告与维护信息', 'tooltip'),
|
|
$common('common.shell.account.menu.aria', '打开账户菜单', 'aria_label'),
|
|
$common('common.shell.account.menu', '账户菜单', 'aria_label'),
|
|
$common('common.shell.account.fallback', '账户', 'label'),
|
|
$common('common.shell.account.settings', '账户设置', 'navigation'),
|
|
$common('common.shell.account.settings.description', '管理双重认证、登录邮箱和密码', 'description'),
|
|
$common('common.shell.account.balance', '余额充值', 'navigation'),
|
|
$common('common.shell.account.balance.description', '选择充值金额和可用支付方式', 'description'),
|
|
$common('common.shell.account.promotion', '推广', 'navigation'),
|
|
$common('common.shell.account.promotion.description', '分享邀请链接并查看推广返利', 'description'),
|
|
$common('common.shell.language.aria', '选择语言', 'aria_label'),
|
|
$common('common.shell.language.chinese', '简体中文', 'label'),
|
|
$common('common.shell.language.english', '英语', 'label'),
|
|
$common('common.shell.powered_by', '由 libvirt 提供虚拟化支持', 'description'),
|
|
$common('common.theme.light', '亮色', 'label'),
|
|
$common('common.theme.dark', '暗色', 'label'),
|
|
$common('common.dialog.confirm.title', '确认操作', 'title'),
|
|
$common('common.dialog.confirm.body', '确认继续?', 'confirmation'),
|
|
$common('common.dialog.cancel', '取消', 'button'),
|
|
$common('common.dialog.confirm', '确认', 'button'),
|
|
$common('common.dialog.acknowledge', '知道了', 'button'),
|
|
$common('common.request.submitted', '操作已提交', 'status'),
|
|
$common('common.service.date_unavailable', '暂未提供', 'status'),
|
|
$common('common.service.unlimited', '长期有效', 'status'),
|
|
$common('common.error.bootstrap_invalid',
|
|
'页面初始数据无效,请刷新后重试。', 'warning'),
|
|
$common('common.error.bootstrap_missing',
|
|
'页面初始数据缺失,请刷新后重试。', 'warning'),
|
|
$common('common.error.copy',
|
|
'浏览器无法复制,请手动选择文本。', 'warning'),
|
|
$common('common.error.secure_transport',
|
|
'请通过 HTTPS 使用登录凭据和虚拟机控制功能。', 'warning'),
|
|
$common('common.error.non_json',
|
|
'服务返回了无效数据,请稍后重试。', 'warning'),
|
|
$common('common.error.login_expired', '登录已过期,请重新登录。', 'warning'),
|
|
$common('common.error.invalid_input', '输入内容无效,请检查后重试。', 'warning'),
|
|
$common('common.error.request',
|
|
'请求失败(状态码 {status}),请稍后重试。',
|
|
'warning', ['status' => 'integer']),
|
|
$common('common.error.unexpected_status',
|
|
'请求已送达,但服务返回了意外状态({status})。请勿重复提交,并联系管理员核查。',
|
|
'warning', ['status' => 'integer'], 'critical'),
|
|
$common('common.error.task_receipt_invalid',
|
|
'请求已送达,但任务回执协议无效。请勿重复提交,并联系管理员核查。',
|
|
'warning'),
|
|
$common('common.copy.empty', '没有可复制的内容', 'notice'),
|
|
$common('common.copy.failed', '复制失败,请手动复制', 'warning'),
|
|
$common('common.toast.close.aria', '关闭提示', 'aria_label'),
|
|
$common('common.toast.error.title', '操作失败', 'toast_title', [],
|
|
'required', 'error'),
|
|
$common('common.toast.success.body', '操作已完成。', 'toast_body', [],
|
|
'required', 'success'),
|
|
$common('common.toast.success.title', '操作完成', 'toast_title', [],
|
|
'required', 'success'),
|
|
$common('common.toast.warning.title', '请注意', 'toast_title', [],
|
|
'required', 'warning'),
|
|
], $pageEntries),
|
|
];
|