Problem with localization and some hint for better studio support of messages

Hi,

I have a wierd problem and right now I cannot find the solution, only some workaround but not 100%.

My app useing two language, English and Hungarian. On my development machine everything is working ok, but on the production server which is a Ubuntu 16.04 server with tomcat8 and postgres 9.5 i have some problems with localization.

  1. In the java code especially in showNotification method call, I use hungarian sentences and national characters. In the development machine it is displaying correctly, but in the production szerver the notification popup show garbage in the place of accented characters.
    The only solution was to use Intellij ID helper to convert the string literals to basic latin and escaping all accented characters. But it is a workaround only. Can You hint me a proer way to do it (message constants for example which can be localized), and the cause of the wierd working?

  2. When I select the default language for a user, on the development machine, everything is working correctly, but on the server some times displaying the correct version of text some times falling back to english. I cannot find the root cause of this, so i am forced to overwrite the english texts and make the app single language…

  3. I set up the correct date and time format in the studio for the hungarian locale. But in the development machine all date which is in table columns are displaying in english format and all field in editors displaying in correct format. On the server machine all date field in tables or editors displaying in english format. I am forced to use formatters for tables and dateformat property in edit fields to use the correct format. which is not good if I want to support two languages.

Some problems with studio and localization:

  1. Very hard to edit side by side two language messages file. Because the english one is filled up, but the other language messages file not contains all the field of he english one, and even those which are in are in different order. This makes the side by side translation ver hard and errorprone.

  2. If i change the the order of languages in the studio project settings (in default english is the first, and other language like hungarian is the second, and i can reorder this order), then all message files are messing up, like the hungarian will get the english version of files, but the english version will be empty… I think it is a bug.

  3. If we set up the localized date and currency formats in the studio project settings, then the project must use it project wide and if the user is switching the languages or the browser advertising a language the project must behave correctly and use the correct format. It s not the case and we are forced to fix the formats in the code/xml. If this is not a bug i think it is against multilocale support.

Regards

Sandor Dobi

Hi Sandor,

In the java code especially in showNotification method call, I use hungarian sentences and national characters. In the development machine it is displaying correctly, but in the production szerver the notification popup show garbage in the place of accented characters.

Please make sure that your source files have UTF-8 encoding and your production server is started with -Dfile.encoding=UTF-8 JVM option.

When I select the default language for a user, on the development machine, everything is working correctly, but on the server some times displaying the correct version of text some times falling back to english.

Please take a look at the language selection procedure explained here. Maybe it will help you to find out the reason.

I set up the correct date and time format in the studio for the hungarian locale. But in the development machine all date which is in table columns are displaying in english format and all field in editors displaying in correct format. On the server machine all date field in tables or editors displaying in english format.

Could you attach here your main message packs:


modules\core\src\{your root package}\core\messages.properties
modules\core\src\{your root package}\core\messages_hu.properties

modules\web\src\{your root package}\web\messages.properties
modules\web\src\{your root package}\web\messages_hu.properties

Very hard to edit side by side two language messages file.

Try to open messages as a resource bundle in IntelliJ - it will present them in very convenient format.

If i change the the order of languages in the studio project settings …, then all message files are messing up

It’s a known issue, we are going to fix it somehow in a future release.

If we set up the localized date and currency formats in the studio project settings, then the project must use it project wide…

Could you please elaborate on this?

Hi,

Thanks for the quick answer.

> Please make sure that your source files have UTF-8 encoding and your production server is started with
> -Dfile.encoding=UTF-8 JVM option.

All source files ar encoded UTF8 as it is the default encoding set up in Intellij
I’II try your suggestion

> Could you please elaborate on this?

Let we assume we have a project which is support multilanguage and multi region users.

We setting up 2 or 3 languages and eglish is the default. The region formats (number currency, date) tied in studio to the language. So if an english user logging in he will see the english version of the client. If a hungarian user will log in he must see the hungarian version of the client. The language selection must based on browser language OR the user settings, when he explicitly set up the correct language on the login screen or in user settings.

If we want to use this mechanism correctly we must NOT override the formats for date/currency/number programatically in the source code. But to achive this the automatic mechanism must work everywhere in the project. So solely based on language selection every date, currency, number must display in a correct format.

This is not working right now. The edit cells are regarding the language selection and based on they will change the displayformat, but in table cells date always displaying in english version.

I’ll attach later the message files, to study.

Regards

The language selection must based on browser language OR the user settings

Do you have cuba.localeSelectVisible = false and no language specified in user settings? We found an issue with resetting the language to default after logout, regardless of browser language. We’ll fix it ASAP.

The edit cells are regarding the language selection and based on they will change the displayformat, but in table cells date always displaying in english version.

This is very strange. Seeing your message files with format settings may help us to find out the reason.