* Lots of fixes and proofreading to the locale api reference
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38010 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5509491f57
commit
cae874d384
docs/user/locale
@ -67,9 +67,11 @@ properly. But if you want to provide different versions of your application, it
|
||||
may be useful to separate their catalogs.
|
||||
|
||||
\param signature Mime-signature of the application for which to load a catalog.
|
||||
\param language The language of the catalog to load. If NULL, the user settings will be used.
|
||||
\param fingerprint The fingerprint version-info for the catalog to load. If 0, the fingerprint will
|
||||
not be checked,and any version of the catalog will be loaded.
|
||||
\param language The language of the catalog to load. If NULL, the user settings
|
||||
will be used.
|
||||
\param fingerprint The fingerprint version-info for the catalog to load. If 0,
|
||||
the fingerprint will not be checked,and any version of the catalog will be
|
||||
loaded.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -84,14 +86,15 @@ alone is not helpful enough or there are special things to note. The comment is
|
||||
also used as a way to uniquely identify a string, so if two identical strings
|
||||
share the same context, it is still possible to provide different translations.
|
||||
|
||||
\returns The translated string, or the one passed as a parameter if no translation was found.
|
||||
\returns The translated string, or the one passed as a parameter if no
|
||||
translation was found.
|
||||
\param string The string to translate.
|
||||
\param context The context where the string is located.
|
||||
\param comment Supplementary comment for translators.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const char* GetString(uint32 id)
|
||||
\fn const char* BCatalog::GetString(uint32 id)
|
||||
\brief Get a string by id from the catalog.
|
||||
|
||||
The id based version of this method is slightly faster, as it doesn't have to
|
||||
@ -116,7 +119,8 @@ parsed by the collectcatkeys tool. This allows you, for example, to translate a
|
||||
string constant that you declared at another place, without getting a warning
|
||||
message from collectcatkeys.
|
||||
|
||||
\returns The translated string, or the one passed as a parameter if no translation was found.
|
||||
\returns The translated string, or the one passed as a parameter if no
|
||||
translation was found.
|
||||
\param string The string to translate.
|
||||
\param context The context where the string is located.
|
||||
\param comment Supplementary comment for translators.
|
||||
@ -125,7 +129,6 @@ message from collectcatkeys.
|
||||
|
||||
/*!
|
||||
\fn status_t BCatalog::GetData(const char* name, BMessage* msg)
|
||||
\fn status_t BCatalog::GetData(uint32 id, BMessage* msg)
|
||||
\brief Get custom data from the catalog.
|
||||
|
||||
This function allows you to localize something else than raw text. This may
|
||||
@ -136,7 +139,19 @@ handle it by yourself.
|
||||
|
||||
\returns An error code.
|
||||
\param name The name of the data to retrieve.
|
||||
\param msg The BMessage to fillin with the data.
|
||||
\param msg The BMessage to fill in with the data.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BCatalog::GetData(uint32 id, BMessage* msg)
|
||||
\brief Get custom data from the catalog.
|
||||
|
||||
As for GetString, the id-based version may be subject to hash-collisions, but is
|
||||
faster.
|
||||
|
||||
Note the current catalog format doesn't allow storing custom data in catalogs,
|
||||
so the only way to use this function is providing your own catalog add-on for
|
||||
storing the data.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -183,7 +198,7 @@ This function reloads the data for the given signature and fingerprint.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BCatalog::InitCheck()
|
||||
\fn status_t BCatalog::InitCheck() const
|
||||
\brief Check if the catalog is in an useable state.
|
||||
|
||||
This function returns B_OK if the catalog is initialized properly.
|
||||
|
@ -52,14 +52,16 @@ tell if the collator should take punctuation into account when sorting.
|
||||
\fn void BCollator::SetDefaultStrength(int8 strength)
|
||||
\brief Set the strength of the collator.
|
||||
|
||||
The collator class provide four level of strength. These define the handling of variuous
|
||||
things.
|
||||
The collator class provide four level of strength. These define the handling of
|
||||
various things.
|
||||
\item B_COLLATE_PRIMARY doesn't differenciate e from é,
|
||||
\item B_COLLATE_SECONDARY takes them into account,
|
||||
\item B_COLLATE_TERTIARY is case sensitive,
|
||||
\item B_COLLATEÃ_QUATERNARY is very strict. Most of the time you shouldn't need to go that far.
|
||||
\item B_COLLATE_QUATERNARY is very strict. Most of the time you shouldn't need
|
||||
to go that far.
|
||||
|
||||
Note the strength can also be given on a case-by-case basis when calling other methods.
|
||||
Note the strength can also be given on a case-by-case basis when calling other
|
||||
methods.
|
||||
|
||||
\param strength The strength the catalog should use as default.
|
||||
*/
|
||||
@ -82,17 +84,18 @@ This function enables or disables the handling of punctuations.
|
||||
\fn bool BCollator::IgnorePunctuation() const
|
||||
\brief Return the behaviour ofthe collator regarding punctuation.
|
||||
|
||||
This function returns true if the collator will take punctuation into account when sorting.
|
||||
This function returns true if the collator will take punctuation into account
|
||||
when sorting.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn satus_t BCollator::GetSortKey(constchar* string, BString* key, int8 strength = B_COLLATE_DEFAULT) const
|
||||
\fn satus_t BCollator::GetSortKey(const char* string, BString* key, int8 strength) const
|
||||
\brief Compute the sortkey of a string
|
||||
|
||||
A sortkey is a modified version of the string that you can use for faster comparison with
|
||||
other sortkeys, using strcmp or a similar ASCII comparison. If you need to compare a
|
||||
string with other ones a lot of times, storing the sortkey will allow you to do the
|
||||
comparisons faster.
|
||||
A sortkey is a modified version of the string that you can use for faster
|
||||
comparison with other sortkeys, using strcmp or a similar ASCII comparison. If
|
||||
you need to compare a string with other ones a lot of times, storing the sortkey
|
||||
will allow you to do the comparisons faster.
|
||||
|
||||
\param string String from which to compute the sortkey.
|
||||
\param key The resulting sortkey.
|
||||
@ -102,39 +105,50 @@ comparisons faster.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int BCollator::Compare(const char* s1, const char* s2, int8 strength = B_COLLATE_DEFAULT) const
|
||||
\fn int BCollator::Compare(const char* s1, const char* s2, int8 strength) const
|
||||
\brief Compare two strings.
|
||||
|
||||
This function returns the difference betweens the two strings, in a way similar to strcmp.
|
||||
This function returns the difference betweens the two strings, in a way similar
|
||||
to strcmp.
|
||||
|
||||
\param s1,s2 The strings to compare.
|
||||
\returns The comparison value. 0 if the strings are equal, negative if s1<s2, positive if s1>s2.
|
||||
\returns The comparison value. 0 if the strings are equal, negative if s1<s2,
|
||||
positive if s1>s2.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool Equal(const char* s1, const char* s2, int8 strength = B_COLLATE_DEFAULT) const
|
||||
\fn bool BCollator::Equal(const char* s1, const char* s2, int8 strength) const
|
||||
\brief Checks two strings for equality.
|
||||
|
||||
Compares two strings for equality. Note that different strings may end up being equal,
|
||||
for example if the differences are only in case and punctuation, depending on the strenght
|
||||
used. Quaterary strength will make this function return true only if the strings are
|
||||
byte-for-byte identical.
|
||||
Compares two strings for equality. Note that different strings may end up being
|
||||
equal, for example if the differences are only in case and punctuation,
|
||||
depending on the strenght used. Quaterary strength will make this function
|
||||
return true only if the strings are byte-for-byte identical.
|
||||
|
||||
\returns True if the two strings are identical.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool Greater(cosnt char* s1, const char* s2, int8 strength = B_COLLATE_DEFAULT) const)
|
||||
\fn bool BCollator::Greater(cosnt char* s1, const char* s2, int8 strength) const)
|
||||
\brief Tell if a string is greater than another.
|
||||
|
||||
\returns True if s1 is greater (not equal) than s2.
|
||||
|
||||
\note !Greater(s1, s2) does the same thing as Greater(s2,s1)
|
||||
\note !Greater(s1, s2) does the same thing as Greater(s2, s1)
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool GreaterOrEqual(cosnt char* s1, const char* s2, int8 strength = B_COLLATE_DEFAULT) const)
|
||||
\fn bool BCollator::GreaterOrEqual(cosnt char* s1, const char* s2, int8 strength) const)
|
||||
\brief Tell if a string is greater than another.
|
||||
|
||||
\returns True if s1 is greater or equal to s2.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn static BArchivable* BCollator::Instanciate(BMessage* archive)
|
||||
\brief Unarchive the collator
|
||||
|
||||
Thif function allows you to restore a collator that you previously archived. It
|
||||
is faster to do that than to buid a collator and set it up by hand every time
|
||||
you need it with the same settings.
|
||||
*/
|
||||
|
@ -14,11 +14,9 @@ so they are done in the BLocale classinstead.
|
||||
|
||||
/*!
|
||||
\fn BCountry::BCountry(const char* languageCode, const char* countryCode)
|
||||
\fn BCountry::BCountry(const char* languageAndCountryCode)
|
||||
\fn BCountry::BCountry(const BCountry& other)
|
||||
\brief Constructor.
|
||||
|
||||
A BCountry is constructed from a language and a country code.
|
||||
Construct a BCountry from a language and a country code.
|
||||
|
||||
*/
|
||||
|
||||
@ -48,7 +46,7 @@ The flag is stored in HVIF format and can be rendered atany size and color depth
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn const char* GetLocalizedString(uint32 id) const;
|
||||
\fn const char* BCountry::GetLocalizedString(uint32 id) const;
|
||||
\brief Get one of the default localized strings for this country.
|
||||
|
||||
The strings include monetary symbols and other similar things.
|
||||
@ -63,7 +61,7 @@ The strings include monetary symbols and other similar things.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int GetTimeZones(BList& timezones) const
|
||||
\fn int BCountry::GetTimeZones(BList& timezones) const
|
||||
\brief Returns all the timeaones used in this country.
|
||||
|
||||
The count may vary from 0 for countries where there is no data, to twelve, for Russia.
|
||||
|
@ -47,7 +47,7 @@ This function returns the locale name (such as en_US for united states english).
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn bool Blocale::GetName(BString& name) const
|
||||
\fn bool BLocale::GetName(BString& name) const
|
||||
\brief Get the name of the locale.
|
||||
|
||||
This function fills the name string with the localized name of this locale.
|
||||
@ -71,11 +71,20 @@ For example, if the locale us en_US and the user language is french, this functi
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::FormatDate(char* string, size_t maxSize, time_t time, bool longFormat)
|
||||
\fn status_t BLocale::FormatDate(BString* string, time_t time, bool longFormat)
|
||||
\brief Format a date.
|
||||
|
||||
Fills in the string with a formatted date. The longFormat parameter allows you
|
||||
to select the short or the full format.
|
||||
|
||||
\param string The string buffer to fill with the formated date.
|
||||
\param maxSize The size of the buffer.
|
||||
\param time The time (in seconds since epoch) to format
|
||||
\param longFormat If true, uses the long format (with day name, full month name). If false, use the short format, 08/12/2010 or similar.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocale::FormatDate(BString* string, time_t time, bool longFormat)
|
||||
\brief Formats a date to a BString.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -122,7 +131,7 @@ Thisfunction allows you to define your own date format for specific purposes.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn int StartOfWeek() const
|
||||
\fn int BLocale::StartOfWeek() const
|
||||
\brief Returns the day used as start of week in this locale.
|
||||
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@ methods of the Locale Kit.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BlocaleRoster::GetLanguage(const char* languagecode, BLanguage** _language) const
|
||||
\fn status_t BLocaleRoster::GetLanguage(const char* languagecode, BLanguage** _language) const
|
||||
\brief Instanciate a language from its code.
|
||||
*/
|
||||
|
||||
@ -53,7 +53,7 @@ fields, containing the language(s) code(s).
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocaleRoster::GetAvailableCountries(BMessageÃ* message) const
|
||||
\fn status_t BLocaleRoster::GetAvailableCountries(BMessage* message) const
|
||||
\brief List the available countries
|
||||
|
||||
This function filles the passed BMessage with one or more 'country' string
|
||||
@ -84,3 +84,12 @@ selected from the user preferences.
|
||||
\returns The catalog, if it was loaded successfully.
|
||||
\warning This function needs the image to be lined with liblocalestub.a
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn status_t BLocaleRoster::GetPreferredLanguages(BMessage* message) const
|
||||
\brief Return the list of user preferred languages.
|
||||
|
||||
This function fills in the given message with one or more language string
|
||||
fields. They constitute the ordered list of user-selected languages to use for
|
||||
string translation.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user