Internationalization of the Pager controls

While translating an app for internationalization I noticed that Pager controls (e.g Pager Expand/Collapse, Pager Show/Hide Details)) were still default in English. So I wondered how you could translate them since they did not adapt to the selected language in my browser?

It turns out that a workable way is to set the text explicit in the controls first to your default application language:

Screenshot_1

 

Now they have become available for translation:

Screenshot_2

If you open the properties file for the XPage/Custom Control you can allocate the strings to translate:

Screenshot_3

 

The downsize to this approach is that you have to translate them for every design element you have the controls on. I assume this should not be the intention, so if you know the proper way, please let me know.

Update

pagerSizes

Paul Withers replied to my post how to set the pages in the pagerSizes control.

Screenshot_4

Here is a demo code:

<xe:pagerSizes id=”pagerSizes1″ for=”dataView1″ text=”Page {0}” />

In the properties file translate it accordingly e.g.

pagerSizes1/@text=Sida {0}

I am not sure how to set the ‘All’ text.

pager

The pager control you can also translate. A description you can find in the XPages Wiki maintained by Julian Buss.

 

Here is an example code:

<xp:pager partialRefresh=”true” id=”pager1″ for=”dataView1″ style=”padding-right:20px;”>
<xp:pagerControl type=”Previous” id=”pagerControl1″ value=”Previous”></xp:pagerControl>
<xp:pagerControl type=”Group” id=”pagerControl3″></xp:pagerControl>

<xp:pagerControl type=”Next” id=”pagerControl2″ value=”Next”></xp:pagerControl>
</xp:pager>

Again, translate the labels in the properties file accordingly.

Below is the result of the translation:

Screenshot_5

 

Advertisements

4 thoughts on “Internationalization of the Pager controls

  1. flinden68 2014-September-1 / 12:39 pm

    Thats why I use my own property file, and control it with my Language Bean, what to show. In the beginning it is some more work, but in the end you have much more control about the labels and don’t have to modify every design element

    • Patrick Kwinten 2014-September-1 / 1:03 pm

      Hoi Frank, that would be great to know. Just drop an URL here when you have described it on your own blog =)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s