History log of /haiku/src/kits/locale/LocaleRosterData.cpp
Revision Date Author Comments
# e03da2bd 30-Jan-2021 Adrien Destugues <adrien.destugues@opensource.viveris.fr>

Locale Kit: Fix available language enumeration

Regression introduced in hrev54910.
The list of available languages in FirstBootPrompt would be empty.


# 4cf4daf2 22-Jan-2021 Adrien Destugues <pulkomandy@pulkomandy.tk>

Locale Kit: move catalog add-ons loading to early initialization

The catalog loading has been done lazily since forever (this code was
imported from OpenTracker). It results in a race condition as explained
in #16670.

Moving the catalog loading earlier in the locale loading process avoids
this problem, since load_add_on is called before the locale roster lock
is used.

This should fix #16670.

Change-Id: If07054077f7dde41cb342a43af2abe8422239b05
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3661
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 1bad1ff3 02-Aug-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Prepare for ICU update

- libicule and libiculx do not exist anymore in newer ICU versions
(harfbuzz replaces them), but we didn't actually use them, so remove
them from the build feature and from the package dependencies
- Add namespace usage marcos since the newer ICU packages put ICU things
in a namespace, making it easier to have multiple versions of ICU used
side by side.

No functional change intended, but this makes it possible to build the
code with either ICU 57 (for gcc2) or 66 (for other architectures).


# f51ea162 25-May-2020 Augustin Cavalier <waddlesplash@gmail.com>

Locale: Enable folder/application translation by default.

Should fix #16076.

Change-Id: Ibf109453c11a83e840774c079c7878cc10f2dad4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2811
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 73de5837 10-May-2015 Jérôme Duval <jerome.duval@gmail.com>

Update icu x86_64 package with namespace renaming enabled.

"Renaming" means the icu namespace is suffixed with the version number,
atm icu_55. Using "renaming" allows to use two different versions of ICU,
thus easing upgrades. For instance haikuwebkit uses a current version of ICU,
while the system uses a newer one after an upgrade.

* Replace all uses of the icu namespace in our public headers, with a macro
defaulting to icu. As the namespace is only used for private fields pointers,
there should be no impact.
* Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before*
including any locale headers. Ditto for a Time preferences cpp file. This way,
the correct current icu namespace is referenced.
* Fixes bug #12057.


# 658f64c3 17-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

LocaleRosterData: use BPathFinder to locate catalog add-ons

* Makes the code slightly simpler and more future proof.


# 44f11d09 01-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Make BDateFormat inherit from BFormat again

* Move relevant parts up into BFormat so other format classes can use
those
* Adjust BDurationFormat and BTimeUnitFormat for the changes
* Remove the "default" date format, it is better to keep only a default
locale and let applications create B*Formats from it as needed.
* Creating a B*Format without arguments to the constructor now
configures it for the default locale, which allows for easy use in
standard cases (formatting something with the current language and
format)
* Creating a B*Format is potentially an expansive operation, it is
advised to keep the instance around and reuse it whenever possible.
However it must be "refreshed" when the locale changes, for apps which
supports that, since it keeps a copy of the language and formatting
convention, rather than a pointer to the locale as it did before.


# 526d4839 30-Sep-2014 Adrien Destugues <pulkomandy@gmail.com>

Make BDateFormat mutable

* Add setters for the language and formatting conventions
* Add shortcut getter and setter for the date format
* Use those in the locale roster to make the BDateFormat actually use
the system preferred language and format.
* Applications can also use this to extract specific information from
the system format (eg. set date format to "LLLL" to extract month
names), or define specific formats more easily (eg. for parsing and
generating e-mail headers or HTTP cookies).


# 2a5e33a9 26-Sep-2014 Adrien Destugues <pulkomandy@gmail.com>

Move date formatting from BLocale to BDateFormat

* There is a little code duplication. This will be moved to BFormat once
the time and datetime formatting is also moved out of BLocale
* The way to create a BDateFormat from a BLocale is still open for
discussion. I'm undecided between making BDateFormat a member of
BLocale, or adding a BDateFormat(const BLocale&) constructor.
* Adjust all users of the API.


# 735ec4d9 14-Aug-2014 Oliver Tappe <zooey@hirschkaefer.de>

Fix LocaleRosterData::CompareInfos.

* The given void pointers are pointers to the actual list items, which
are pointers themselves, so there was an indirection missing
* Fix inverted sort order

This could have caused spurious crashes related to initialization of
the locale kit, most notably this was responsible for triggering a
crashing bug in the plaintext add-on that caused the x86 image
not being able to boot.
I will continue with trying to find the actual crash, too.


# 38fa81bf 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove B_COMMON*_DIRECTORY and kCommon*Directory constants

* This does intentionally break source compatibility, so that a review
of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
of the constants for the writable directories are now used for the
writable system directories. The values for the non-writable
directories are mapped to "/boot/system/data/empty/...", an empty or
non-existent directory, so that they will simply be skipped in search
paths. Only code that explicitly expects to find something in a
B_COMMON_* directory, will fail.


# 52cdfde0 25-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix relying on order of static object destruction in Locale Kit.

* use only a single static object (MutableLocaleRoster) instead of
two, which avoids any problems if the order of static object
destruction would destroy RosterData before MutableLocaleRoster
* rename BPrivate::RosterData to BPrivate::LocaleRosterData and move
it into a header and implementation file of its own
This should hopefully fix problems encountered with a clang-compiled
Locale Kit.


# 73de58376ac8f983ae64a643e01ec5bf047208d2 10-May-2015 Jérôme Duval <jerome.duval@gmail.com>

Update icu x86_64 package with namespace renaming enabled.

"Renaming" means the icu namespace is suffixed with the version number,
atm icu_55. Using "renaming" allows to use two different versions of ICU,
thus easing upgrades. For instance haikuwebkit uses a current version of ICU,
while the system uses a newer one after an upgrade.

* Replace all uses of the icu namespace in our public headers, with a macro
defaulting to icu. As the namespace is only used for private fields pointers,
there should be no impact.
* Locale kit *.cpp have to import the macro from <unicode/uversion.h> *before*
including any locale headers. Ditto for a Time preferences cpp file. This way,
the correct current icu namespace is referenced.
* Fixes bug #12057.


# 658f64c3f17d34e2cec57c47ad3f58c34ed40694 17-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

LocaleRosterData: use BPathFinder to locate catalog add-ons

* Makes the code slightly simpler and more future proof.


# 44f11d0982feb6ed1cc66c4d6d0a26bffd8ce4d4 01-Oct-2014 Adrien Destugues <pulkomandy@gmail.com>

Make BDateFormat inherit from BFormat again

* Move relevant parts up into BFormat so other format classes can use
those
* Adjust BDurationFormat and BTimeUnitFormat for the changes
* Remove the "default" date format, it is better to keep only a default
locale and let applications create B*Formats from it as needed.
* Creating a B*Format without arguments to the constructor now
configures it for the default locale, which allows for easy use in
standard cases (formatting something with the current language and
format)
* Creating a B*Format is potentially an expansive operation, it is
advised to keep the instance around and reuse it whenever possible.
However it must be "refreshed" when the locale changes, for apps which
supports that, since it keeps a copy of the language and formatting
convention, rather than a pointer to the locale as it did before.


# 526d4839991d4dcbb0dc361e7a9f6721481a3ebe 30-Sep-2014 Adrien Destugues <pulkomandy@gmail.com>

Make BDateFormat mutable

* Add setters for the language and formatting conventions
* Add shortcut getter and setter for the date format
* Use those in the locale roster to make the BDateFormat actually use
the system preferred language and format.
* Applications can also use this to extract specific information from
the system format (eg. set date format to "LLLL" to extract month
names), or define specific formats more easily (eg. for parsing and
generating e-mail headers or HTTP cookies).


# 2a5e33a98056c2b92d46a6c9aae6da808c8524b1 26-Sep-2014 Adrien Destugues <pulkomandy@gmail.com>

Move date formatting from BLocale to BDateFormat

* There is a little code duplication. This will be moved to BFormat once
the time and datetime formatting is also moved out of BLocale
* The way to create a BDateFormat from a BLocale is still open for
discussion. I'm undecided between making BDateFormat a member of
BLocale, or adding a BDateFormat(const BLocale&) constructor.
* Adjust all users of the API.


# 735ec4d9867f09db306cd0a111cf822e4e4138ab 14-Aug-2014 Oliver Tappe <zooey@hirschkaefer.de>

Fix LocaleRosterData::CompareInfos.

* The given void pointers are pointers to the actual list items, which
are pointers themselves, so there was an indirection missing
* Fix inverted sort order

This could have caused spurious crashes related to initialization of
the locale kit, most notably this was responsible for triggering a
crashing bug in the plaintext add-on that caused the x86 image
not being able to boot.
I will continue with trying to find the actual crash, too.


# 38fa81bf8f0ccc37a615a9f5bd333f9b781322b3 03-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Remove B_COMMON*_DIRECTORY and kCommon*Directory constants

* This does intentionally break source compatibility, so that a review
of concerned code is forced.
* Binary compatibility should be maintained in most cases. The values
of the constants for the writable directories are now used for the
writable system directories. The values for the non-writable
directories are mapped to "/boot/system/data/empty/...", an empty or
non-existent directory, so that they will simply be skipped in search
paths. Only code that explicitly expects to find something in a
B_COMMON_* directory, will fail.


# 52cdfde04b346aa33eaebd4063321b80683973aa 25-Nov-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix relying on order of static object destruction in Locale Kit.

* use only a single static object (MutableLocaleRoster) instead of
two, which avoids any problems if the order of static object
destruction would destroy RosterData before MutableLocaleRoster
* rename BPrivate::RosterData to BPrivate::LocaleRosterData and move
it into a header and implementation file of its own
This should hopefully fix problems encountered with a clang-compiled
Locale Kit.