Skip to content

Commit d9e56fc

Browse files
committed
fix(i18n): add additional keys to invalid diff version url
1 parent e9be2f5 commit d9e56fc

File tree

3 files changed

+26
-7
lines changed

3 files changed

+26
-7
lines changed

app/pages/diff/[[org]]/[packageName]/v/[versionRange].vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,13 @@ useSeoMeta({
134134

135135
<!-- Error: invalid route -->
136136
<div v-if="!versionRange" class="container py-20 text-center">
137-
<p class="text-fg-muted mb-4">
138-
{{ $t('compare.version_invalid_url') }}
139-
<code class="font-mono text-sm">/diff/package/v/from...to</code>
140-
</p>
137+
<i18n-t keypath="compare.version_invalid_url_format.hint" tag="p" class="text-fg-muted mb-4">
138+
<code class="font-mono text-sm"
139+
>/diff/{{ packageName }}/v/{{
140+
$t('compare.version_invalid_url_format.from_version')
141+
}}...{{ $t('compare.version_invalid_url_format.to_version') }}</code
142+
>
143+
</i18n-t>
141144
<NuxtLink :to="packageRoute(packageName)" class="btn">{{
142145
$t('compare.version_back_to_package')
143146
}}</NuxtLink>

i18n/locales/en.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,11 @@
11901190
"comparing_versions_label": "Comparing versions...",
11911191
"version_back_to_package": "Back to package",
11921192
"version_error_message": "Failed to compare versions.",
1193-
"version_invalid_url": "Invalid comparison URL. Use format:",
1193+
"version_invalid_url_format": {
1194+
"hint": "Invalid comparison URL. Use format: {0}",
1195+
"from_version": "from",
1196+
"to_version": "to"
1197+
},
11941198
"version_selector_title": "Compare with version",
11951199
"summary": "Summary",
11961200
"deps_count": "{count} dep | {count} deps",

i18n/schema.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,8 +3574,20 @@
35743574
"version_error_message": {
35753575
"type": "string"
35763576
},
3577-
"version_invalid_url": {
3578-
"type": "string"
3577+
"version_invalid_url_format": {
3578+
"type": "object",
3579+
"properties": {
3580+
"hint": {
3581+
"type": "string"
3582+
},
3583+
"from_version": {
3584+
"type": "string"
3585+
},
3586+
"to_version": {
3587+
"type": "string"
3588+
}
3589+
},
3590+
"additionalProperties": false
35793591
},
35803592
"version_selector_title": {
35813593
"type": "string"

0 commit comments

Comments
 (0)