dbTalk Databases Forums  

multiple language

comp.databases.paradox comp.databases.paradox


Discuss multiple language in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jon J
 
Posts: n/a

Default multiple language - 10-27-2006 , 03:06 AM






Hi again.

Our current application needs to be expanded to support multiple languages.
So I'm wondering what the best practice is. Since we have _alot_ of forms in
the app I'd like to get it right the first time.

I have received a db which consist of the translated text where the first
field indicate the countrycode. When I open the database the russian
translation is all ###'ed because its cyrillic. Do I need a special font for
this in paradox? I tried switching it to a font which has support for
cyrillic but it doesn't help.

Regards
Jon



Reply With Quote
  #2  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: multiple language - 10-27-2006 , 09:11 AM






The table language also needs to support the language you want in it. So you
need to pick one that supports cyrillic for the russian one. You may need to
have a variety of tables with different language drivers depending on how many
languages and what their character sets are.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and non-profits since
1982


Reply With Quote
  #3  
Old   
Jon J
 
Posts: n/a

Default Re: multiple language - 10-31-2006 , 05:26 AM




"Dennis Santoro" <RDAPres (AT) NoRDASpamWorldWide (DOT) com> wrote in
news:45421395.66BB55 (AT) NoRDASpamWorldWide (DOT) com...
Quote:
The table language also needs to support the language you want in it. So
you
need to pick one that supports cyrillic for the russian one. You may need
to
have a variety of tables with different language drivers depending on how
many
languages and what their character sets are.
Thanks, got the cyrillic working now.

I'm going to implement this feature by first checking the language the user
have chosen and then, for each form, enumerating all text fields and
checking whether they have a value that is translated in the users language
in the database. My question is how I can set the value when I have the
objects name within a string variable. It works fine if I just type it, but
I dont know how to reference it....I know this is a typical "variable
variable" problem but I dont know what else to do when there is no
enumUIObjects method but only enumUIObjectProperties....
Long story short, how do I asign a value to an object which name I have
within a string variable?

Another thing - I actually thought isPreFilter() would be useful for this
(would save me the enumeration) but again...how do I get access to the
uiobject? Both self and subject objects returns the form object.

TIA
Jon




Reply With Quote
  #4  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: multiple language - 10-31-2006 , 08:44 AM



What I do is have a routine in my main menu form that checks for the current
language setting (assigned by the user on first opening and stored in a setting
table). That language has a numeric code. Then my prompt table is opened on the
language code index and setranged. Each object has a label ID assigned and a
library is called to set the labels on each form as it opens. Since the label
is retrieved by integer and the prompts in each language have the same integer
for each object, once the prompt table is open and properly ranged to one
language, the correct language prompts are assigned. The user also has a change
language option once the main form is open. This changes the setting, reranges
the prompt table and reassigns the prompts. As other forms open all they have
to do is assign the prompts since the language table is already ranged.
Basically, you can have have objects assign themselves on opening. On the main
menu I use a custom method that assigns all objects because of the need to be
able to relable if a user calls the change language option. Obviously this
means having object names. In the forms where the objects call their own labels
you only need Self.labletext or whatever you are assigning the text to or you
can do it the same way as you do your main form.

This, for example, would be the call in the main menu in a custom method called
in init.

TitleBox.text = lbUtils.cmSetPrompt(16)

WelcomeTitle = lbUtils.cmSetPrompt(17)

tab1.text = lbUtils.cmSetPrompt(18)
tab2.text = lbUtils.cmSetPrompt(19)
tab3.text = lbUtils.cmSetPrompt(20)
tab4.text = lbUtils.cmSetPrompt(21)
tab5.text = lbUtils.cmSetPrompt(22)

CurrentUserLabel.text = lbUtils.cmSetPrompt(83)

;//Button labels
btnCloseForm.labeltext = lbUtils.cmSetPrompt(23)
btnOpenProfiles.labeltext = lbUtils.cmSetPrompt(26)
btnTextTrans.labeltext = lbUtils.cmSetPrompt(27)
btnLUEdit.labeltext = lbUtils.cmSetPrompt(28)
btnSwapProfiles.labeltext = lbUtils.cmSetPrompt(66)
btnSetUserDefault.labeltext = lbUtils.cmSetPrompt(93)
btnUserProfiles.labeltext = lbUtils.cmSetPrompt(154)
btnTestTrans.labeltext = lbUtils.cmSetPrompt(163)

strBtn1 = lbUtils.cmSetPrompt(133)
btnVwR1.labeltext = strBtn1
btnPrnR1.labeltext = strBtn1


strErrorMsg1 = lbUtils.cmSetPrompt(24)
strErrorMsg2 = lbUtils.cmSetPrompt(25)
strErrorMsg3 = lbUtils.cmSetPrompt(98)
strErrorMsg4 = lbUtils.cmSetPrompt(43)

The custom method they are calling is simply:
method cmSetPrompt(liPromptID Longint) string
if tcPrompttext.locate("PromptID",liPromptID) then
return tcPrompttext.prompt
else

Return "Not Found"
endif

endMethod

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and non-profits since
1982



Reply With Quote
  #5  
Old   
Robert Molyneux
 
Posts: n/a

Default Re: multiple language - 10-31-2006 , 02:15 PM



Just out of curiosity, does this add much overhead to opening the form?

"Dennis Santoro" <RDAPres (AT) NoRDASpamWorldWide (DOT) com> wrote

Quote:
What I do is have a routine in my main menu form that checks for the
current
language setting (assigned by the user on first opening and stored in a
setting
table). That language has a numeric code. Then my prompt table is opened
on the
language code index and setranged. Each object has a label ID assigned and
a
library is called to set the labels on each form as it opens. Since the
label
is retrieved by integer and the prompts in each language have the same
integer
for each object, once the prompt table is open and properly ranged to one
language, the correct language prompts are assigned. The user also has a
change
language option once the main form is open. This changes the setting,
reranges
the prompt table and reassigns the prompts. As other forms open all they
have
to do is assign the prompts since the language table is already ranged.
Basically, you can have have objects assign themselves on opening. On the
main
menu I use a custom method that assigns all objects because of the need to
be
able to relable if a user calls the change language option. Obviously this
means having object names. In the forms where the objects call their own
labels
you only need Self.labletext or whatever you are assigning the text to or
you
can do it the same way as you do your main form.

This, for example, would be the call in the main menu in a custom method
called
in init.

TitleBox.text = lbUtils.cmSetPrompt(16)

WelcomeTitle = lbUtils.cmSetPrompt(17)

tab1.text = lbUtils.cmSetPrompt(18)
tab2.text = lbUtils.cmSetPrompt(19)
tab3.text = lbUtils.cmSetPrompt(20)
tab4.text = lbUtils.cmSetPrompt(21)
tab5.text = lbUtils.cmSetPrompt(22)

CurrentUserLabel.text = lbUtils.cmSetPrompt(83)

;//Button labels
btnCloseForm.labeltext = lbUtils.cmSetPrompt(23)
btnOpenProfiles.labeltext = lbUtils.cmSetPrompt(26)
btnTextTrans.labeltext = lbUtils.cmSetPrompt(27)
btnLUEdit.labeltext = lbUtils.cmSetPrompt(28)
btnSwapProfiles.labeltext = lbUtils.cmSetPrompt(66)
btnSetUserDefault.labeltext = lbUtils.cmSetPrompt(93)
btnUserProfiles.labeltext = lbUtils.cmSetPrompt(154)
btnTestTrans.labeltext = lbUtils.cmSetPrompt(163)

strBtn1 = lbUtils.cmSetPrompt(133)
btnVwR1.labeltext = strBtn1
btnPrnR1.labeltext = strBtn1


strErrorMsg1 = lbUtils.cmSetPrompt(24)
strErrorMsg2 = lbUtils.cmSetPrompt(25)
strErrorMsg3 = lbUtils.cmSetPrompt(98)
strErrorMsg4 = lbUtils.cmSetPrompt(43)

The custom method they are calling is simply:
method cmSetPrompt(liPromptID Longint) string
if tcPrompttext.locate("PromptID",liPromptID) then
return tcPrompttext.prompt
else

Return "Not Found"
endif

endMethod

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and non-profits
since
1982





Reply With Quote
  #6  
Old   
Dennis Santoro
 
Posts: n/a

Default Re: multiple language - 10-31-2006 , 04:08 PM



Not really. It could probably also be sped up with qlocate and the addition of a
compound index but I have not had any complaints.

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and non-profits since
1982



Reply With Quote
  #7  
Old   
Robert Molyneux
 
Posts: n/a

Default Re: multiple language - 11-01-2006 , 01:14 AM



I was thinking of using the field's self.tablename and self.name to find the
appropriate "data dictionary" entry. for the fields.

"Robert Molyneux" <ibisnest_removeantispam_ (AT) iinet (DOT) net.au> wrote

Quote:
Just out of curiosity, does this add much overhead to opening the form?

"Dennis Santoro" <RDAPres (AT) NoRDASpamWorldWide (DOT) com> wrote in message
news:4547614A.ECBC0EF5 (AT) NoRDASpamWorldWide (DOT) com...
What I do is have a routine in my main menu form that checks for the
current
language setting (assigned by the user on first opening and stored in a
setting
table). That language has a numeric code. Then my prompt table is opened
on the
language code index and setranged. Each object has a label ID assigned
and
a
library is called to set the labels on each form as it opens. Since the
label
is retrieved by integer and the prompts in each language have the same
integer
for each object, once the prompt table is open and properly ranged to
one
language, the correct language prompts are assigned. The user also has a
change
language option once the main form is open. This changes the setting,
reranges
the prompt table and reassigns the prompts. As other forms open all they
have
to do is assign the prompts since the language table is already ranged.
Basically, you can have have objects assign themselves on opening. On
the
main
menu I use a custom method that assigns all objects because of the need
to
be
able to relable if a user calls the change language option. Obviously
this
means having object names. In the forms where the objects call their own
labels
you only need Self.labletext or whatever you are assigning the text to
or
you
can do it the same way as you do your main form.

This, for example, would be the call in the main menu in a custom method
called
in init.

TitleBox.text = lbUtils.cmSetPrompt(16)

WelcomeTitle = lbUtils.cmSetPrompt(17)

tab1.text = lbUtils.cmSetPrompt(18)
tab2.text = lbUtils.cmSetPrompt(19)
tab3.text = lbUtils.cmSetPrompt(20)
tab4.text = lbUtils.cmSetPrompt(21)
tab5.text = lbUtils.cmSetPrompt(22)

CurrentUserLabel.text = lbUtils.cmSetPrompt(83)

;//Button labels
btnCloseForm.labeltext = lbUtils.cmSetPrompt(23)
btnOpenProfiles.labeltext = lbUtils.cmSetPrompt(26)
btnTextTrans.labeltext = lbUtils.cmSetPrompt(27)
btnLUEdit.labeltext = lbUtils.cmSetPrompt(28)
btnSwapProfiles.labeltext = lbUtils.cmSetPrompt(66)
btnSetUserDefault.labeltext = lbUtils.cmSetPrompt(93)
btnUserProfiles.labeltext = lbUtils.cmSetPrompt(154)
btnTestTrans.labeltext = lbUtils.cmSetPrompt(163)

strBtn1 = lbUtils.cmSetPrompt(133)
btnVwR1.labeltext = strBtn1
btnPrnR1.labeltext = strBtn1


strErrorMsg1 = lbUtils.cmSetPrompt(24)
strErrorMsg2 = lbUtils.cmSetPrompt(25)
strErrorMsg3 = lbUtils.cmSetPrompt(98)
strErrorMsg4 = lbUtils.cmSetPrompt(43)

The custom method they are calling is simply:
method cmSetPrompt(liPromptID Longint) string
if tcPrompttext.locate("PromptID",liPromptID) then
return tcPrompttext.prompt
else

Return "Not Found"
endif

endMethod

Denn Santoro
President
Resource Development Associates
http://www.RDAWorldWide.Com
Offices in the United States and Germany
Providing solutions to health care, business, governments and
non-profits
since
1982







Reply With Quote
  #8  
Old   
moroivan
 
Posts: n/a

Default Re: multiple language - 11-01-2006 , 06:02 AM



Quote:
Long story short, how do I asign a value to an object which name I have
within a string variable?
e.g. you have a field "Fld" on the Page "Page1"

var
s String
endVar

s = "Fld"
msgInfo("", page1.(s).color)





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.