OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Designed to provide support for localized registration parameters, the TLocaleString Struct defines a localizable substitute for char* strings. More...
#include <owl/lclstrng.h>
Public Member Functions | |
const tchar * | Translate (TLangId lang) |
translate string | |
operator const tchar * () const | |
return current string | |
void | operator= (const tchar *str) |
int | Compare (const tchar *str, TLangId lang) |
insensitive compare | |
Static Public Member Functions | |
static TLangId | GetSystemLangId () |
platform-dependent implementation | |
static TLangId | GetUserLangId () |
platform-dependent implementation | |
static int | IsNativeLangId (TLangId lang) |
returns bool true if native | |
static int | CompareLang (const tchar *s1, const tchar *s2, TLangId) |
This function may be re-implemented with enhanced NLS support in another module. | |
Public Attributes | |
const tchar * | Private |
string pointer used for initialization | |
Static Public Attributes | |
static TLangId | SystemDefaultLangId = TLocaleString::GetSystemLangId() |
The default language identifier. | |
static TLangId | UserDefaultLangId = TLocaleString::GetUserLangId() |
The user-defined default language identifier. | |
static TLangId | NativeLangId = TLocaleString::GetSystemLangId() |
The base language ID of non-localized strings. | |
static HINSTANCE | Module = nullptr |
The handle of the file containing the resource. | |
static TLocaleString | Null = {null_string} |
reference a null string | |
Designed to provide support for localized registration parameters, the TLocaleString Struct defines a localizable substitute for char* strings.
localizable substitute for char*
These strings, which describe both OLE and non-OLE enabled objects to the user, are available in whatever language the user needs. This Struct supports ObjectWindows' Doc/View as well as ObjectComponents' OLE-enabled applications. The public member functions, which supply information about the user's language, the native language, and a description of the string marked for localization, simplify the process of translating and comparing strings in a given language.
To localize the string resource, TLocaleString uses several user-entered prefixes to determine what kind of string to translate. Each prefix must be followed by a valid resource identifier (a standard C identifier).The following table lists the prefixes TLocaleString uses to localize strings. Each prefix is followed by a sample entry.
@ TXY
The string is a series of characters interpreted as a resource ID and is accessed only from a resource file. It is never used directly.# 1045
The string is a series of digits interpreted as a resource ID and is accessed from a resource file. It is never used directly.! MyWindow
The string is translated if it is not in the native language; otherwise, this string is used directly.See the section on localizing symbol names in the ObjectWindows Programmer's Guide for more information about localizing strings.
Definition at line 68 of file lclstrng.h.
insensitive compare
Using the specified language (lang), Compare compares TLocaleString with another string.
It uses the standard string compare and the language-specific collation scheme. It returns one of the following values:
0 There
is no match between the two strings.1 This
string is greater than the other string.-1 This
string is less than the other string. Definition at line 410 of file locale.cpp.
This function may be re-implemented with enhanced NLS support in another module.
Definition at line 35 of file localeco.cpp.
|
static |
platform-dependent implementation
Returns the system language ID, which can be the same as the UserLangId.
Definition at line 17 of file localeco.cpp.
|
static |
platform-dependent implementation
Returns the user language ID.
For single user systems, this is the same as LangSysDefault. The language ID is a predefined number that represents a base language and dialect.
Definition at line 26 of file localeco.cpp.
returns bool true if native
Returns true if lang equals the native system language.
Definition at line 416 of file locale.cpp.
owl::TLocaleString::operator const tchar * | ( | ) | const |
return current string
Definition at line 384 of file locale.cpp.
References AUTOLANG_CACHEDLOAD, AUTOLANG_CACHEDNEUT, AUTOLANG_LOAD, AUTOLANG_RCID, and AUTOLANG_XLAT.
Definition at line 74 of file lclstrng.h.
translate string
Translates the string to the given language.
Translate follows this order of preference in order to choose a language for translation:
Definition at line 344 of file locale.cpp.
References AUTOLANG_CACHEDLOAD, AUTOLANG_CACHEDNEUT, AUTOLANG_LOAD, AUTOLANG_RCID, AUTOLANG_XLAT, owl::LangNeutral, owl::LangSysDefault, and owl::LangUserDefault.
The handle of the file containing the resource.
must define and set to resource module
Definition at line 93 of file lclstrng.h.
|
static |
The base language ID of non-localized strings.
must define and set to lang. of literals
Definition at line 90 of file lclstrng.h.
|
static |
reference a null string
Definition at line 94 of file lclstrng.h.
const tchar* owl::TLocaleString::Private |
string pointer used for initialization
Definition at line 77 of file lclstrng.h.
|
static |
The default language identifier.
must define and set to system language
Definition at line 84 of file lclstrng.h.
|
static |
The user-defined default language identifier.
same as system language if single user
Definition at line 87 of file lclstrng.h.