History log of /haiku/src/kits/shared/StringForSize.cpp
Revision Date Author Comments
# 28b96e10 21-Apr-2024 Máximo Castañeda <antiswen@yahoo.es>

IK, libshared: fix string formatting of size and rate

- Out of bounds index for values that would use a bigger unit than
available.
- Jumping from bytes to MiB, without using KiB despite being better.
- Wrong catalog key for base units.
- BSizeColumn showing incorrect values for sizes less than 1 MiB.
- Extraction of catalog messages for BSizeColumn.

Fixes: #18892
Change-Id: Ib36a30a29b425654ab569537b11c8c56093ddc2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7626
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 1f5daef0 27-Feb-2024 Emir SARI <bitigchi@me.com>

ActivityMonitor: use BNumberFormat for i18n

Change-Id: I3179f84cbaee25624c2f4a7b092a28b5281a5f16
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7480
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>


# 72327892 07-Feb-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

Extract parse_size function from ramdisk command.

Change-Id: If7dd36321e1ed2feb20b4c76ddaf303bc997d8b7
Reviewed-on: https://review.haiku-os.org/c/1018
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>


# 7457ccb4 13-Aug-2018 Augustin Cavalier <waddlesplash@gmail.com>

BMessageFormat: Rename to BStringFormat.

The ICU class is named MessageFormat, but on Haiku, it sounds too much
like something related to BMessage (which it isn't in the slightest)
and not part of the Locale system. It works almost entirely with BStrings,
so naming it BStringFormat makes much more sense.

OK'ed by PulkoMandy and Humdinger.


# 23873c70 30-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Missing braces in BMessageFormat format string.

Fixes #11678.


# 03ad73fc 24-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

More uses of BMessageFormat

ZipOMatic, DiskUsage, MediaConverter, MediaPlayer, ShowImage,
WebPositive, Screen preferences, Tracker, string_for_size.

Thanks to KapiX for reporting those!


# 546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# eaa5e093 14-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix #8452 (app's crashing for non-existent system catalog)

* make the system catalog a BCatalog instead of a BCatalogAddOn*,
such that using a non-existing system catalog won't crash but
simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
and adjust it to use BCatalog::SetTo() in order to replace the
data used by the given catalog
* adjust all users of gSystemCatalog accordingly


# 60f75e90 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.


# f700bfd5 26-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* FixStringForSize : without context, the locale kit was in trouble finding the right string.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37753 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 68018dbe 25-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fix lost translation strings of StringForSize

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8f2d34d9 12-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix test_app_server again due to Coding Sprint changes


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36195 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9024a3b 11-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Build tools : allow to run DoCatalogs with a custom regexp for special cases
* Introduce a system-wide localization catalog used for strings hidden deep in some libraries. Add special API to get it.
* string_for_size is the first to make use of this system wide catalog. This allows to have a fully localized DriveSetup.
* As a side effect, tracker also uses it. It now requires liblocale.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36175 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 48d79657 23-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Moved the duplicate "string_for_size()" implementations into libshared.a.
* Adapted libtracker.so, DriveSetup and Installer to use the shared version.
* The new version uses the correct units (KiB instead of KB and so on).
* Use the correct units in a few other prominent places, where
string_for_size() could not be used.

Should resolve a major part of #5378.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35935 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23873c705c69dd11202f643901585a2b64c364d9 30-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

Missing braces in BMessageFormat format string.

Fixes #11678.


# 03ad73fc872d7a350989e7bb7dd10b9e2b1e5882 24-Nov-2014 Adrien Destugues <pulkomandy@gmail.com>

More uses of BMessageFormat

ZipOMatic, DiskUsage, MediaConverter, MediaPlayer, ShowImage,
WebPositive, Screen preferences, Tracker, string_for_size.

Thanks to KapiX for reporting those!


# 546208a53940a26c6379c48a7854ade1a8250fc5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# eaa5e0936d94e7d0bb2e6066a87d485e7613414c 14-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Fix #8452 (app's crashing for non-existent system catalog)

* make the system catalog a BCatalog instead of a BCatalogAddOn*,
such that using a non-existing system catalog won't crash but
simply return the untranslated string instead
* rename MutableLocaleRoster::GetSystemCatalog() to LoadSystemCatalog()
and adjust it to use BCatalog::SetTo() in order to replace the
data used by the given catalog
* adjust all users of gSystemCatalog accordingly


# 60f75e901ce3063c63441ac644dd0e55a17d5d09 04-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Merge liblocale.so into libbe.so.

* Make the locale kit a part of libbe.
* Drop the LocaleBackend kludge used from within libbe (and from
other places, too) in order to access system catalog strings.
This is now done via gSystemCatalog, which is provided and initialized
by libbe.
* Drop all references to liblocale.so from all Jamfiles.
* Add legacy symlink liblocale.so in order to keep optional packages
that rely on it in a working state.

TODO: the documentation hasn't been updated.


# f700bfd569ed5db31ed7919fdeeacd112cf1f136 26-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* FixStringForSize : without context, the locale kit was in trouble finding the right string.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37753 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 68018dbe1a5bc151b857a883863b9eedb6b04a38 25-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* fix lost translation strings of StringForSize

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37745 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8f2d34d9e0152aded064d15207397d3b6190d8d2 12-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Fix test_app_server again due to Coding Sprint changes


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36195 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e9024a3be5be47004b588fdb80cd3021bd18680e 11-Apr-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Build tools : allow to run DoCatalogs with a custom regexp for special cases
* Introduce a system-wide localization catalog used for strings hidden deep in some libraries. Add special API to get it.
* string_for_size is the first to make use of this system wide catalog. This allows to have a fully localized DriveSetup.
* As a side effect, tracker also uses it. It now requires liblocale.so.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36175 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 48d796576e9b4b9610f78f4b96131eb28a362f23 23-Mar-2010 Stephan Aßmus <superstippi@gmx.de>

* Moved the duplicate "string_for_size()" implementations into libshared.a.
* Adapted libtracker.so, DriveSetup and Installer to use the shared version.
* The new version uses the correct units (KiB instead of KB and so on).
* Use the correct units in a few other prominent places, where
string_for_size() could not be used.

Should resolve a major part of #5378.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35935 a95241bf-73f2-0310-859d-f6bbb57e9c96