Skip to content

Commit 21d55b3

Browse files
committed
Adding plural generator on SpecialSponsor
1 parent 3b78a03 commit 21d55b3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/.vuepress/theme/components/sponsors/SpecialSponsors.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,23 @@ export default {
2626
2727
computed: {
2828
heading () {
29-
return `Special Sponsor${this.sponsors.length === 1 ? '' : 's'}`
29+
return (
30+
this.sponsors.length > 0
31+
? `Patrocinador${this.getPlural(0)} Especia${this.getPlural(1)}`
32+
: ''
33+
)
34+
}
35+
},
36+
37+
methods: {
38+
getPlural(wordId) {
39+
const plurals = ['es', 'is']
40+
const singulars = ['', 'l']
41+
return (
42+
this.sponsors.length === 1
43+
? singulars[wordId]
44+
: plurals[wordId]
45+
)
3046
}
3147
}
3248
}

0 commit comments

Comments
 (0)