Hi there AppWorks fans,
Welcome to a new installment of AppWorks tips.
Today is finally the day we’ll look at the installation of a language pack on our beloved platform. It’s an item on my backlog for a long time and now the time is ready to execute on it and take a dive into the language features…Nothing more to say…
Let get right into it…
The first thing I always hear in the corridor chat; “It’s just deploying a CAP file!?“ OK…Well…Let’s check that out…shall we?
Spin up the VM and make sure you are logged into the /home/system
organization with the ‘sysadmin’ account…
CAP deployment
Start the ‘Application Deployer’ artifact. Select the ‘Shared’ space and view the list of ‘New’ packages. When you search for ‘language’ you should see a nice list for you to be able to deploy…
Now you can right-click your preferred language and do a ‘Deploy’ action. This will trigger a model wizard with some steps to follow:
Just click ‘Next >’
And ‘Next >’ again…
You can browse a bit through that list on what will be updated. After that click ‘Next >’
Mark that ‘Revert on Failure’ and click ‘Deploy’
Grab a quick tea and when you’re back…
…you can hit that ‘Finish’
Ok…now what? A ‘Refresh’ of the browser isn’t showing my installed language!?
Setting the ‘design-time’ language
First logout from the ‘sysadmin’ account and switch to your own beloved organization space with you own developer role user. In my case the ‘awdev’ account.
Still, no change…correct?
Now, let’s open the preferences for our account…
You see the preference screen that you need to update with your language specifics:
After changing and applying you need to refresh your browser!
There you have it…All artifacts in your native language!
I don’t know if you want this for real in your design-time, but you see it’s possible!
I also saw that the default language is picking up the language settings of the browser you’re using when you change it…Like we do in the next section in runtime!
Next…And maybe a better use-case…
Setting the ‘runtime’ language
Well, this is more browser specific, and the language will be picked up by the language settings of your browser. In my case it is a Chrome browser in English. I need to go to the settings…Well, just follow the instructions here
And after a relaunch of your browser with your default language (in my case ‘nl’) you will start to see some minor differences:
Hamburger menu
Well, the default ‘Homepage’ is translated. But the ‘Identity Home Page’ is forgotten!?
Identity package
This looks like a nicely crafted translation for all those entities as well as the properties with it….nice job!
Inbox
The inbox categories from the left panel got a translation, but the task properties?…not really!
Create button
Well, the identity entities got a translation, but the ‘Recent items’ and ‘All items’ are still intact as English.
User options button
Well…Looks like it’s not translated….
Show/Hide columns button
Ok, the column names I understand, but the buttons and other elements don’t get a translation!?
Categories button
Looks like English to me…
Login screen (after a logout)
Hmmmm…That just not it…right?
Others translation stuff…
You saw already some screenshot from the left panel where you still see the ‘Lists’ component…That’s still in English. Also, the ‘item per page’ in the bottom is still English as well as the ‘No results found’ message on an empty list!
When you hover with the mouse over the elements you also still see only English messages!
My first conclusion? Looks like a lot of information is missing. Or maybe I’m doing something wrong here?
Let’s jump to the next section…
CAP file exploration
With that last conclusion I got really curious on what is in the CAP file of the translation deployment we did? Especially with the experience I have on my current project where my native language is much better translated in runtime! So, what’s the different?
Let’s dive into the CAP file for some clarification. Make sure you download the CAP file for you preferred language. You can find it in this location on the server: /opt/opentext/AppWorksPlatform/defaultInst/capcontent/packages/shared/Cordys BOP Language Pack_nl-NL/ver20.3build27.cap
Extract that file with 7-Zip and do a ‘find in files’ search with Notepad++
In the search box you can fill-in something like this:
I search for the Dutch term ‘Afmelden’ because I’m sure it should give a match (That’s our ‘Logout’ action in the top right corner in runtime)!
And that’s also a clear hit!
So, why don’t we see this in runtime; Even after a restart of the TomEE and clearing the cache it’s not working!!??
Now what…Another section?
The language parameter!
Let’s dive into the developer console with <F12>
and after a refresh of my ‘Dutch’ browser I started to see something interesting!
So, this URL should be a valid one: http://192.168.56.107:8080/home/appworks_tips/app/start/web/?language=nl
And back to English?…http://192.168.56.107:8080/home/appworks_tips/app/start/web/?language=en
Yeahh…works!
In the screenshot of the previous section we saw also ‘nl-NL’…
So…
http://192.168.56.107:8080/home/appworks_tips/app/start/web/?language=nl-NL
??
Ohwww yeah…now we’re getting somewhere!
After some clicking and hovering this translation is much…much better!! Double hooray…Banana time! 🍌
Logging in native language
Last section of this post, but it’s just a thought/recommendation! As everything in runtime being translated, also the default error messages, you will see that these native language messages will also be logged into the log system of AppWorks. Maybe not that bad, but it might be a difficult thing to trace back the information to a forum post or knowledge article when your message got a translation into your native language!?
The solution: Switch the language parameter to ‘en’ and reproduce the issue, so you will get the proper messages to search for on the forum, articles, and documentation!
That’s our “DONE” for today. And ohw boy did we learn something about language packs with this post! We even saw what’s in the language CAP file, and we learned about the ?language=XX
parameter. We will never forget this last one…Have a great day, and I see you in a brand-new post on AppWorks Tips.
Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?