Skip to content

Commit 2cc98c0

Browse files
committed
Fixing minor bug with keys in formatted message.
1 parent 93dbeec commit 2cc98c0

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

src/containers/PaginationContainer/PaginationContainer.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,17 @@ export const createSortingIcon = (colName, orderByColumn, orderByDescending, set
4848
export const showRangeInfo = (offset, limit, totalCount) =>
4949
totalCount > limit && (
5050
<div className="text-body-secondary text-end small">
51-
<FormattedMessage
52-
id="app.paginationContainer.showingRange"
53-
defaultMessage="showing {offset}{nbsp}-{nbsp}{offsetEnd} (of{nbsp}{totalCount})"
54-
values={{
55-
offset: offset + 1,
56-
offsetEnd: Math.min(offset + limit, totalCount),
57-
totalCount,
58-
nbsp: <>&nbsp;</>,
59-
}}
60-
/>
51+
<FormattedMessage id="app.paginationContainer.showingRange" defaultMessage="showing" />{' '}
52+
<span className="text-nowrap">
53+
{offset + 1}. &ndash; {Math.min(offset + limit, totalCount)}.
54+
</span>{' '}
55+
<span className="text-nowrap">
56+
<FormattedMessage
57+
id="app.paginationContainer.showingRangeOf"
58+
defaultMessage="(of {totalCount})"
59+
values={{ totalCount }}
60+
/>
61+
</span>
6162
</div>
6263
);
6364

@@ -257,9 +258,13 @@ class PaginationContainer extends Component {
257258
{this.showLimitsButtons() && (
258259
<Pagination size="small">
259260
{limits
260-
.map((l, idx) =>
261-
idx < 1 || totalCount > limits[idx - 1] || l === limit ? this.createLimitButton(l) : null
262-
)
261+
.map((l, idx) => (
262+
<React.Fragment key={idx}>
263+
{idx < 1 || totalCount > limits[idx - 1] || l === limit
264+
? this.createLimitButton(l)
265+
: null}
266+
</React.Fragment>
267+
))
263268
.filter(identity)}
264269
</Pagination>
265270
)}
@@ -286,7 +291,7 @@ class PaginationContainer extends Component {
286291
)}
287292
</div>
288293
) : (
289-
<div className="text-center larger em-maring">
294+
<div className="text-center larger m-5">
290295
<LoadingIcon gapRight={2} />
291296
<FormattedMessage id="generic.loading" defaultMessage="Loading..." />
292297
</div>

src/locales/cs.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,8 @@
13121312
"app.page.failedPage.explain": "Tento problém mohl být způsoben výpadkem sítě nebo interní chybou na straně serveru. Rovněž je možné, že požadované datové objekty pro zobrazení této stránky byly smazány.",
13131313
"app.page.failedPage.sorry": "Prosíme, zkuste to později. Omlouváme se za způsobené problémy. Pokud problém přetrvává ověřte, že zobrazovaný objekt stále",
13141314
"app.page.loadingDescription": "Prosíme počkejte než bude vše připraveno.",
1315-
"app.paginationContainer.showingRange": "zobrazuje se {offset}.{nbsp}-{nbsp}{offsetEnd}. (z{nbsp}{totalCount})",
1315+
"app.paginationContainer.showingRange": "zobrazuje se",
1316+
"app.paginationContainer.showingRangeOf": "(z {totalCount})",
13161317
"app.passwordStrength.bad": "Víte to jistě?",
13171318
"app.passwordStrength.good": "Dobře",
13181319
"app.passwordStrength.ok": "OK",
@@ -2128,4 +2129,4 @@
21282129
"recodex-judge-shuffle-all": "Sudí neuspořádaných tokenů a řádků",
21292130
"recodex-judge-shuffle-newline": "Sudí neuspořádaných tokenů (ignorující konce řádků)",
21302131
"recodex-judge-shuffle-rows": "Sudí neuspořádaných řádků"
2131-
}
2132+
}

src/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1312,7 +1312,8 @@
13121312
"app.page.failedPage.explain": "This problem might have been caused by network failure or by internal error at server side. It is also possible that some of the resources required for displaying this page have been deleted.",
13131313
"app.page.failedPage.sorry": "We are sorry for the inconvenience, please try again later. If the problem prevails, verify that the requested resource still exists.",
13141314
"app.page.loadingDescription": "Please wait while we are getting things ready.",
1315-
"app.paginationContainer.showingRange": "showing {offset}{nbsp}-{nbsp}{offsetEnd} (of{nbsp}{totalCount})",
1315+
"app.paginationContainer.showingRange": "showing",
1316+
"app.paginationContainer.showingRangeOf": "(of {totalCount})",
13161317
"app.passwordStrength.bad": "Are you sure?",
13171318
"app.passwordStrength.good": "Good",
13181319
"app.passwordStrength.ok": "OK",

0 commit comments

Comments
 (0)