Skip to content

Commit 6248dc6

Browse files
committed
feat(i18n): add pluralization to diff page i18n strings
1 parent 2931d79 commit 6248dc6

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

app/components/diff/MobileSidebarDrawer.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ watch(open, value => {
6565
<span class="text-yellow-500">~{{ props.compare.stats.filesModified }}</span>
6666
</span>
6767
<span class="text-fg-subtle">•</span>
68-
<span>{{ $t('compare.files_count', { count: props.allChanges.length }) }}</span>
68+
<span>{{
69+
$t('compare.files_count', { count: props.allChanges.length }, props.allChanges.length)
70+
}}</span>
6971
</div>
7072
<button
7173
type="button"

app/components/diff/SidebarPanel.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,13 @@ function handleFileSelect(file: FileChange) {
9494
<span class="text-yellow-500">~{{ compare.stats.filesModified }}</span>
9595
</span>
9696
<span v-if="compare.dependencyChanges.length > 0" class="text-fg-muted">
97-
{{ $t('compare.deps_count', { count: compare.dependencyChanges.length }) }}
97+
{{
98+
$t(
99+
'compare.deps_count',
100+
{ count: compare.dependencyChanges.length },
101+
compare.dependencyChanges.length,
102+
)
103+
}}
98104
</span>
99105
</div>
100106
</div>

app/components/diff/SkipBlock.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defineProps<{
1717
</td>
1818
<td>
1919
<span class="px-0 sticky inset-is-2 italic opacity-50">
20-
{{ content || $t('compare.lines_hidden', { count }) }}
20+
{{ content || $t('compare.lines_hidden', { count }, count) }}
2121
</span>
2222
</td>
2323
</tr>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ useSeoMeta({
211211
<span class="text-yellow-500">~{{ compare.stats.filesModified }}</span>
212212
</span>
213213
<span class="text-fg-subtle">•</span>
214-
<span>{{ $t('compare.files_count', { count: allChanges.length }) }}</span>
214+
<span>{{
215+
$t('compare.files_count', { count: allChanges.length }, allChanges.length)
216+
}}</span>
215217
</div>
216218
<button
217219
type="button"

i18n/locales/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,11 +1076,11 @@
10761076
}
10771077
},
10781078
"file_changes": "File Changes",
1079-
"files_count": "{count} files",
1080-
"lines_hidden": "{count} lines hidden",
1079+
"files_count": "{count} file | {count} files",
1080+
"lines_hidden": "{count} line hidden | {count} lines hidden",
10811081
"compare_versions": "diff",
10821082
"summary": "Summary",
1083-
"deps_count": "{count} deps",
1083+
"deps_count": "{count} dep | {count} deps",
10841084
"dependencies": "Dependencies",
10851085
"dev_dependencies": "Dev Dependencies",
10861086
"peer_dependencies": "Peer Dependencies",

0 commit comments

Comments
 (0)