Over time I wrote a few blogs about my way to support multi language in a XPages app.
Very nice, but I got requests about a demo db.
I created a demo database which is available as GIT repository on Bitbucket.
What’s inside
- Load properties from a properties file, which reside in resource section of database
- Load languages
- Add new Language, which add also for this new language property documents.
- Export of the default properties file to change in one time all the labels
- Reimport the new language property file, expecting a certain format countrycode_countryname e.g. nl_netherlands.txt
- When a language is removed, all the property documents for this language will also be removed
- Language is stored in a userpreference document.
- Set a default language, which is used as not language is available for the user.
- I did not removed all the bootstrap fields, the theme and front end frameworks which is imported by Bower. So use it if needed.
Happy coding
Hi Frank, I got an my server the message that the application requires the extlibx library, which is not installed on our server.
Which part of the code requires this library?
It is a long time I created this repo. What you could try is to deselect the extlibx library in the properties, or remove it from the xsp.properties. Rebuild the application. Try again. As far I remember I included OpenNTF Essentials, but it could be there is no need for extlibx
tried that, that removed the message. still the pages wont load. error in openlog:
java.lang.NullPointerException
at nl.elstarit.bean.UserPreference.getFieldValue(UserPreference.java:109)
at nl.elstarit.bean.UserPreference.getUserLanguage(UserPreference.java:138)
found it:
public static String getUserLanguage(){
String userLanguage = (String) getFieldValue(“language”);
if(userLanguage == null){
userLanguage = LanguageHandler.get().getDefaultLanguage().getCode();
}
return userLanguage;
}
goes wrong here:
if(userLanguage == null){
userLanguage is casted to a string so it becomes “null”![🙂](https://s.w.org/images/core/emoji/15.0.3/svg/1f642.svg)
I will looking forward to the pull request![😉](https://s.w.org/images/core/emoji/15.0.3/svg/1f609.svg)