Author: pulkomandy Date: 2010-08-11 10:09:12 +0200 (Wed, 11 Aug 2010) New Revision: 38010 Changeset: http://dev.haiku-os.org/changeset/38010 Modified: haiku/trunk/docs/user/locale/Catalog.dox haiku/trunk/docs/user/locale/Collator.dox haiku/trunk/docs/user/locale/Country.dox haiku/trunk/docs/user/locale/Locale.dox haiku/trunk/docs/user/locale/LocaleRoster.dox Log: * Lots of fixes and proofreading to the locale api reference Modified: haiku/trunk/docs/user/locale/Catalog.dox =================================================================== --- haiku/trunk/docs/user/locale/Catalog.dox 2010-08-10 21:09:56 UTC (rev 38009) +++ haiku/trunk/docs/user/locale/Catalog.dox 2010-08-11 08:09:12 UTC (rev 38010) @@ -67,9 +67,11 @@ 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 @@ 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 @@ 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 @@ /*! \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,10 +139,22 @@ \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. +*/ + +/*! \fn status_t BCatalog::GetSignature(BString* sig) \brief Get the catalog mime-signature. @@ -183,7 +198,7 @@ */ /*! -\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. Modified: haiku/trunk/docs/user/locale/Collator.dox =================================================================== --- haiku/trunk/docs/user/locale/Collator.dox 2010-08-10 21:09:56 UTC (rev 38009) +++ haiku/trunk/docs/user/locale/Collator.dox 2010-08-11 08:09:12 UTC (rev 38010) @@ -52,14 +52,16 @@ \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 @@ \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 @@ */ /*! -\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. +*/ Modified: haiku/trunk/docs/user/locale/Country.dox =================================================================== --- haiku/trunk/docs/user/locale/Country.dox 2010-08-10 21:09:56 UTC (rev 38009) +++ haiku/trunk/docs/user/locale/Country.dox 2010-08-11 08:09:12 UTC (rev 38010) @@ -14,11 +14,9 @@ /*! \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 @@ */ /*! -\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 @@ */ /*! -\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. Modified: haiku/trunk/docs/user/locale/Locale.dox =================================================================== --- haiku/trunk/docs/user/locale/Locale.dox 2010-08-10 21:09:56 UTC (rev 38009) +++ haiku/trunk/docs/user/locale/Locale.dox 2010-08-11 08:09:12 UTC (rev 38010) @@ -47,7 +47,7 @@ */ /*! -\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,14 +71,23 @@ /*! \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. +*/ + +/*! \fn status_t BLocale::FormatDate(BString* string, int*& fieldPositions, int& fieldCount, time_t time, bool longFormat) \brief Format a date and get information about the different fields. @@ -122,7 +131,7 @@ */ /*! -\fn int StartOfWeek() const +\fn int BLocale::StartOfWeek() const \brief Returns the day used as start of week in this locale. */ Modified: haiku/trunk/docs/user/locale/LocaleRoster.dox =================================================================== --- haiku/trunk/docs/user/locale/LocaleRoster.dox 2010-08-10 21:09:56 UTC (rev 38009) +++ haiku/trunk/docs/user/locale/LocaleRoster.dox 2010-08-11 08:09:12 UTC (rev 38010) @@ -39,7 +39,7 @@ */ /*! -\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 @@ */ /*! -\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 @@ \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. +*/