How to change the text of the paging buttons of the Bootstrap Pagination UI?

3

I'm working with UI Bootstrap Pagination , but by default the language is in English.

Would it be possible to change without having to modify Javascript directly? If so, could you give me a simple example?

    
asked by anonymous 13.12.2017 / 13:33

1 answer

2

According to the SOEN response, you can configure globally through the object which configures the UI Bootstrap Paginator via paginationConfig , as below:

angular.module('myapp', ['ui.bootstrap'])

.run(function(paginationConfig){
   paginationConfig.firstText = 'Primeiro';
   paginationConfig.previousText = 'Anterior';

})

On your own documentation you can also realize that you can make these settings through attributes passed in uib-pagination .

They are:

  • first-text : The text of the button that goes to the first page
  • last-text : the text of the button that goes to the last page
  • previous-text : the text of the button that returns a page
  • next-text : the text of the button that advances a page

Example:

<ul uib-pagination first-text="Primeiro" previous-text="Voltar"></ul>

Just put the desired values to stay in the desired language.

Note : This last form only affects the local setting. If the desire is to leave the overall translation, do through paginationConfig ;

    
13.12.2017 / 15:08