Skip to content

Commit d268b03

Browse files
authored
fixes c#479: update text on expand button on home page (#861)
* fixes c#479: update text on expand button on home page * pluralise the messages
1 parent 5600f4c commit d268b03

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

src/components/project/home-block.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ except according to the terms contained in the LICENSE file.
4646
<td colspan="6" class="expand-button-container">
4747
<a href="#" role="button" class="expand-button" @click.prevent="toggleDatasetExpanded">
4848
<template v-if="!datasetExpanded">
49-
{{ $tcn('showMore', numDatasets) }}<span class="icon-angle-down"></span>
49+
{{ $tcn('showMoreDatasets', numDatasets) }}<span class="icon-angle-down"></span>
5050
</template>
5151
<template v-else>
52-
{{ $tcn('showFewer', numDatasets) }}<span class="icon-angle-up"></span>
52+
{{ $tcn('showFewerDatasets', numDatasets) }}<span class="icon-angle-up"></span>
5353
</template>
5454
</a>
5555
</td>
@@ -262,10 +262,15 @@ export default {
262262
"encrypted": "Encrypted",
263263
"encryptionTip": "This Project uses managed encryption.",
264264
// This clickable text is shown below a table of forms where only a few out of the total number ("count") of forms is shown.
265-
"showMore": "Show {count} total",
265+
"showMore": "Show {count} total Form | Show {count} total Forms",
266+
// This clickable text is shown below a table of entity lists where only a few out of the total number ("count") of entity lists is shown.
267+
"showMoreDatasets": "Show {count} total Entity List | Show {count} total Entity Lists",
266268
// This clickable text is shown below an expanded table of forms that can be collapsed to hide some forms.
267269
// "Count" refers to the number of forms.
268-
"showFewer": "Show fewer of {count} total"
270+
"showFewer": "Show fewer of {count} total Form | Show fewer of {count} total Forms",
271+
// This clickable text is shown below an expanded table of entity lists that can be collapsed to hide some entity list.
272+
// "Count" refers to the number of entity lists.
273+
"showFewerDatasets": "Show fewer of {count} total Entity List | Show fewer of {count} total Entity Lists"
269274
}
270275
}
271276
</i18n>

test/components/project/home-block.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ describe('ProjectHomeBlock', () => {
7272
block.findAllComponents(FormRow).length.should.equal(3);
7373
const expand = block.find('.expand-button');
7474
expand.exists().should.be.true();
75-
expand.text().should.equal('Show 4 total');
75+
expand.text().should.equal('Show 4 total Forms');
7676
expand.find('.icon-angle-down').exists().should.be.true();
7777
});
7878

@@ -84,7 +84,7 @@ describe('ProjectHomeBlock', () => {
8484
const expand = block.find('.expand-button');
8585
await expand.trigger('click');
8686
block.findAllComponents(FormRow).length.should.equal(4);
87-
expand.text().should.equal('Show fewer of 4 total');
87+
expand.text().should.equal('Show fewer of 4 total Forms');
8888
expand.find('.icon-angle-up').exists().should.be.true();
8989
});
9090

@@ -128,7 +128,7 @@ describe('ProjectHomeBlock', () => {
128128
const block = mountComponent();
129129
const expand = block.find('.expand-button');
130130
expand.exists().should.be.true();
131-
expand.text().should.equal('Show 4 total');
131+
expand.text().should.equal('Show 4 total Forms');
132132
await expand.trigger('click');
133133
const rows = block.findAllComponents(FormRow);
134134
rows.map((row) => row.props().form.name).should.eql(['a', 'c', 'd', 'e']);
@@ -153,7 +153,7 @@ describe('ProjectHomeBlock', () => {
153153
block.find('.project-form-row .expand-button').exists().should.be.false();
154154
const expand = block.find('.project-dataset-row .expand-button');
155155
expand.exists().should.be.true();
156-
expand.text().should.equal('Show 4 total');
156+
expand.text().should.equal('Show 4 total Entity Lists');
157157
expand.find('.icon-angle-down').exists().should.be.true();
158158
block.find('.margin').exists().should.be.false();
159159
});
@@ -166,7 +166,7 @@ describe('ProjectHomeBlock', () => {
166166
const expand = block.find('.project-dataset-row .expand-button');
167167
await expand.trigger('click');
168168
block.findAllComponents(DatasetRow).length.should.equal(4);
169-
expand.text().should.equal('Show fewer of 4 total');
169+
expand.text().should.equal('Show fewer of 4 total Entity Lists');
170170
expand.find('.icon-angle-up').exists().should.be.true();
171171
});
172172

@@ -192,13 +192,13 @@ describe('ProjectHomeBlock', () => {
192192
block.findAllComponents(DatasetRow).length.should.equal(3);
193193
const formExpand = block.find('.project-form-row .expand-button');
194194
formExpand.exists().should.be.true();
195-
formExpand.text().should.equal('Show 5 total');
195+
formExpand.text().should.equal('Show 5 total Forms');
196196
formExpand.find('.icon-angle-down').exists().should.be.true();
197197

198198
block.findAllComponents(FormRow).length.should.equal(3);
199199
const dsExpand = block.find('.project-dataset-row .expand-button');
200200
dsExpand.exists().should.be.true();
201-
dsExpand.text().should.equal('Show 4 total');
201+
dsExpand.text().should.equal('Show 4 total Entity Lists');
202202
dsExpand.find('.icon-angle-down').exists().should.be.true();
203203
});
204204
});

transifex/strings_en.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3140,12 +3140,20 @@
31403140
"string": "This Project uses managed encryption."
31413141
},
31423142
"showMore": {
3143-
"string": "Show {count} total",
3143+
"string": "{count, plural, one {Show {count} total Form} other {Show {count} total Forms}}",
31443144
"developer_comment": "This clickable text is shown below a table of forms where only a few out of the total number (\"count\") of forms is shown."
31453145
},
3146+
"showMoreDatasets": {
3147+
"string": "{count, plural, one {Show {count} total Entity List} other {Show {count} total Entity Lists}}",
3148+
"developer_comment": "This clickable text is shown below a table of entity lists where only a few out of the total number (\"count\") of entity lists is shown."
3149+
},
31463150
"showFewer": {
3147-
"string": "Show fewer of {count} total",
3151+
"string": "{count, plural, one {Show fewer of {count} total Form} other {Show fewer of {count} total Forms}}",
31483152
"developer_comment": "This clickable text is shown below an expanded table of forms that can be collapsed to hide some forms. \"Count\" refers to the number of forms."
3153+
},
3154+
"showFewerDatasets": {
3155+
"string": "{count, plural, one {Show fewer of {count} total Entity List} other {Show fewer of {count} total Entity Lists}}",
3156+
"developer_comment": "This clickable text is shown below an expanded table of entity lists that can be collapsed to hide some entity list. \"Count\" refers to the number of entity lists."
31493157
}
31503158
},
31513159
"ProjectList": {

0 commit comments

Comments
 (0)