Skip to content

Commit 99a5c3c

Browse files
authored
Merge pull request #2255 from dxc-technology/rarrojolopez/paginator-localization
Fix Paginator buttons to support localization
2 parents f851305 + 8039af9 commit 99a5c3c

3 files changed

Lines changed: 33 additions & 5 deletions

File tree

apps/website/screens/principles/localization/LocalizationPage.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,30 @@ const sections = [
455455
with those parameters.
456456
</td>
457457
</tr>
458+
<tr>
459+
<td>
460+
<Code>firstResultsTitle</Code>
461+
</td>
462+
<td>First results</td>
463+
</tr>
464+
<tr>
465+
<td>
466+
<Code>previousResultsTitle</Code>
467+
</td>
468+
<td>Previous results</td>
469+
</tr>
470+
<tr>
471+
<td>
472+
<Code>nextResultsTitle</Code>
473+
</td>
474+
<td>Next results</td>
475+
</tr>
476+
<tr>
477+
<td>
478+
<Code>lastResultsTitle</Code>
479+
</td>
480+
<td>Last results</td>
481+
</tr>
458482
</tbody>
459483
</DxcTable>
460484
),

packages/lib/src/common/variables.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,10 @@ export const defaultTranslatedComponentLabels = {
15041504
`${minNumberOfItems} to ${maxNumberOfItems} of ${totalItems}`,
15051505
goToPageText: "Go to page:",
15061506
pageOfText: (pageNumber: number, totalPagesNumber: number) => `Page: ${pageNumber} of ${totalPagesNumber}`,
1507+
firstResultsTitle: "First results",
1508+
previousResultsTitle: "Previous results",
1509+
nextResultsTitle: "Next results",
1510+
lastResultsTitle: "Last results",
15071511
},
15081512
passwordInput: {
15091513
inputShowPasswordTitle: "Show password",
@@ -1519,7 +1523,7 @@ export const defaultTranslatedComponentLabels = {
15191523
actionClearSelectionTitle: "Clear selection",
15201524
actionClearSearchTitle: "Clear search",
15211525
noMatchesErrorMessage: "No matches found",
1522-
selectAllLabel: "Select all"
1526+
selectAllLabel: "Select all",
15231527
},
15241528
tabs: {
15251529
scrollLeft: "Scroll left",

packages/lib/src/paginator/Paginator.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const DxcPaginator = ({
109109
onClick={() => {
110110
onPageChange(1);
111111
}}
112-
title="First results"
112+
title={translatedLabels.paginator.firstResultsTitle}
113113
size={{ height: "medium" }}
114114
/>
115115

@@ -121,7 +121,7 @@ const DxcPaginator = ({
121121
onClick={() => {
122122
onPageChange(currentPage - 1);
123123
}}
124-
title="Previous results"
124+
title={translatedLabels.paginator.previousResultsTitle}
125125
size={{ height: "medium" }}
126126
/>
127127
</ButtonsContainer>
@@ -157,7 +157,7 @@ const DxcPaginator = ({
157157
onClick={() => {
158158
onPageChange(currentPage + 1);
159159
}}
160-
title="Next results"
160+
title={translatedLabels.paginator.nextResultsTitle}
161161
size={{ height: "medium" }}
162162
/>
163163
<DxcButton
@@ -168,7 +168,7 @@ const DxcPaginator = ({
168168
onClick={() => {
169169
onPageChange(totalPages);
170170
}}
171-
title="Last results"
171+
title={translatedLabels.paginator.lastResultsTitle}
172172
size={{ height: "medium" }}
173173
/>
174174
</ButtonsContainer>

0 commit comments

Comments
 (0)