Page 1 of 1
OT4XB: MakeLangId()
Posted: Thu Nov 02, 2023 8:45 am
by unixkd
Hi All
I came across this function in - OT4XB: MakeLangId(), can it help in the development of multi-language application or where can it be used
Thanks
Joe
Re: OT4XB: MakeLangId()
Posted: Thu Nov 02, 2023 10:43 am
by Auge_Ohr
hi,
as i know MakeLangId is for "System-Message" like Errorsys.
it will NOT "translate" your "hardcode Language"
---
Fivewin have a Function FWString( cString )
it use a Array with 6 x Language
Code: Select all
static nLanguage := 0 // Initially will be set by FWLanguageID() function
// 1 English, 2 Spanish, 3 French, 4 Portugese, 5 German, 6 Italian
static aStrings := { ;
{ "Attention", "Atención", "Attention", "Atençăo", "Achtung", "Attenzione" }, ;
...
{ "Save To File", "Guardar en archivo", "Enregistrer dans un fichier", "In Datei speichern", "Save To File", "Save To File" } ;
}
---
i can "add" my own String like this
Code: Select all
PROCEDURE AddTranslates()
LOCAL aTranslates := {}
AADD( aTranslates, { "file", "archivo", "déposer", "arquivo", "Datei", "file" } )
...
AADD( aTranslates, { "export to Excel", "Exportar a Excel", "exporter vers Excel", "Exportar para Excel", "nach Excel exportieren", "esportare in Excel" } )
AEVAL( aTranslates, { | a | FWAddString( a ) } )
RETURN
have a look at
https://www.hmgforum.com/viewtopic.php?p=69878
that CODE will "translate" into 6 Language
! Note : limited by Google if you ask "too much"
Re: OT4XB: MakeLangId()
Posted: Fri Nov 03, 2023 7:59 am
by Tom
From the ot4xb reference (you may find the PDF available on a GoogleDrive if you search for "OT4XB help"):
MakeLangId( nPrimaryLanguage , nSubLanguage ) -> nLanguageIdentifier
Creates a language identifier from a primary language identifier and a sublanguage identifier.
<usPrimaryLanguage>
Primary language identifier. This identifier can be a predefined value or a value for a
user-defined primary language. For a user-defined language, the identifier is a value in the
range 0x0200 to 0x03FF. All other values are reserved for operating system use .
<usSubLanguage >
Sublanguage identifier. This parameter can be a predefined sublanguage identifier or a
user-defined sublanguage. For a user-defined sublanguage, the identifier is a value in the
range 0x20 to 0x3F. All other values are reserved for operating system use.
If you are looking for a way to create a multi-language application, you first need to extract all textes shown in the app.
Anyway, eXpress++ provides a function "DC_LangSet" which sets the language for eXpress++-messages. You may use the return value of this function for your own multi-language system, but this is really monkey work.