Skip to content
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
2 changes: 2 additions & 0 deletions app/components/Package/TrendsChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,8 @@ const chartConfig = computed<VueUiXyConfig>(() => {
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 => {
Expand Down
2 changes: 2 additions & 0 deletions app/components/Package/VersionDistribution.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ const chartConfig = computed<VueUiXyConfig>(() => {
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 => {
Expand Down
14 changes: 7 additions & 7 deletions app/error.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
})
Expand Down
9 changes: 9 additions & 0 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down Expand Up @@ -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}",
Expand Down
37 changes: 34 additions & 3 deletions i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@
"edit_on_github": "在 GitHub 上编辑",
"view_guide": "翻译指南"
},
"error": {
"401": "未授权",
"404": "很抱歉,页面未找到",
"500": "服务器内部错误",
"503": "服务不可用",
"default": "抱歉,出现了一些问题"
},
"common": {
"loading": "加载中…",
"loading_more": "加载更多中…",
Expand All @@ -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": "未找到包",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -879,7 +909,7 @@
"governance": "治理",
"role_steward": "管理者",
"role_maintainer": "维护者",
"sponsor": "赞助者",
"sponsor": "赞助",
"sponsor_aria": "在 GitHub 上赞助 {name}"
},
"contributors": {
Expand Down Expand Up @@ -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": {
Expand Down
27 changes: 27 additions & 0 deletions i18n/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -1201,6 +1222,12 @@
"toggle_stack_mode": {
"type": "string"
},
"open_options": {
"type": "string"
},
"close_options": {
"type": "string"
},
"legend_estimation": {
"type": "string"
},
Expand Down
9 changes: 9 additions & 0 deletions lunaria/files/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down Expand Up @@ -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}",
Expand Down
9 changes: 9 additions & 0 deletions lunaria/files/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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...",
Expand Down Expand Up @@ -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}",
Expand Down
37 changes: 34 additions & 3 deletions lunaria/files/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@
"edit_on_github": "在 GitHub 上编辑",
"view_guide": "翻译指南"
},
"error": {
"401": "未授权",
"404": "很抱歉,页面未找到",
"500": "服务器内部错误",
"503": "服务不可用",
"default": "抱歉,出现了一些问题"
},
"common": {
"loading": "加载中…",
"loading_more": "加载更多中…",
Expand All @@ -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": "未找到包",
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -878,7 +908,7 @@
"governance": "治理",
"role_steward": "管理者",
"role_maintainer": "维护者",
"sponsor": "赞助者",
"sponsor": "赞助",
"sponsor_aria": "在 GitHub 上赞助 {name}"
},
"contributors": {
Expand Down Expand Up @@ -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": {
Expand Down
Loading