Renato
Renato

Reputation: 47

translate angular pagination text ( previous - next )

I have an app on angular 6 , who i can change the text (previous and next) on my pagination table? im ussing "ngx-pagination": "^3.2.1", i have this and its works ok but the 'previousPage' doesnt change, the rest its ok

"let s of datos | paginate : { itemsPerPage: 10, currentPage : pageActual, previousPage: 'something' }"

<< Previous 1 2 3 Next >>

i want change languaje like this

 << something text  1 2 3 another text >>

thanks

Upvotes: 1

Views: 693

Answers (2)

Aleena Ariz
Aleena Ariz

Reputation: 1

You can translate 'Previous' and 'Next' using i18n-attribute like:

<pagination-controls (pageChange)="PageChanged($event)" i18n-previousLabel= "previousLabeltag" previousLabel="Previous" i18n-nextLabel="nextLabeltag" nextLabel="Next"></pagination-controls>

Upvotes: 0

Berk Kurkcuoglu
Berk Kurkcuoglu

Reputation: 1523

You can implement a custom translation pipe which uses a dictionary created by you to replace corresponding word with the key you provide.

I've prepared a small POC for you in StackBlitz, check here.

Upvotes: 2

Related Questions