docs/user: Update locale kit description.
- Delete the introduction from the kits list page, as it is already under locale_intro. - Update the description in locale_intro. - Since the locale kit now lives in libbe, delete the paragraph about libraries from the intro, and move the still relevant part about liblocalestub to the catalog translation macros description in Catalog.dox.
This commit is contained in:
parent
19b3ca491b
commit
defdefa89a
@ -135,31 +135,9 @@
|
||||
\defgroup locale Locale Kit
|
||||
\brief Collection of classes for localizing applications.
|
||||
|
||||
The Locale Kit provides a set of tools for internationalizing,
|
||||
localizing and translating your software. This includes not only
|
||||
replacing string with their translations at runtime, but also more
|
||||
complex tasks such as formatting numbers, dates, and times in a way
|
||||
that match the locale preferences of the user.
|
||||
|
||||
The main way to access locale data is through the be_locale_roster.
|
||||
This is a global instance of the BLocaleRoster class, storing the data
|
||||
for localizing an application according to the user's preferred settings.
|
||||
The locale roster also acts as a factory to instantiate most of the other
|
||||
classes. However, there are some cases where you will need to instantiate
|
||||
another class by yourself, to use it with custom settings. For example, you
|
||||
may need to format a date with a fixed format in english for including in an
|
||||
e-mail header, as it is the only format accepted there.
|
||||
|
||||
Unlike the other kits in Haiku, the Locale kit does not live in libbe.
|
||||
When building a localized application, you have to link it to
|
||||
liblocale.so. If you want to use the catalog macros, you also have to
|
||||
link each of your images (that is, applications, libraries and add-ons)
|
||||
to liblocalestub.a.
|
||||
|
||||
\defgroup media Media Kit
|
||||
\brief Collection of classes that deal with audio and video.
|
||||
|
||||
|
||||
\defgroup midi1 The old MIDI Kit (libmidi.so)
|
||||
\brief The old MIDI kit.
|
||||
|
||||
|
@ -43,6 +43,7 @@
|
||||
associated with your script.
|
||||
|
||||
\section macros Using the macros
|
||||
|
||||
You don't have to do much in your program to handle catalogs. You must
|
||||
first set the B_TRANSLATION_CONTEXT define to a string that identifies which
|
||||
part of the application the strings you will translate are in. This allows
|
||||
@ -54,22 +55,27 @@
|
||||
allow to build the base catalog, the one that you will send to the
|
||||
translator team, from your sourcecode.
|
||||
|
||||
Note that each image (application, library or add-on) using these macros
|
||||
must be linked with liblocalestub.a. This allows the Locale Kit to identify
|
||||
it and locate the matching string catalogs for translation.
|
||||
|
||||
\section chaining Chaining of catalogs
|
||||
|
||||
The catalogs you get from the locale kit are designed to use a fallback
|
||||
system so that the user get strings in the language he's the most fluent
|
||||
with, depending on what catalogs are available.
|
||||
|
||||
For example, if the user sets his language preferences as french(France),
|
||||
For example, if the user sets his language preferences as French(France),
|
||||
spanish, english, when an application loads a catalog, the following rules
|
||||
are used:
|
||||
- Try to load a french(France) catalog. If it is found, this catalog
|
||||
- Try to load a French(France) catalog. If it is found, this catalog
|
||||
will automatically include strings from the generic french catalog.
|
||||
- Try to load a generic french catalog.
|
||||
- Try to load a generic spanish catalog.
|
||||
- Try to load a generic english catalog.
|
||||
- If all of them failed, use the strings that are in the source code.
|
||||
|
||||
Note that french(France) will failback to french, but then directly to the
|
||||
Note that French(France) will failback to French, but then directly to the
|
||||
language in the source code. This avoids mixing 3 or more languages in the
|
||||
same application if the catalogs are incomplete and avoids confusion.
|
||||
|
||||
|
@ -20,9 +20,4 @@ Note that creating a new format is a costly operation. The idea is that you
|
||||
create your format object once and reuse it accross your application to format
|
||||
all the stuff that needs it.
|
||||
|
||||
Unlike the other kits in Haiku, the Locale kit does not live in libbe. When
|
||||
building a localized application, you have to link it to liblocale.so. If you
|
||||
want to use the catalog macros, you also have to link each of your images
|
||||
(that is, applications, libraries and add-ons) to liblocalestub.a.
|
||||
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user