Página 1 de 1

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:00 pm
por Giuseppe Bogetti
Hi,
studying the RichPad sample I've found two functions used to retrieve
language strings.
LT()
LT2()
What is the difference between them ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:31 pm
por ignacio
Giussepe,
LT2() takes off the '&'.
Regards,
"Giuseppe Bogetti" <bgsoft@tiscali.it> escribió en el mensaje
news:lfpwla99oeg3$[email=.ojr3gi0psyyh.dlg@40tude.net...].ojr3gi0psyyh.dlg@40tude.net...[/email]
> Hi,
>
> studying the RichPad sample I've found two functions used to retrieve
> language strings.
> LT()
> LT2()
>
> What is the difference between them ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:31 pm
por InvalidAccount
Giussepe,
LT2() takes off the '&'.
Regards,
"Giuseppe Bogetti" <bgsoft@tiscali.it> escribió en el mensaje
news:lfpwla99oeg3$[email=.ojr3gi0psyyh.dlg@40tude.net...].ojr3gi0psyyh.dlg@40tude.net...[/email]
> Hi,
>
> studying the RichPad sample I've found two functions used to retrieve
> language strings.
> LT()
> LT2()
>
> What is the difference between them ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:31 pm
por jfgimenez
Giuseppe,
> studying the RichPad sample I've found two functions used to retrieve
> language strings.
> LT()
> LT2()
>
> What is the difference between them ?
LT2() removes all "&" characters from the string. However, if you need to
show an ampersand in a string, just type it twice: "&&".
It's usefull, i.e., when using the same string for a menuitem and a form
title.
--
Regards,
Jose F. Gimenez

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:31 pm
por jfgimenez
Giuseppe,
> studying the RichPad sample I've found two functions used to retrieve
> language strings.
> LT()
> LT2()
>
> What is the difference between them ?
LT2() removes all "&" characters from the string. However, if you need to
show an ampersand in a string, just type it twice: "&&".
It's usefull, i.e., when using the same string for a menuitem and a form
title.
--
Regards,
Jose F. Gimenez

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:44 pm
por Giuseppe Bogetti
In data Tue, 15 Mar 2005 12:31:15 +0100, Ignacio Ortiz de Zúñiga ha
scritto:
Ignacio,
> LT2() takes off the '&'.
>
> Regards,
Thanks
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:44 pm
por Giuseppe Bogetti
In data Tue, 15 Mar 2005 12:31:15 +0100, Ignacio Ortiz de Zúñiga ha
scritto:
Ignacio,
> LT2() takes off the '&'.
>
> Regards,
Thanks
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:45 pm
por Giuseppe Bogetti
In data Tue, 15 Mar 2005 12:31:39 +0100, Jose F. Gimenez ha scritto:
Jose,
> LT2() removes all "&" characters from the string. However, if you need to
> show an ampersand in a string, just type it twice: "&&".
>
> It's usefull, i.e., when using the same string for a menuitem and a form
> title.
Thanks.
I've also noticed that in some cases extra parameters are sent for an
"inline" replacement into string.
Do I have to call this parameters %1, %2 .... %n into the string to be
processed ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:45 pm
por Giuseppe Bogetti
In data Tue, 15 Mar 2005 12:31:39 +0100, Jose F. Gimenez ha scritto:
Jose,
> LT2() removes all "&" characters from the string. However, if you need to
> show an ampersand in a string, just type it twice: "&&".
>
> It's usefull, i.e., when using the same string for a menuitem and a form
> title.
Thanks.
I've also noticed that in some cases extra parameters are sent for an
"inline" replacement into string.
Do I have to call this parameters %1, %2 .... %n into the string to be
processed ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:51 pm
por jfgimenez
Giuseppe,
> I've also noticed that in some cases extra parameters are sent for an
> "inline" replacement into string.
>
> Do I have to call this parameters %1, %2 .... %n into the string to be
> processed ?
Yes. You can use %1, %2, etc. in the string, and call LT() passing the
string and other strings to be replaced. I.e:
- The resource string is: "Error: %1 in module %2, line %3"
- Call it as: LT( MY_STRING, "Some error", ProcName(), LTrim( Str(
ProcLine() ) ) )
It's similar, but limited, to printf() in C
--
Regards,
Jose F. Gimenez

Using SetLanguage

Publicado: Mar Mar 15, 2005 12:51 pm
por jfgimenez
Giuseppe,
> I've also noticed that in some cases extra parameters are sent for an
> "inline" replacement into string.
>
> Do I have to call this parameters %1, %2 .... %n into the string to be
> processed ?
Yes. You can use %1, %2, etc. in the string, and call LT() passing the
string and other strings to be replaced. I.e:
- The resource string is: "Error: %1 in module %2, line %3"
- Call it as: LT( MY_STRING, "Some error", ProcName(), LTrim( Str(
ProcLine() ) ) )
It's similar, but limited, to printf() in C
--
Regards,
Jose F. Gimenez

Using SetLanguage

Publicado: Mar Mar 15, 2005 1:39 pm
por Giuseppe Bogetti
In data Tue, 15 Mar 2005 12:51:32 +0100, Jose F. Gimenez ha scritto:
Jose,
> Yes. You can use %1, %2, etc. in the string, and call LT() passing the
> string and other strings to be replaced. I.e:
>
> - The resource string is: "Error: %1 in module %2, line %3"
>
> - Call it as: LT( MY_STRING, "Some error", ProcName(), LTrim( Str(
> ProcLine() ) ) )
>
> It's similar, but limited, to printf() in C
Thanks
Is there a function which let me know the supported languages linked to an
application (i.e. the stringtables defined ) ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 1:39 pm
por Giuseppe Bogetti
In data Tue, 15 Mar 2005 12:51:32 +0100, Jose F. Gimenez ha scritto:
Jose,
> Yes. You can use %1, %2, etc. in the string, and call LT() passing the
> string and other strings to be replaced. I.e:
>
> - The resource string is: "Error: %1 in module %2, line %3"
>
> - Call it as: LT( MY_STRING, "Some error", ProcName(), LTrim( Str(
> ProcLine() ) ) )
>
> It's similar, but limited, to printf() in C
Thanks
Is there a function which let me know the supported languages linked to an
application (i.e. the stringtables defined ) ?
--
Best regards,
Giuseppe Bogetti
B.G. Soft
Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 1:51 pm
por ignacio
Giuseppe,
GetLanguages()
Antother functions:
GetWindowsLanguage()-> nLanguage
SetLanguage( nLanguageID )
Regards,
"Giuseppe Bogetti" <bgsoft@tiscali.it> escribió en el mensaje
news:1bdy7v3kvl43q.35evkv4d22ye$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> In data Tue, 15 Mar 2005 12:51:32 +0100, Jose F. Gimenez ha scritto:
>
> Jose,
>> Yes. You can use %1, %2, etc. in the string, and call LT() passing the
>> string and other strings to be replaced. I.e:
>>
>> - The resource string is: "Error: %1 in module %2, line %3"
>>
>> - Call it as: LT( MY_STRING, "Some error", ProcName(), LTrim( Str(
>> ProcLine() ) ) )
>>
>> It's similar, but limited, to printf() in C
> Thanks
>
> Is there a function which let me know the supported languages linked to an
> application (i.e. the stringtables defined ) ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 1:51 pm
por InvalidAccount
Giuseppe,
GetLanguages()
Antother functions:
GetWindowsLanguage()-> nLanguage
SetLanguage( nLanguageID )
Regards,
"Giuseppe Bogetti" <bgsoft@tiscali.it> escribió en el mensaje
news:1bdy7v3kvl43q.35evkv4d22ye$[email=.dlg@40tude.net...].dlg@40tude.net...[/email]
> In data Tue, 15 Mar 2005 12:51:32 +0100, Jose F. Gimenez ha scritto:
>
> Jose,
>> Yes. You can use %1, %2, etc. in the string, and call LT() passing the
>> string and other strings to be replaced. I.e:
>>
>> - The resource string is: "Error: %1 in module %2, line %3"
>>
>> - Call it as: LT( MY_STRING, "Some error", ProcName(), LTrim( Str(
>> ProcLine() ) ) )
>>
>> It's similar, but limited, to printf() in C
> Thanks
>
> Is there a function which let me know the supported languages linked to an
> application (i.e. the stringtables defined ) ?
>
> --
> Best regards,
>
> Giuseppe Bogetti
> B.G. Soft
> Cuneo - Italy

Using SetLanguage

Publicado: Mar Mar 15, 2005 1:53 pm
por jfgimenez
Giuseppe,
> Is there a function which let me know the supported languages linked to an
> application (i.e. the stringtables defined ) ?
GetLanguages() returns a bi-dimensional array. Each element is { nIdLang,
nLangName }.
But you must create a specific stringtable with the languages supported by
your app. I.e:
STRINGTABLE LANGUAGE 0,0
{
3 "Català"
7 "Deutsch"
9 "English"
10 "Español"
12 "Français"
16 "Italiano"
22 "Portuguese (Portugal)"
86 "Galego"
}
Then, you have to write the stringtables for each language supported. I.e:
#define MENU_FILE 1001
#define MENU_NEW 1002
#define MENU_FORM 1003
....
STRINGTABLE LANGUAGE 10, 0 ; Spanish
{
MENU_FILE "&Archivo"
MENU_NEW "&Nuevo"
MENU_FORM "&Formulario"
....
}
STRINGTABLE LANGUAGE 16, 0 ; Italian
{
MENU_FILE "&File"
MENU_NEW "&Nuovo"
MENU_FORM "&Form"
....
}
--
Regards,
Jose F. Gimenez

Using SetLanguage

Publicado: Mar Mar 15, 2005 1:53 pm
por jfgimenez
Giuseppe,
> Is there a function which let me know the supported languages linked to an
> application (i.e. the stringtables defined ) ?
GetLanguages() returns a bi-dimensional array. Each element is { nIdLang,
nLangName }.
But you must create a specific stringtable with the languages supported by
your app. I.e:
STRINGTABLE LANGUAGE 0,0
{
3 "Català"
7 "Deutsch"
9 "English"
10 "Español"
12 "Français"
16 "Italiano"
22 "Portuguese (Portugal)"
86 "Galego"
}
Then, you have to write the stringtables for each language supported. I.e:
#define MENU_FILE 1001
#define MENU_NEW 1002
#define MENU_FORM 1003
....
STRINGTABLE LANGUAGE 10, 0 ; Spanish
{
MENU_FILE "&Archivo"
MENU_NEW "&Nuevo"
MENU_FORM "&Formulario"
....
}
STRINGTABLE LANGUAGE 16, 0 ; Italian
{
MENU_FILE "&File"
MENU_NEW "&Nuovo"
MENU_FORM "&Form"
....
}
--
Regards,
Jose F. Gimenez