elstar IT

Fullstack | Java | Tech Speaker | Tech Coach | Frank van der Linden

  • About me
  • Blog license
  • My Open source projects

My way to Internationalisation Pager controls

01-09-2014 5 responses flinden68 development

This morning I read a blog from Patrick Kwinten about a internationalisation a pager control in XPages. As stated in the comments I am not fan of the way it done in XPages and do it my own way.

But let’s take the Pagers control as an example.

 

Own property file

In the files section of the database I have properties files for every supported language in the application. In this property file I have 2 lines for the pager control.

[dropshadowbox align=”none” effect=”lifted-both” width=”250px” height=”” background_color=”#ffffff” border_width=”1″ border_color=”#dddddd” ]property pagers[/dropshadowbox]

 

Language Bean

I have a Language Bean who controls the internationalisation. First is the correct language property defined, default by the configuration document, but then it can be specified by the user.

The most important part of the language bean is the the method ‘getLanguageString(key)’ where key who is used in the property file.

[dropshadowbox align=”none” effect=”lifted-both” width=”500px” height=”” background_color=”#ffffff” border_width=”1″ border_color=”#dddddd” ]Language.getLanguageString[/dropshadowbox]

 

My theme

As always I use themes in all my apps. It is an easy way to load and control parts of the application.

In my theme I set the value of the Previous and Next label of the Pager Control, throughout of my application

[dropshadowbox align=”none” effect=”lifted-both” width=”500px” height=”” background_color=”#ffffff” border_width=”1″ border_color=”#dddddd” ]theme pager control[/dropshadowbox]

 

Conclusion

In the beginning it can be more work to get everything setup, but when you are used to it is more flexible than the build in internationalisation of XPages.

For example, when a label value should be changed, you don’t have to access lots of design elements. Just go to the property file, change it. Build the application and there you go.

And it will apply also for all the labels through the whole application

Tags: development, pager, theme, xpages

5 thoughts on “My way to Internationalisation Pager controls”

  1. Oliver Busse says:
    01-09-2014 at 15:19

    Nice one – tried this before. I assume your bundleVar variable name is computed when the bean is created depending on the client’s language? So you end up with at least 2 property files, e.g. “strings_en” and “strings_nl”?

    Reply
    1. Frank van der Linden says:
      02-09-2014 at 09:27

      yes. I start always with one language. Build the most of the application. Then I make a copy, do the translation. And switch on the possibility to choose the language. Sometimes I store this language in a user preference document, so the next time the use has the application immediately in the correct language

      Reply
  2. Patrick Kwinten says:
    01-09-2014 at 19:39

    Toppen! (Swedish for excellent or ‘top’ (Dutch)) 😉

    Reply
  3. Marcus Loza says:
    19-10-2016 at 14:32

    Hello! In the first part of your article you report that created their own properties files with the content already translated. Question from beginner:
    Where do I create these files? You have some standardization of nomenclature?
    As the java script code cited in the latter part of the file you find these files.

    Thanks a lot!

    Reply
    1. Frank van der Linden says:
      20-10-2016 at 14:14

      I have more blogs on this subject, http://elstarit.nl/2016/04/22/xpages-tip-demo-code-for-multi-language-support/
      There is a GIT repo with a demo database, so there you get the property file. And change it to your needs, and import it in the NSF.
      The property files is under Resources –> under files.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • « The moment is here to become a freelance developer
  • My running plans fall 2014 »

Contact me

My name is Frank van der Linden and I am an independent software developer based in the Netherlands. The last 2 years I was awarded as IBM Champion. Also I am on the board of OpenNTF. My specialisations are Java, Web development and Domino.


If you want to hire me, please fill in the Contact form


IBM Champion web badge
Apache Logo

All the code on this blog are under the Apache License 2.0. For more details, see Apache License 2.0

Most recent posts

  • NL Portal, a open source project
  • 10th anniversary as a freelancer and more…
  • Engage 2020: Hello are you listening, There is stream for everything
  • Spring Cloud Function on Azure run locally
  • Deploy Spring Cloud Function to IBM Cloud

Latest reactions

  • Spring Cloud Function on Azure run locally - elstar IT on Deploy Spring Cloud Function to IBM Cloud
  • flinden68 on Quick XPages tip: add Fullcalendar plugin to your application
  • Rajesh samal on Quick tip: Swagger support for Spring Webflux
  • dsieyx on Quick XPages tip: add Fullcalendar plugin to your application
  • John on Named as IBM Champion 2019

Archive

  • November 2024
  • April 2024
  • March 2020
  • February 2020
  • January 2020
  • October 2019
  • September 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • January 2019
  • December 2018
  • October 2018
  • September 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • December 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014

Category

  • bluemix
  • business
  • cloudant
  • community
  • development
  • hrassistant
  • openntf
  • running
  • salesforce
  • Springboot
  • Tesla
  • trailrunning
  • Uncategorized
  • watson
  • OpenNTF
  • Collaboration Today
  • XSnippets
  • Stackoverflow
  • IBM Collaboration Solutions
  • Social Business Toolkit
  • About me
  • Dutch curriculum vitae
  • English curriculum vitae
  • Google+
  • LinkedIn profile
  • Twitter
  • Slideshare
  • Blog license
  • My open source projects