1999-02-15 18:04:52 -05:00
|
|
|
\section{\class{wxLocale}}\label{wxlocale}
|
|
|
|
|
1999-02-16 15:17:02 -05:00
|
|
|
wxLocale class encapsulates all language-dependent settings and is a
|
|
|
|
generalization of the C locale concept.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
|
|
|
In wxWindows this class manages message catalogs which contain the translations
|
|
|
|
of the strings used to the current language.
|
|
|
|
|
2001-11-23 17:08:45 -05:00
|
|
|
\perlnote{In wxPerl you can't use the '\_' function name, so
|
|
|
|
the {\tt Wx::Locale} module can export the {\tt gettext} and
|
|
|
|
{\tt gettext\_noop} under any given name.
|
2000-12-20 11:10:46 -05:00
|
|
|
\begin{verbatim}
|
2001-11-23 17:08:45 -05:00
|
|
|
# this imports gettext ( equivalent to Wx::GetTranslation
|
|
|
|
# and gettext_noop ( a noop )
|
|
|
|
# into your module
|
|
|
|
use Wx::Locale qw(:default);
|
2000-12-20 11:10:46 -05:00
|
|
|
|
|
|
|
# ....
|
|
|
|
|
2001-11-23 17:08:45 -05:00
|
|
|
# use the functions
|
|
|
|
print gettext( ``Panic!'' );
|
2000-12-20 11:10:46 -05:00
|
|
|
|
2001-11-23 17:08:45 -05:00
|
|
|
button = Wx::Button->new( window, -1, gettext( ``Label'' ) );
|
|
|
|
\end{verbatim}
|
|
|
|
If you need to translate a lot of strings, then adding gettext( ) around
|
|
|
|
each one is a long task ( that is why \_( ) was introduced ), so just choose
|
|
|
|
a shorter name for gettext:
|
|
|
|
\begin{verbatim}
|
|
|
|
#
|
|
|
|
use Wx::Locale 'gettext' => 't',
|
|
|
|
'gettext_noop' => 'gettext_noop';
|
|
|
|
|
|
|
|
# ...
|
|
|
|
|
|
|
|
# use the functions
|
|
|
|
print t( ``Panic!!'' );
|
|
|
|
|
|
|
|
# ...
|
2000-12-20 11:10:46 -05:00
|
|
|
\end{verbatim}
|
|
|
|
}
|
|
|
|
|
1999-02-15 18:04:52 -05:00
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
No base class
|
|
|
|
|
1999-02-26 20:26:26 -05:00
|
|
|
\wxheading{See also}
|
|
|
|
|
2002-12-05 07:04:51 -05:00
|
|
|
\helpref{Internationalization overview}{internationalization},\\
|
|
|
|
\helpref{Internat sample}{sampleinternat}
|
1999-02-26 20:26:26 -05:00
|
|
|
|
1999-02-16 15:17:02 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/intl.h>
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
1999-02-15 18:04:52 -05:00
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
\membersection{Supported languages}\label{wxlanguage}
|
|
|
|
|
|
|
|
The following wxLanguage constants may be used to specify the language
|
|
|
|
in \helpref{Init}{wxlocaleinit} and are returned by
|
|
|
|
\helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}:
|
|
|
|
|
2001-03-25 17:19:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
%% --- --- --- generated code begins here --- --- ---
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
%% This enum is generated by misc/languages/genlang.py
|
|
|
|
%% When making changes, please put them into misc/languages/langtabl.txt
|
|
|
|
\begin{itemize}\itemsep=0pt
|
2001-05-24 06:39:33 -04:00
|
|
|
\item wxLANGUAGE\_DEFAULT -- user's default language as obtained from the operating system
|
|
|
|
\item wxLANGUAGE\_UNKNOWN -- returned by \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}
|
2001-01-18 19:20:49 -05:00
|
|
|
if it fails to detect the default language
|
2001-05-24 06:39:33 -04:00
|
|
|
\item wxLANGUAGE\_USER\_DEFINED -- user defined languages' integer identifiers should start from
|
2001-01-18 19:20:49 -05:00
|
|
|
this
|
|
|
|
\item wxLANGUAGE\_ABKHAZIAN
|
|
|
|
\item wxLANGUAGE\_AFAR
|
|
|
|
\item wxLANGUAGE\_AFRIKAANS
|
|
|
|
\item wxLANGUAGE\_ALBANIAN
|
|
|
|
\item wxLANGUAGE\_AMHARIC
|
|
|
|
\item wxLANGUAGE\_ARABIC
|
|
|
|
\item wxLANGUAGE\_ARABIC\_ALGERIA
|
|
|
|
\item wxLANGUAGE\_ARABIC\_BAHRAIN
|
|
|
|
\item wxLANGUAGE\_ARABIC\_EGYPT
|
|
|
|
\item wxLANGUAGE\_ARABIC\_IRAQ
|
|
|
|
\item wxLANGUAGE\_ARABIC\_JORDAN
|
|
|
|
\item wxLANGUAGE\_ARABIC\_KUWAIT
|
|
|
|
\item wxLANGUAGE\_ARABIC\_LEBANON
|
|
|
|
\item wxLANGUAGE\_ARABIC\_LIBYA
|
|
|
|
\item wxLANGUAGE\_ARABIC\_MOROCCO
|
|
|
|
\item wxLANGUAGE\_ARABIC\_OMAN
|
|
|
|
\item wxLANGUAGE\_ARABIC\_QATAR
|
|
|
|
\item wxLANGUAGE\_ARABIC\_SAUDI\_ARABIA
|
|
|
|
\item wxLANGUAGE\_ARABIC\_SUDAN
|
|
|
|
\item wxLANGUAGE\_ARABIC\_SYRIA
|
|
|
|
\item wxLANGUAGE\_ARABIC\_TUNISIA
|
|
|
|
\item wxLANGUAGE\_ARABIC\_UAE
|
|
|
|
\item wxLANGUAGE\_ARABIC\_YEMEN
|
|
|
|
\item wxLANGUAGE\_ARMENIAN
|
|
|
|
\item wxLANGUAGE\_ASSAMESE
|
|
|
|
\item wxLANGUAGE\_AYMARA
|
|
|
|
\item wxLANGUAGE\_AZERI
|
|
|
|
\item wxLANGUAGE\_AZERI\_CYRILLIC
|
|
|
|
\item wxLANGUAGE\_AZERI\_LATIN
|
|
|
|
\item wxLANGUAGE\_BASHKIR
|
|
|
|
\item wxLANGUAGE\_BASQUE
|
|
|
|
\item wxLANGUAGE\_BELARUSIAN
|
|
|
|
\item wxLANGUAGE\_BENGALI
|
|
|
|
\item wxLANGUAGE\_BHUTANI
|
|
|
|
\item wxLANGUAGE\_BIHARI
|
|
|
|
\item wxLANGUAGE\_BISLAMA
|
|
|
|
\item wxLANGUAGE\_BRETON
|
|
|
|
\item wxLANGUAGE\_BULGARIAN
|
|
|
|
\item wxLANGUAGE\_BURMESE
|
|
|
|
\item wxLANGUAGE\_CAMBODIAN
|
|
|
|
\item wxLANGUAGE\_CATALAN
|
|
|
|
\item wxLANGUAGE\_CHINESE
|
|
|
|
\item wxLANGUAGE\_CHINESE\_SIMPLIFIED
|
|
|
|
\item wxLANGUAGE\_CHINESE\_TRADITIONAL
|
|
|
|
\item wxLANGUAGE\_CHINESE\_HONGKONG
|
|
|
|
\item wxLANGUAGE\_CHINESE\_MACAU
|
|
|
|
\item wxLANGUAGE\_CHINESE\_SINGAPORE
|
|
|
|
\item wxLANGUAGE\_CHINESE\_TAIWAN
|
|
|
|
\item wxLANGUAGE\_CORSICAN
|
|
|
|
\item wxLANGUAGE\_CROATIAN
|
|
|
|
\item wxLANGUAGE\_CZECH
|
|
|
|
\item wxLANGUAGE\_DANISH
|
|
|
|
\item wxLANGUAGE\_DUTCH
|
|
|
|
\item wxLANGUAGE\_DUTCH\_BELGIAN
|
|
|
|
\item wxLANGUAGE\_ENGLISH
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_UK
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_US
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_AUSTRALIA
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_BELIZE
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_BOTSWANA
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_CANADA
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_CARIBBEAN
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_DENMARK
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_EIRE
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_JAMAICA
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_NEW\_ZEALAND
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_PHILIPPINES
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_SOUTH\_AFRICA
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_TRINIDAD
|
|
|
|
\item wxLANGUAGE\_ENGLISH\_ZIMBABWE
|
|
|
|
\item wxLANGUAGE\_ESPERANTO
|
|
|
|
\item wxLANGUAGE\_ESTONIAN
|
|
|
|
\item wxLANGUAGE\_FAEROESE
|
|
|
|
\item wxLANGUAGE\_FARSI
|
|
|
|
\item wxLANGUAGE\_FIJI
|
|
|
|
\item wxLANGUAGE\_FINNISH
|
|
|
|
\item wxLANGUAGE\_FRENCH
|
|
|
|
\item wxLANGUAGE\_FRENCH\_BELGIAN
|
|
|
|
\item wxLANGUAGE\_FRENCH\_CANADIAN
|
|
|
|
\item wxLANGUAGE\_FRENCH\_LUXEMBOURG
|
|
|
|
\item wxLANGUAGE\_FRENCH\_MONACO
|
|
|
|
\item wxLANGUAGE\_FRENCH\_SWISS
|
|
|
|
\item wxLANGUAGE\_FRISIAN
|
|
|
|
\item wxLANGUAGE\_GALICIAN
|
|
|
|
\item wxLANGUAGE\_GEORGIAN
|
|
|
|
\item wxLANGUAGE\_GERMAN
|
|
|
|
\item wxLANGUAGE\_GERMAN\_AUSTRIAN
|
|
|
|
\item wxLANGUAGE\_GERMAN\_BELGIUM
|
|
|
|
\item wxLANGUAGE\_GERMAN\_LIECHTENSTEIN
|
|
|
|
\item wxLANGUAGE\_GERMAN\_LUXEMBOURG
|
|
|
|
\item wxLANGUAGE\_GERMAN\_SWISS
|
|
|
|
\item wxLANGUAGE\_GREEK
|
|
|
|
\item wxLANGUAGE\_GREENLANDIC
|
|
|
|
\item wxLANGUAGE\_GUARANI
|
|
|
|
\item wxLANGUAGE\_GUJARATI
|
|
|
|
\item wxLANGUAGE\_HAUSA
|
|
|
|
\item wxLANGUAGE\_HEBREW
|
|
|
|
\item wxLANGUAGE\_HINDI
|
|
|
|
\item wxLANGUAGE\_HUNGARIAN
|
|
|
|
\item wxLANGUAGE\_ICELANDIC
|
|
|
|
\item wxLANGUAGE\_INDONESIAN
|
|
|
|
\item wxLANGUAGE\_INTERLINGUA
|
|
|
|
\item wxLANGUAGE\_INTERLINGUE
|
|
|
|
\item wxLANGUAGE\_INUKTITUT
|
|
|
|
\item wxLANGUAGE\_INUPIAK
|
|
|
|
\item wxLANGUAGE\_IRISH
|
|
|
|
\item wxLANGUAGE\_ITALIAN
|
|
|
|
\item wxLANGUAGE\_ITALIAN\_SWISS
|
|
|
|
\item wxLANGUAGE\_JAPANESE
|
|
|
|
\item wxLANGUAGE\_JAVANESE
|
|
|
|
\item wxLANGUAGE\_KANNADA
|
|
|
|
\item wxLANGUAGE\_KASHMIRI
|
|
|
|
\item wxLANGUAGE\_KASHMIRI\_INDIA
|
|
|
|
\item wxLANGUAGE\_KAZAKH
|
|
|
|
\item wxLANGUAGE\_KERNEWEK
|
|
|
|
\item wxLANGUAGE\_KINYARWANDA
|
|
|
|
\item wxLANGUAGE\_KIRGHIZ
|
|
|
|
\item wxLANGUAGE\_KIRUNDI
|
|
|
|
\item wxLANGUAGE\_KONKANI
|
|
|
|
\item wxLANGUAGE\_KOREAN
|
|
|
|
\item wxLANGUAGE\_KURDISH
|
|
|
|
\item wxLANGUAGE\_LAOTHIAN
|
|
|
|
\item wxLANGUAGE\_LATIN
|
|
|
|
\item wxLANGUAGE\_LATVIAN
|
|
|
|
\item wxLANGUAGE\_LINGALA
|
|
|
|
\item wxLANGUAGE\_LITHUANIAN
|
|
|
|
\item wxLANGUAGE\_MACEDONIAN
|
|
|
|
\item wxLANGUAGE\_MALAGASY
|
|
|
|
\item wxLANGUAGE\_MALAY
|
|
|
|
\item wxLANGUAGE\_MALAYALAM
|
|
|
|
\item wxLANGUAGE\_MALAY\_BRUNEI\_DARUSSALAM
|
|
|
|
\item wxLANGUAGE\_MALAY\_MALAYSIA
|
|
|
|
\item wxLANGUAGE\_MALTESE
|
|
|
|
\item wxLANGUAGE\_MANIPURI
|
|
|
|
\item wxLANGUAGE\_MAORI
|
|
|
|
\item wxLANGUAGE\_MARATHI
|
|
|
|
\item wxLANGUAGE\_MOLDAVIAN
|
|
|
|
\item wxLANGUAGE\_MONGOLIAN
|
|
|
|
\item wxLANGUAGE\_NAURU
|
|
|
|
\item wxLANGUAGE\_NEPALI
|
|
|
|
\item wxLANGUAGE\_NEPALI\_INDIA
|
|
|
|
\item wxLANGUAGE\_NORWEGIAN\_BOKMAL
|
|
|
|
\item wxLANGUAGE\_NORWEGIAN\_NYNORSK
|
|
|
|
\item wxLANGUAGE\_OCCITAN
|
|
|
|
\item wxLANGUAGE\_ORIYA
|
|
|
|
\item wxLANGUAGE\_OROMO
|
|
|
|
\item wxLANGUAGE\_PASHTO
|
|
|
|
\item wxLANGUAGE\_POLISH
|
|
|
|
\item wxLANGUAGE\_PORTUGUESE
|
|
|
|
\item wxLANGUAGE\_PORTUGUESE\_BRAZILIAN
|
|
|
|
\item wxLANGUAGE\_PUNJABI
|
|
|
|
\item wxLANGUAGE\_QUECHUA
|
|
|
|
\item wxLANGUAGE\_RHAETO\_ROMANCE
|
|
|
|
\item wxLANGUAGE\_ROMANIAN
|
|
|
|
\item wxLANGUAGE\_RUSSIAN
|
|
|
|
\item wxLANGUAGE\_RUSSIAN\_UKRAINE
|
|
|
|
\item wxLANGUAGE\_SAMOAN
|
|
|
|
\item wxLANGUAGE\_SANGHO
|
|
|
|
\item wxLANGUAGE\_SANSKRIT
|
|
|
|
\item wxLANGUAGE\_SCOTS\_GAELIC
|
|
|
|
\item wxLANGUAGE\_SERBIAN
|
|
|
|
\item wxLANGUAGE\_SERBIAN\_CYRILLIC
|
|
|
|
\item wxLANGUAGE\_SERBIAN\_LATIN
|
|
|
|
\item wxLANGUAGE\_SERBO\_CROATIAN
|
|
|
|
\item wxLANGUAGE\_SESOTHO
|
|
|
|
\item wxLANGUAGE\_SETSWANA
|
|
|
|
\item wxLANGUAGE\_SHONA
|
|
|
|
\item wxLANGUAGE\_SINDHI
|
|
|
|
\item wxLANGUAGE\_SINHALESE
|
|
|
|
\item wxLANGUAGE\_SISWATI
|
|
|
|
\item wxLANGUAGE\_SLOVAK
|
|
|
|
\item wxLANGUAGE\_SLOVENIAN
|
|
|
|
\item wxLANGUAGE\_SOMALI
|
|
|
|
\item wxLANGUAGE\_SPANISH
|
|
|
|
\item wxLANGUAGE\_SPANISH\_ARGENTINA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_BOLIVIA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_CHILE
|
|
|
|
\item wxLANGUAGE\_SPANISH\_COLOMBIA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_COSTA\_RICA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_DOMINICAN\_REPUBLIC
|
|
|
|
\item wxLANGUAGE\_SPANISH\_ECUADOR
|
|
|
|
\item wxLANGUAGE\_SPANISH\_EL\_SALVADOR
|
|
|
|
\item wxLANGUAGE\_SPANISH\_GUATEMALA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_HONDURAS
|
|
|
|
\item wxLANGUAGE\_SPANISH\_MEXICAN
|
|
|
|
\item wxLANGUAGE\_SPANISH\_MODERN
|
|
|
|
\item wxLANGUAGE\_SPANISH\_NICARAGUA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_PANAMA
|
|
|
|
\item wxLANGUAGE\_SPANISH\_PARAGUAY
|
|
|
|
\item wxLANGUAGE\_SPANISH\_PERU
|
|
|
|
\item wxLANGUAGE\_SPANISH\_PUERTO\_RICO
|
|
|
|
\item wxLANGUAGE\_SPANISH\_URUGUAY
|
|
|
|
\item wxLANGUAGE\_SPANISH\_US
|
|
|
|
\item wxLANGUAGE\_SPANISH\_VENEZUELA
|
|
|
|
\item wxLANGUAGE\_SUNDANESE
|
|
|
|
\item wxLANGUAGE\_SWAHILI
|
|
|
|
\item wxLANGUAGE\_SWEDISH
|
|
|
|
\item wxLANGUAGE\_SWEDISH\_FINLAND
|
|
|
|
\item wxLANGUAGE\_TAGALOG
|
|
|
|
\item wxLANGUAGE\_TAJIK
|
|
|
|
\item wxLANGUAGE\_TAMIL
|
|
|
|
\item wxLANGUAGE\_TATAR
|
|
|
|
\item wxLANGUAGE\_TELUGU
|
|
|
|
\item wxLANGUAGE\_THAI
|
|
|
|
\item wxLANGUAGE\_TIBETAN
|
|
|
|
\item wxLANGUAGE\_TIGRINYA
|
|
|
|
\item wxLANGUAGE\_TONGA
|
|
|
|
\item wxLANGUAGE\_TSONGA
|
|
|
|
\item wxLANGUAGE\_TURKISH
|
|
|
|
\item wxLANGUAGE\_TURKMEN
|
|
|
|
\item wxLANGUAGE\_TWI
|
|
|
|
\item wxLANGUAGE\_UIGHUR
|
|
|
|
\item wxLANGUAGE\_UKRAINIAN
|
|
|
|
\item wxLANGUAGE\_URDU
|
|
|
|
\item wxLANGUAGE\_URDU\_INDIA
|
|
|
|
\item wxLANGUAGE\_URDU\_PAKISTAN
|
|
|
|
\item wxLANGUAGE\_UZBEK
|
|
|
|
\item wxLANGUAGE\_UZBEK\_CYRILLIC
|
|
|
|
\item wxLANGUAGE\_UZBEK\_LATIN
|
|
|
|
\item wxLANGUAGE\_VIETNAMESE
|
|
|
|
\item wxLANGUAGE\_VOLAPUK
|
|
|
|
\item wxLANGUAGE\_WELSH
|
|
|
|
\item wxLANGUAGE\_WOLOF
|
|
|
|
\item wxLANGUAGE\_XHOSA
|
|
|
|
\item wxLANGUAGE\_YIDDISH
|
|
|
|
\item wxLANGUAGE\_YORUBA
|
|
|
|
\item wxLANGUAGE\_ZHUANG
|
|
|
|
\item wxLANGUAGE\_ZULU
|
|
|
|
\end{itemize}
|
|
|
|
|
2001-03-25 17:19:44 -05:00
|
|
|
%% --- --- --- generated code ends here --- --- ---
|
|
|
|
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
|
1999-02-15 18:04:52 -05:00
|
|
|
\membersection{wxLocale::wxLocale}\label{wxlocaledefctor}
|
|
|
|
|
|
|
|
\func{}{wxLocale}{\void}
|
|
|
|
|
|
|
|
This is the default constructor and it does nothing to initialize the object:
|
1999-02-16 15:17:02 -05:00
|
|
|
\helpref{Init()}{wxlocaleinit} must be used to do that.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
\func{}{wxLocale}{\param{int }{language}, \param{int }{flags =
|
|
|
|
wxLOCALE\_LOAD\_DEFAULT | wxLOCALE\_CONV\_ENCODING}}
|
|
|
|
|
|
|
|
See \helpref{Init()}{wxlocaleinit} for parameters description.
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{}{wxLocale}{\param{const char }{*szName}, \param{const char }{*szShort = NULL}, \param{const char }{*szLocale = NULL}, \param{bool }{bLoadDefault = true}, \param{bool }{bConvertEncoding = false}}
|
1999-02-15 18:04:52 -05:00
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
See \helpref{Init()}{wxlocaleinit} for parameters description.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
|
|
|
The call of this function has several global side effects which you should
|
|
|
|
understand: first of all, the application locale is changed - note that this
|
|
|
|
will affect many of standard C library functions such as printf() or strftime().
|
|
|
|
Second, this wxLocale object becomes the new current global locale for the
|
|
|
|
application and so all subsequent calls to wxGetTranslation() will try to
|
|
|
|
translate the messages using the message catalogs for this locale.
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
1999-02-15 18:04:52 -05:00
|
|
|
\membersection{wxLocale::\destruct{wxLocale}}\label{wxlocaledtor}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxLocale}}{\void}
|
|
|
|
|
1999-02-16 15:17:02 -05:00
|
|
|
The destructor, like the constructor, also has global side effects: the previously
|
1999-02-15 18:04:52 -05:00
|
|
|
set locale is restored and so the changes described in
|
|
|
|
\helpref{Init}{wxlocaleinit} documentation are rolled back.
|
|
|
|
|
|
|
|
\membersection{wxLocale::AddCatalog}\label{wxlocaleaddcatalog}
|
|
|
|
|
|
|
|
\func{bool}{AddCatalog}{\param{const char }{*szDomain}}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Add a catalog for use with the current locale: it is searched for in standard
|
1999-02-16 15:17:02 -05:00
|
|
|
places (current directory first, then the system one), but you may also prepend
|
1999-02-15 18:04:52 -05:00
|
|
|
additional directories to the search path with
|
1999-02-16 15:17:02 -05:00
|
|
|
\helpref{AddCatalogLookupPathPrefix()}{wxlocaleaddcataloglookuppathprefix}.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
|
|
|
All loaded catalogs will be used for message lookup by GetString() for the
|
|
|
|
current locale.
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if catalog was successfully loaded, false otherwise (which might
|
1999-02-15 18:04:52 -05:00
|
|
|
mean that the catalog is not found or that it isn't in the correct format).
|
|
|
|
|
|
|
|
\membersection{wxLocale::AddCatalogLookupPathPrefix}\label{wxlocaleaddcataloglookuppathprefix}
|
|
|
|
|
|
|
|
\func{void}{AddCatalogLookupPathPrefix}{\param{const wxString\& }{prefix}}
|
|
|
|
|
|
|
|
Add a prefix to the catalog lookup path: the message catalog files will be
|
|
|
|
looked up under prefix/<lang>/LC\_MESSAGES, prefix/LC\_MESSAGES and prefix
|
|
|
|
(in this order).
|
|
|
|
|
|
|
|
This only applies to subsequent invocations of AddCatalog()!
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
\membersection{wxLocale::AddLanguage}\label{wxlocaleaddlanguage}
|
|
|
|
|
2001-03-25 17:19:44 -05:00
|
|
|
\func{static void}{AddLanguage}{\param{const wxLanguageInfo\& }{info}}
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
Adds custom, user-defined language to the database of known languages. This
|
2002-06-07 16:15:28 -04:00
|
|
|
database is used in conjunction with the first form of
|
2001-01-18 19:20:49 -05:00
|
|
|
\helpref{Init}{wxlocaleinit}.
|
|
|
|
|
|
|
|
wxLanguageInfo is defined as follows:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
|
|
|
struct WXDLLEXPORT wxLanguageInfo
|
|
|
|
{
|
|
|
|
int Language; // wxLanguage id
|
|
|
|
wxString CanonicalName; // Canonical name, e.g. fr_FR
|
|
|
|
#ifdef __WIN32__
|
|
|
|
wxUint32 WinLang, WinSublang; // Win32 language identifiers
|
|
|
|
// (LANG_xxxx, SUBLANG_xxxx)
|
|
|
|
#endif
|
|
|
|
wxString Description; // human-readable name of the language
|
|
|
|
};
|
|
|
|
\end{verbatim}
|
|
|
|
|
|
|
|
|
|
|
|
{\it Language} should be greater than wxLANGUAGE\_USER\_DEFINED.
|
|
|
|
|
2001-11-23 17:08:45 -05:00
|
|
|
\perlnote{In wxPerl Wx::LanguageInfo has only one method:\par
|
|
|
|
Wx::LanguageInfo->new( language, canonicalName, WinLang, WinSubLang, Description )}
|
2001-01-18 19:20:49 -05:00
|
|
|
|
2003-02-04 11:43:10 -05:00
|
|
|
\membersection{wxLocale::FindLanguageInfo}{wxlocalefindlanguageinfo}
|
|
|
|
|
|
|
|
\constfunc{static wxLanguageInfo *}{FindLanguageInfo}{\param{const wxString\& }{locale}}
|
|
|
|
|
|
|
|
This function may be used to find the language description structure for the
|
|
|
|
given locale, specified either as a two letter ISO language code (for example,
|
|
|
|
"pt"), a language code followed by the country code ("pt\_BR") or a full, human
|
|
|
|
readable, language description ("Portuguese-Brazil").
|
|
|
|
|
|
|
|
Returns the information for the given language or {\tt NULL} if this language
|
|
|
|
is unknown. Note that even if the returned pointer is valid, the caller should
|
|
|
|
{\it not} delete it.
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{GetLanguageInfo}{wxlocalegetlanguageinfo}
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
\membersection{wxLocale::GetCanonicalName}\label{wxlocalegetcanonicalname}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetSysName}{\void}
|
|
|
|
|
|
|
|
Returns the canonical form of current locale name. Canonical form is the
|
|
|
|
one that is used on UNIX systems: it is a two- or five-letter string in xx or
|
|
|
|
xx\_YY format, where xx is ISO 639 code of language and YY is ISO 3166 code of
|
|
|
|
the country. Examples are "en", "en\_GB", "en\_US" or "fr\_FR".
|
|
|
|
|
|
|
|
This form is internally used when looking up message catalogs.
|
|
|
|
|
|
|
|
Compare \helpref{GetSysName}{wxlocalegetsysname}.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxLocale::GetLanguage}\label{wxlocalegetlanguage}
|
|
|
|
|
|
|
|
\constfunc{int}{GetLanguage}{\void}
|
|
|
|
|
|
|
|
Returns \helpref{wxLanguage}{wxlanguage} constant of current language.
|
|
|
|
Note that you can call this function only if you used the form of
|
|
|
|
\helpref{Init}{wxlocaleinit} that takes wxLanguage argument.
|
|
|
|
|
2002-09-07 18:53:04 -04:00
|
|
|
\membersection{wxLocale::GetLanguageInfo}\label{wxlocalegetlanguageinfo}
|
|
|
|
|
|
|
|
\constfunc{static wxLanguageInfo *}{GetLanguageInfo}{\param{int }{lang}}
|
|
|
|
|
|
|
|
Returns a pointer to wxLanguageInfo structure containing information about the
|
|
|
|
given language or {\tt NULL} if this language is unknown. Note that even if the
|
|
|
|
returned pointer is valid, the caller should {\it not} delete it.
|
|
|
|
|
|
|
|
See \helpref{AddLanguage}{wxlocaleaddlanguage} for the wxLanguageInfo
|
|
|
|
description.
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
\membersection{wxLocale::GetLocale}\label{wxlocalegetlocale}
|
|
|
|
|
|
|
|
\constfunc{const char*}{GetLocale}{\void}
|
|
|
|
|
|
|
|
Returns the locale name as passed to the constructor or
|
2001-01-18 19:20:49 -05:00
|
|
|
\helpref{Init()}{wxlocaleinit}. This is full, human-readable name,
|
|
|
|
e.g. "English" or "French".
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
|
|
|
|
\membersection{wxLocale::GetName}\label{wxlocalegetname}
|
|
|
|
|
|
|
|
\constfunc{const wxString\&}{GetName}{\void}
|
|
|
|
|
|
|
|
Returns the current short name for the locale (as given to the constructor or
|
|
|
|
the Init() function).
|
|
|
|
|
|
|
|
\membersection{wxLocale::GetString}\label{wxlocalegetstring}
|
|
|
|
|
|
|
|
\constfunc{const char*}{GetString}{\param{const char }{*szOrigString}, \param{const char }{*szDomain = NULL}}
|
|
|
|
|
|
|
|
Retrieves the translation for a string in all loaded domains unless the szDomain
|
|
|
|
parameter is specified (and then only this catalog/domain is searched).
|
|
|
|
|
|
|
|
Returns original string if translation is not available
|
|
|
|
(in this case an error message is generated the first time
|
|
|
|
a string is not found; use \helpref{wxLogNull}{wxlogoverview} to suppress it).
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
Domains are searched in the last to first order, i.e. catalogs
|
|
|
|
added later override those added before.
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
\membersection{wxLocale::GetSysName}\label{wxlocalegetsysname}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetSysName}{\void}
|
|
|
|
|
|
|
|
Returns current platform-specific locale name as passed to setlocale().
|
|
|
|
|
|
|
|
Compare \helpref{GetCanonicalName}{wxlocalegetcanonicalname}.
|
|
|
|
|
|
|
|
|
2001-05-31 16:27:37 -04:00
|
|
|
\membersection{wxLocale::GetSystemEncoding}\label{wxlocalegetsystemencoding}
|
|
|
|
|
|
|
|
\constfunc{static wxFontEncoding}{GetSystemEncoding}{\void}
|
|
|
|
|
|
|
|
Tries to detect the user's default font encoding.
|
|
|
|
Returns \helpref{wxFontEncoding}{wxfont} value or
|
|
|
|
{\bf wxFONTENCODING\_SYSTEM} if it couldn't be determined.
|
|
|
|
|
|
|
|
\membersection{wxLocale::GetSystemEncodingName}\label{wxlocalegetsystemencodingname}
|
|
|
|
|
|
|
|
\constfunc{static wxString}{GetSystemEncodingName}{\void}
|
|
|
|
|
|
|
|
Tries to detect the name of the user's default font encoding. This string isn't
|
|
|
|
particularly useful for the application as its form is platform-dependent and
|
|
|
|
so you should probably use
|
|
|
|
\helpref{GetSystemEncoding}{wxlocalegetsystemencoding} instead.
|
|
|
|
|
|
|
|
Returns a user-readable string value or an empty string if it couldn't be
|
|
|
|
determined.
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
\membersection{wxLocale::GetSystemLanguage}\label{wxlocalegetsystemlanguage}
|
|
|
|
|
2001-03-25 17:19:44 -05:00
|
|
|
\constfunc{static int}{GetSystemLanguage}{\void}
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
Tries to detect the user's default language setting.
|
|
|
|
Returns \helpref{wxLanguage}{wxlanguage} value or
|
|
|
|
{\bf wxLANGUAGE\_UNKNOWN} if the language-guessing algorithm failed.
|
|
|
|
|
|
|
|
|
1999-02-15 18:04:52 -05:00
|
|
|
\membersection{wxLocale::Init}\label{wxlocaleinit}
|
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
\func{bool}{Init}{\param{int }{language = wxLANGUAGE\_DEFAULT}, \param{int }{flags =
|
|
|
|
wxLOCALE\_LOAD\_DEFAULT | wxLOCALE\_CONV\_ENCODING}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\func{bool}{Init}{\param{const char }{*szName}, \param{const char }{*szShort = NULL}, \param{const char }{*szLocale = NULL}, \param{bool }{bLoadDefault = true}, \param{bool }{bConvertEncoding = false}}
|
1999-02-15 18:04:52 -05:00
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
The second form is deprecated, use the first one unless you know what you are
|
|
|
|
doing.
|
1999-02-16 15:17:02 -05:00
|
|
|
|
2001-01-18 19:20:49 -05:00
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{language}{\helpref{wxLanguage}{wxlanguage} identifier of the locale.
|
|
|
|
wxLANGUAGE\_DEFAULT has special meaning -- wxLocale will use system's default
|
|
|
|
language (see \helpref{GetSystemLanguage}{wxlocalegetsystemlanguage}).}
|
|
|
|
|
|
|
|
\docparam{flags}{Combination of the following:
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{\windowstyle{wxLOCALE\_LOAD\_DEFAULT}}{Load the message catalog
|
|
|
|
for the given locale containing the translations of standard wxWindows messages
|
|
|
|
automatically.}
|
|
|
|
\twocolitem{\windowstyle{wxLOCALE\_CONV\_ENCODING}}{Automatically convert message
|
2002-03-15 18:29:22 -05:00
|
|
|
catalogs to platform's default encoding. Note that it will do only basic
|
2001-01-18 19:20:49 -05:00
|
|
|
conversion between well-known pair like iso8859-1 and windows-1252 or
|
|
|
|
iso8859-2 and windows-1250. See \helpref{Writing non-English applications}{nonenglishoverview} for detailed
|
2002-03-15 18:29:22 -05:00
|
|
|
description of this behaviour. Note that this flag is meaningless in Unicode build.}
|
2001-01-18 19:20:49 -05:00
|
|
|
\end{twocollist}
|
|
|
|
}
|
|
|
|
|
|
|
|
\docparam{szName}{The name of the locale. Only used in diagnostic messages.}
|
|
|
|
|
|
|
|
\docparam{szShort}{The standard 2 letter locale abbreviation and is used as the
|
|
|
|
directory prefix when looking for the message catalog files.}
|
|
|
|
|
|
|
|
\docparam{szLocale}{The parameter for the call to setlocale(). Note that it is
|
|
|
|
platform-specific.}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{bLoadDefault}{May be set to false to prevent loading of the message catalog
|
1999-02-15 18:04:52 -05:00
|
|
|
for the given locale containing the translations of standard wxWindows messages.
|
2001-01-18 19:20:49 -05:00
|
|
|
This parameter would be rarely used in normal circumstances.}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
\docparam{bConvertEncoding}{May be set to true to do automatic conversion of message
|
2001-01-01 06:32:56 -05:00
|
|
|
catalogs to platform's native encoding. Note that it will do only basic
|
|
|
|
conversion between well-known pair like iso8859-1 and windows-1252 or
|
|
|
|
iso8859-2 and windows-1250.
|
|
|
|
See \helpref{Writing non-English applications}{nonenglishoverview} for detailed
|
2001-01-18 19:20:49 -05:00
|
|
|
description of this behaviour.}
|
|
|
|
|
1999-02-15 18:04:52 -05:00
|
|
|
|
|
|
|
The call of this function has several global side effects which you should
|
|
|
|
understand: first of all, the application locale is changed - note that this
|
|
|
|
will affect many of standard C library functions such as printf() or strftime().
|
|
|
|
Second, this wxLocale object becomes the new current global locale for the
|
|
|
|
application and so all subsequent calls to wxGetTranslation() will try to
|
|
|
|
translate the messages using the message catalogs for this locale.
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true on success or false if the given locale couldn't be set.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
|
|
|
\membersection{wxLocale::IsLoaded}\label{wxlocaleisloaded}
|
|
|
|
|
1999-02-16 15:17:02 -05:00
|
|
|
\constfunc{bool}{IsLoaded}{\param{const char* }{domain}}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Check if the given catalog is loaded, and returns true if it is.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
1999-02-16 15:17:02 -05:00
|
|
|
According to GNU gettext tradition, each catalog
|
|
|
|
normally corresponds to 'domain' which is more or less the application name.
|
1999-02-15 18:04:52 -05:00
|
|
|
|
|
|
|
See also: \helpref{AddCatalog}{wxlocaleaddcatalog}
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
\membersection{wxLocale::IsOk}\label{wxlocaleisok}
|
1999-02-15 18:04:52 -05:00
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
\constfunc{bool}{IsOk}{\void}
|
1999-02-16 15:17:02 -05:00
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the locale could be set successfully.
|
1999-02-16 15:17:02 -05:00
|
|
|
|