KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Run Set Database Localization as Soon as Possible
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: September 10, 2010

If using SET DATABASE LOCALIZATION to change the current language of the database, make sure to run the command at the earliest point possible when the database starts up. This is because the command can only affect the language of elements that are not currently loaded.

As an example, take the following pseudo code:

  \\  assuming the database is currently running in English

$win:=Open form window("form1")
DIALOG("form1")
CLOSE WINDOW($win)

SET DATABASE LOCALIZATION("fr")

$win:=Open form window("form2")
DIALOG("form2")
CLOSE WINDOW($win)


In the above situation, when the code finishes, you will have form1 displaying in English and form2 displaying in French.

To avoid situations like this, you should execute the SET DATABASE LOCALIZATION command as early in the startup routine as possible.