diff --git a/app/components/Package/TrendsChart.vue b/app/components/Package/TrendsChart.vue index 2baaacc0e..5b239ee56 100644 --- a/app/components/Package/TrendsChart.vue +++ b/app/components/Package/TrendsChart.vue @@ -1495,6 +1495,8 @@ const chartConfig = computed(() => { annotator: $t('package.trends.toggle_annotator'), stack: $t('package.trends.toggle_stack_mode'), altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependant on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame. + open: $t('package.trends.open_options'), + close: $t('package.trends.close_options'), }, callbacks: { img: args => { diff --git a/app/components/Package/VersionDistribution.vue b/app/components/Package/VersionDistribution.vue index bb6e7e029..ce5456f89 100644 --- a/app/components/Package/VersionDistribution.vue +++ b/app/components/Package/VersionDistribution.vue @@ -201,6 +201,8 @@ const chartConfig = computed(() => { svg: $t('package.trends.download_file', { fileType: 'SVG' }), annotator: $t('package.trends.toggle_annotator'), altCopy: $t('package.trends.copy_alt.button_label'), // Do not make this text dependant on the `copied` variable, since this would re-render the component, which is undesirable if the minimap was used to select a time frame. + open: $t('package.trends.open_options'), + close: $t('package.trends.close_options'), }, callbacks: { img: args => { diff --git a/app/error.vue b/app/error.vue index 32c82ed73..2d0b94965 100644 --- a/app/error.vue +++ b/app/error.vue @@ -5,20 +5,20 @@ const props = defineProps<{ error: NuxtError }>() -const status = computed(() => props.error.statusCode || 500) +const status = computed(() => props.error.status || 500) const statusText = computed(() => { - if (props.error.statusMessage) return props.error.statusMessage + if (props.error.statusText) return props.error.statusText switch (status.value) { case 401: - return 'Unauthorized' + return $t('error.401') case 404: - return 'Page not found' + return $t('error.404') case 500: - return 'Internal server error' + return $t('error.500') case 503: - return 'Service unavailable' + return $t('error.503') default: - return 'Something went wrong' + return $t('error.default') } }) diff --git a/i18n/locales/en.json b/i18n/locales/en.json index 34d88abaa..5dc9cd59c 100644 --- a/i18n/locales/en.json +++ b/i18n/locales/en.json @@ -122,6 +122,13 @@ "edit_on_github": "Edit on GitHub", "view_guide": "Translation guide" }, + "error": { + "401": "Unauthorized", + "404": "Page not found", + "500": "Internal server error", + "503": "Service unavailable", + "default": "Something went wrong" + }, "common": { "loading": "Loading...", "loading_more": "Loading more...", @@ -399,6 +406,8 @@ "download_file": "Download {fileType}", "toggle_annotator": "Toggle annotator", "toggle_stack_mode": "Toggle stack mode", + "open_options": "Open options", + "close_options": "Close options", "legend_estimation": "Estimation", "no_data": "No data available", "y_axis_label": "{granularity} {facet}", diff --git a/i18n/locales/zh-CN.json b/i18n/locales/zh-CN.json index 023656988..6e4987bef 100644 --- a/i18n/locales/zh-CN.json +++ b/i18n/locales/zh-CN.json @@ -122,6 +122,13 @@ "edit_on_github": "在 GitHub 上编辑", "view_guide": "翻译指南" }, + "error": { + "401": "未授权", + "404": "很抱歉,页面未找到", + "500": "服务器内部错误", + "503": "服务不可用", + "default": "抱歉,出现了一些问题" + }, "common": { "loading": "加载中…", "loading_more": "加载更多中…", @@ -144,7 +151,28 @@ "role": "角色", "members": "成员" }, - "scroll_to_top": "回到顶部" + "scroll_to_top": "回到顶部", + "cancel": "取消", + "save": "保存", + "edit": "编辑", + "error": "加载出错" + }, + "profile": { + "display_name": "显示名称", + "description": "简介", + "no_description": "暂无简介", + "website": "网站", + "website_placeholder": "https://example.com", + "likes": "喜欢", + "seo_title": "{handle} - npmx", + "seo_description": "{handle} 的 npmx 个人资料", + "not_found": "未找到个人资料", + "not_found_message": "找不到 {handle} 的个人资料。", + "invite": { + "message": "看起来他们还没有使用 npmx,去邀请一下?", + "share_button": "分享到 Bluesky", + "compose_text": "嗨 {'@'}{handle}!您用过 npmx.dev 吗?它是一个快速、现代且开源的 npm registry 浏览器。\nhttps://npmx.dev" + } }, "package": { "not_found": "未找到包", @@ -378,6 +406,8 @@ "download_file": "下载 {fileType}", "toggle_annotator": "切换标注工具", "toggle_stack_mode": "切换堆叠模式", + "open_options": "展开选项", + "close_options": "收起选项", "legend_estimation": "估算值", "no_data": "无可用数据", "y_axis_label": "{granularity} {facet}", @@ -879,7 +909,7 @@ "governance": "治理", "role_steward": "管理者", "role_maintainer": "维护者", - "sponsor": "赞助者", + "sponsor": "赞助", "sponsor_aria": "在 GitHub 上赞助 {name}" }, "contributors": { @@ -933,7 +963,8 @@ "connect_bluesky": "使用 Bluesky 账户登录", "what_is_atmosphere": "什么是 Atmosphere 账户?", "atmosphere_explanation": "{npmx} 使用 {atproto} 为其多项社交功能提供支持,让用户真正拥有自己的数据并使用一个账户登录所有兼容的应用。一旦创建账户,你便可以使用其他应用,例如 {bluesky} 和 {tangled}。", - "default_input_error": "请输入有效的 handle、DID 或完整的 PDS URL" + "default_input_error": "请输入有效的 handle、DID 或完整的 PDS URL", + "profile": "个人资料" } }, "header": { diff --git a/i18n/schema.json b/i18n/schema.json index 36795db2b..a0e55809b 100644 --- a/i18n/schema.json +++ b/i18n/schema.json @@ -370,6 +370,27 @@ }, "additionalProperties": false }, + "error": { + "type": "object", + "properties": { + "401": { + "type": "string" + }, + "404": { + "type": "string" + }, + "500": { + "type": "string" + }, + "503": { + "type": "string" + }, + "default": { + "type": "string" + } + }, + "additionalProperties": false + }, "common": { "type": "object", "properties": { @@ -1201,6 +1222,12 @@ "toggle_stack_mode": { "type": "string" }, + "open_options": { + "type": "string" + }, + "close_options": { + "type": "string" + }, "legend_estimation": { "type": "string" }, diff --git a/lunaria/files/en-GB.json b/lunaria/files/en-GB.json index 42611bf9e..c3b2337a5 100644 --- a/lunaria/files/en-GB.json +++ b/lunaria/files/en-GB.json @@ -121,6 +121,13 @@ "edit_on_github": "Edit on GitHub", "view_guide": "Translation guide" }, + "error": { + "401": "Unauthorized", + "404": "Page not found", + "500": "Internal server error", + "503": "Service unavailable", + "default": "Something went wrong" + }, "common": { "loading": "Loading...", "loading_more": "Loading more...", @@ -398,6 +405,8 @@ "download_file": "Download {fileType}", "toggle_annotator": "Toggle annotator", "toggle_stack_mode": "Toggle stack mode", + "open_options": "Open options", + "close_options": "Close options", "legend_estimation": "Estimation", "no_data": "No data available", "y_axis_label": "{granularity} {facet}", diff --git a/lunaria/files/en-US.json b/lunaria/files/en-US.json index a63a6cba4..c36ca1489 100644 --- a/lunaria/files/en-US.json +++ b/lunaria/files/en-US.json @@ -121,6 +121,13 @@ "edit_on_github": "Edit on GitHub", "view_guide": "Translation guide" }, + "error": { + "401": "Unauthorized", + "404": "Page not found", + "500": "Internal server error", + "503": "Service unavailable", + "default": "Something went wrong" + }, "common": { "loading": "Loading...", "loading_more": "Loading more...", @@ -398,6 +405,8 @@ "download_file": "Download {fileType}", "toggle_annotator": "Toggle annotator", "toggle_stack_mode": "Toggle stack mode", + "open_options": "Open options", + "close_options": "Close options", "legend_estimation": "Estimation", "no_data": "No data available", "y_axis_label": "{granularity} {facet}", diff --git a/lunaria/files/zh-CN.json b/lunaria/files/zh-CN.json index 4228cfec0..b641306c7 100644 --- a/lunaria/files/zh-CN.json +++ b/lunaria/files/zh-CN.json @@ -121,6 +121,13 @@ "edit_on_github": "在 GitHub 上编辑", "view_guide": "翻译指南" }, + "error": { + "401": "未授权", + "404": "很抱歉,页面未找到", + "500": "服务器内部错误", + "503": "服务不可用", + "default": "抱歉,出现了一些问题" + }, "common": { "loading": "加载中…", "loading_more": "加载更多中…", @@ -143,7 +150,28 @@ "role": "角色", "members": "成员" }, - "scroll_to_top": "回到顶部" + "scroll_to_top": "回到顶部", + "cancel": "取消", + "save": "保存", + "edit": "编辑", + "error": "加载出错" + }, + "profile": { + "display_name": "显示名称", + "description": "简介", + "no_description": "暂无简介", + "website": "网站", + "website_placeholder": "https://example.com", + "likes": "喜欢", + "seo_title": "{handle} - npmx", + "seo_description": "{handle} 的 npmx 个人资料", + "not_found": "未找到个人资料", + "not_found_message": "找不到 {handle} 的个人资料。", + "invite": { + "message": "看起来他们还没有使用 npmx,去邀请一下?", + "share_button": "分享到 Bluesky", + "compose_text": "嗨 {'@'}{handle}!您用过 npmx.dev 吗?它是一个快速、现代且开源的 npm registry 浏览器。\nhttps://npmx.dev" + } }, "package": { "not_found": "未找到包", @@ -377,6 +405,8 @@ "download_file": "下载 {fileType}", "toggle_annotator": "切换标注工具", "toggle_stack_mode": "切换堆叠模式", + "open_options": "展开选项", + "close_options": "收起选项", "legend_estimation": "估算值", "no_data": "无可用数据", "y_axis_label": "{granularity} {facet}", @@ -878,7 +908,7 @@ "governance": "治理", "role_steward": "管理者", "role_maintainer": "维护者", - "sponsor": "赞助者", + "sponsor": "赞助", "sponsor_aria": "在 GitHub 上赞助 {name}" }, "contributors": { @@ -932,7 +962,8 @@ "connect_bluesky": "使用 Bluesky 账户登录", "what_is_atmosphere": "什么是 Atmosphere 账户?", "atmosphere_explanation": "{npmx} 使用 {atproto} 为其多项社交功能提供支持,让用户真正拥有自己的数据并使用一个账户登录所有兼容的应用。一旦创建账户,你便可以使用其他应用,例如 {bluesky} 和 {tangled}。", - "default_input_error": "请输入有效的 handle、DID 或完整的 PDS URL" + "default_input_error": "请输入有效的 handle、DID 或完整的 PDS URL", + "profile": "个人资料" } }, "header": {