OT4XB: MakeLangId()

This forum is for general support of Xbase++
Post Reply
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

OT4XB: MakeLangId()

#1 Post 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

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: OT4XB: MakeLangId()

#2 Post 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"
greetings by OHR
Jimmy

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: OT4XB: MakeLangId()

#3 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply