User defined i18n keys in solution dont show up after edit

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?

So long

Jan

As far I know, you have to restart the application.server before the i18n labels are shown. (if you added them outside smart-client)

I have seen some plugin(s) that can re-read the i18n from the tables, but don’t know where I have seen that.

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.

Hi Harjo!
Greetings to DenHam from Frankfurt ;)

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.

:(

as Patrick said, it’s in the usermanager plugin :-)

HI Patrick,

patrick:
Labels that have already been shown, however, are not refreshed.

Perhaps controller.recreateUI() would do it?

In Servoy 5, that should work, yes.

In Combination with the plugin I guess…

Ah, yes :-)

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

Hey Johann! Thats kewl ;)

Where do i make a “case” :oops:
greets
jan

PS. Nevermind.
I found it ;)

As Harjo mentioned, our UserManager plugin can be used to force the server to reload the messages without a restart.

May someone shed the light on how to do this? It’s not immediately clear from the docs.

See this thread: https://www.servoy.com/forum/viewtopic.php?p=111351#p111351

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.

Thanks Patrick. While resetMessages() worked I can’t get the messages to refresh without client restart. This is the code I used:

	plugins.UserManager.Server().resetMessages();
	i18n.setLocale('de', 'DE');
	i18n.setLocale('en', 'US');

If I understood correctly this is how you described it. The messages refresh only after restart.

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.