PDA

View Full Version : problem with locale messages


ng-first
09-21-2007, 06:02 AM
Hi all :-),

We have extend the masterdata class, adding several attribute: for example TRATTAMENTO, DIMENSIONI, DUREZZA_HB,etc. etc. ...
We assigned to them, the same <DisplayName> value.
In this way:
...
<Attribute>
TRATTAMENTO
<DisplayName>TRATTAMENTO</DisplayName>
<Index>7</Index>
<Visible>true</Visible>
<IncludeIn2DBOM>true</IncludeIn2DBOM>
</Attribute>
....
But in this case, if we run model manager using english locale, they appear in italian.

So, we would like that if we run model manager using english locale, then they appear in english or, if we run model manager using spanish locale, then they appear in spanish, and so on ...
To do this, I added a row in each of locale files messages: I mean, that files contained in the directory "C:\Programmi\CoCreate\OneSpace Manager 2006\lib\nls\msg\...".
For example for the TRATTAMENTO attribute, I add this rows:
1) 519 TREATMENT --> in C:\Programmi\CoCreate\OneSpace Manager 2006\lib\nls\msg\C\awm_stda.msg file;
2) 519 TRATTAMENTO --> in C:\Programmi\CoCreate\OneSpace Manager 2006\lib\nls\msg\italian\awm_stda.msg file;
3) 519 TRAITEMENT --> in C:\Programmi\CoCreate\OneSpace Manager 2006\lib\nls\msg\french\awm_stda.msg file;
4) 519 TRATAMIENTO --> in C:\Programmi\CoCreate\OneSpace Manager 2006\lib\nls\msg\spanish\awm_stda.msg file;
5) 519 BEHANDLUNG --> in C:\Programmi\CoCreate\OneSpace Manager 2006\lib\nls\msg\german\awm_stda.msg file;

and in our customized xml file I change the attribute tag in this way:
....
<Attribute>
TRATTAMENTO
<DisplayName catalog="awm_stda" msg_num="519">TRATTAMENTO</DisplayName>
<Index>7</Index>
<Visible>true</Visible>
<IncludeIn2DBOM>true</IncludeIn2DBOM>
</Attribute>
....
I can't undestand the reason why, when I run model manager using english locale, I always see the TRATTAMENTO dysplay name in the attribute windows, and not the corrisponding translation: in this case, TREATMENT instead of TRATTAMENTO.

Can anyone help me?
Can anyone explain to me how implementing the translation of the customized attributes?
I'm working with Model Manager 1500B.

Thanks to all,
Nadia

alexniccoli
09-21-2007, 06:38 AM
I think your tag is ok:

<DisplayName catalog="awm_stda" msg_num="519">TREATMENT</DisplayName>

I think that using an existing msg file is not good,try create your custom.msg
putting inside all languages.Try also debugging inside netbeans.Consider that cocreare in the future release can increment the actual awm_stda.msg file.
Tell me if is ok.

I have tested your case:
using a standard msg file,there are problems,but creating a custom.msg all works fine.

Alessandro

ng-first
09-21-2007, 07:37 AM
Hi all.
Thanks Alessandro for your help :-).
I created my custom.msg, one for language, and if I run Model Manager inside NeatBeans all work fine !!!
Even changing language in dev.properties file, the rigth translation appear.

But why when I run Model Manager StandAlone (that has language=italian I supposed ... ) I can't see the italian translation !!!

:confused: Why Model Manager works fine, only if I run it inside NeatBeans?

Thanks in advanced,
Nadia

alexniccoli
09-24-2007, 12:53 AM
I have tested your problem but,rebulding Model Manager from Netbeans
catalogs are ok,inside and outside Netbeans.If i set LANG=italian i see display name from .\lib\nls\msg\italian\custom.msg
instead if i set LANG=C i see display name from .\lib\nls\msg\C\custom.msg.

Check if:
1- xml file in user profile is ok(with attribute TRATTAMENTO like who want).
2- at login time,you choose the correct xml file(if you have more than one)
3- files c:\Programs\CoCreate\Shared\Model Manager 2007\lib\nls\msg\italian\custom.msg, c:\Programs\CoCreate\Shared\Model Manager 2007\lib\nls\msg\C\custom.msg ecc.. are ok

A.Niccoli

ng-first
09-24-2007, 01:56 AM
Thanks Alex.
This morning I make a deployment package and, after to have dowloaded the new Model Manager version, all work fine.

I have another question about language ... do you know where Model Manager signs the language that it use?
... maybe a propertie in session?
And if there is a way to change it?

Thanks all,
Nadia

alexniccoli
09-24-2007, 02:18 AM
There are 2 ways:
1-Set environment variable LANG = italian or C or etc (in the system).
2-Modify run.mm adding at the beginning
set LANG=italian or LANG=C or etc.
3-Modify DataManager.java that is the class whith method main.Inside the constructor there is the setting of the language.I have never changed it.

Alessandro

ng-first
09-24-2007, 02:34 AM
thanks for the precious suggestions.
Now I make some tests and I will inform you later :) ...
Thanks all.

By,
Nadia