Hi guys.
Im developing a Navigation Module, which will contain a setup menu, where you can set:
The languages that the application will support
All Buttons and Tooltipps showed by the application will be editable via i18n keys.
That means, i have a setup of Form where i can Acces, edit and Add new translations for already given keys. The exact way Im doing this is of no concern to my question.
The i18n keys are stored in an slightly modificated i18n table on my solution server. (2 fields added)
I understand, that if i’m running the application in the developer, i do have to update my i18n files from the server to get the new/edited values displayed correctly.
But if I change the i18n records out of a smart client, started from the server, the changed/new values are not displayed.
Even if i restart the smart client.
The question is:
Does Servoy read the i18n keys from the Database, and stores them internaly in the properties files, from which it retrieves the values, or is there a way, that servoy reads the field ONLY from the database?
i18n keys are read when the servoy server starts up. So you need to restart the server to see those keys. As Harjo mentioned, our UserManager plugin can be used to force the server to reload the messages without a restart. With a little trick, you can even force the client then to reload the messages while it is active. Labels that have already been shown, however, are not refreshed.
Well, the thing is, i wanted to let my customers edit the Labels, Buttons, Tootips etc. in their application on their own.
Also I really dont want to restart the application server everytime they edited a label in their app.
Your right. If I edit a record of the i18n table in the smart client, and restart the server, the edited record is shown correctly.
I think i have to look for that plugin(s).
No idea where you have seen it I guess
Stay tuned!
GevatterJan
Edit:
patrick:
[…]Labels that have already been shown, however, are not refreshed.
Well… That is in fact exactly the thing I wanted to do.
biggest problems here is that there are 3 layers of cache
first one is in the clients memory.
second one is on the clients disk
and the third is on the server (not really a cache but the client wont get new results if the server tells the client that there is no change)
Could you create a case for this so that we can introduce a method i guess on the i18n node where you can really flush all the caches
If possible I would like some help on how to use the UserManager plugin to refresh i18N messages. The thread Nicola pointed to is about a different plugin.
Out of my head: there should be a method like plugins.UserManager.Server().resetMessages(). That forces the server to reload the messages. To have these activated in a client, I think we switched the locale (i18n.setLocale) to something else and then back to the original value. That forced the client to first load the refreshed messages for the nonsense language and then, again, for the language the client initially had.
I don’t remember exactly what we did. Probably the problem is that a form for example, that is already shown on screen, has no reason to be recreated because the locale changed. So a newly loaded form probably will show new keys, while forms already visited will not.