History log of /haiku/src/tools/locale/DefaultCatalog.cpp
Revision Date Author Comments
# 969c176d 05-Oct-2020 Murai Takashi <tmurai01@gmail.com>

tools/locale: Fix -Wformat=

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


# 41853a8b 25-Aug-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

locale kit: allow creating a catalog without entry_ref

The catalogs are loaded from separate files, so there is no need to have
an app entry_ref to load them, just a MIME type is enough.

The implementation is a bit simplified: only the default catalog format
is allowed (unlike when loading from entry_ref, where extra catalog
formats can be added in add-ons).

Unrelated cleanup: remove unused code to load catalogs from attributes
of an application. We considered this when designing the locale kit, but
using resources or separate files works better.

Use this in Cortex, where some strings are in a static library, so they
don't have an associated executable or library or add-on to identify
them. The code in Cortex is not complete localization, several parts
should use StringForRate, BStringFormat, etc.

Change-Id: I09be22b1f50891250c4497c51e1db8dcee279140
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3172
Reviewed-by: Kacper Kasper <kacperkasper@gmail.com>


# 4c5e5d8b 25-Nov-2018 Murai Takashi <tmurai01@gmail.com>

tools/locale: Fix using auto_ptr to array.

Use BStackOrHeapArray instead of using auto_ptr to array.

Change-Id: I171cb002829c36ec51ba7d1e387869263e2a40f2
Reviewed-on: https://review.haiku-os.org/745
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 1985b16d 17-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

Also fix the buildtool version of catalogs.


# 541ff51a 15-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup BCatalogAddOn.

* rename BCatalogAddOn to BCatalogData, since it doesn't represent an
add-on, but rather the catalog data provided by an add-on
* move BCatalogData out of Catalog.{h,cpp} into its own header and
implementation file
* drop BCatalogData::MarkForTranslation() methods, they're not needed
* drop BCatalog::GetNoAutoCollectString() methods, they're not being
used anywhere
* cleanup the B_TRANSLATE_... macros somewhat
* add versions of the B_TRANSLATE_MARK_... macros that are meant to be
used in void context (when the string isn't being used by the program,
just meant to be picked up by collectcatkeys).
* adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed
* adjust users of BCatalogAddOn accordingly


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

More cleanup in locale kit, this time regarding namespaces.

* it's bad practice to do a 'using <namespace>' in a header, as that
is very likely to have unintended effects, so drop those from a couple
of private Locale headers
* adjust files all over the locale kit in order to fix the problems
(by explicitly importing the required classes in the implementation
files)


# 1a5c1f9e 01-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Use const references instead of pointers for the read from/write to
attribute/resource method in locale kit catalogs
* Only load the embedded catalog if nothing else was found, so it can easily
be overridden
* Change the resource type to 'CADA' (CAtalog DAta) for embedded catalogs, and
use a hash of the language code as the resource ID. This allows multiple
languages to be stored in the same file and does not interfere with the user
storing his own BMessages as resources.


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


# 924ead9a 31-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Coding style
* Stub out the unneeded code in the buildtool version of DefaultCatalog.


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


# 54fad654 31-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Rework the handling of catalog loading in locale kit :
Instead of computing the mime signature and giving this to the catalog system,
give an entry_ref instead. The default catalog add-on can thus look at the
right place when searching local catalogs (embedded as resources, or stored
as files next to the executable.
* This allows different versions of the same app to each have their own
catalog set,
* And also make the embedded/local catalog searching work for add-ons and
libs, instead it only worked for apps because of a getAppInfo call.

Fix cpufrequency to make use of it properly (that wouldhave worked without the
change, but nowit's mandatory, since loading a catlog by mimesignature is not
possible anymore).

Should fix #8037.



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


# 2a06b5bd 02-Apr-2011 Oliver Tappe <zooey@hirschkaefer.de>

Closing #6721: avoid unescaping when linking catalogs together
* add SetRawString() to both implementations of DefaultCatalog which sets
the translated string as given
* use SetRawString() in both (standard- and build-)versions of linkcatkeys


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


# c090a0fd 26-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* updated ICU build packages with newer builds that try a bit harder to avoid
warnings and incorporate some of the ICU-patches we had in our repo before
we upgraded to 4.4.1
* fixed remaining warnings when building locale kit
* activated EnableWerror for locale kit
* added 'Unicode' license, which is the second license in use by ICU


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


# b891b0ac 23-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* broke out locale-related jam rules into their own file, LocaleRules
* made locale build tools shut up about anything except warnings or errors


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


# 47f5a0f8 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Build fix under Haiku (the two max() arguments had different types).
* Improved error reporting in WriteToFile().
* UpdateAttributes() was called twice in WriteToFile().
* Cleanup.


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


# bf0f20ea 24-Nov-2009 Rene Gollent <anevilyak@gmail.com>

Fix build error on 32-bit host platform (no function max(int, long int)). I unfortunately can't verify if this works or fails on a 64-bit host though.



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


# 75f15221 18-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

* reintegrated gsoc-locale-kit branch into trunk - there's more
work to do, but it's about time to give this code more exposure.



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


# 1985b16d1ea374fbe039d7b40d8f516a76b41fe8 17-Jan-2015 Adrien Destugues <pulkomandy@gmail.com>

Also fix the buildtool version of catalogs.


# 541ff51a6ef4c47f8ab105ba6ff895cdbba83aca 15-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup BCatalogAddOn.

* rename BCatalogAddOn to BCatalogData, since it doesn't represent an
add-on, but rather the catalog data provided by an add-on
* move BCatalogData out of Catalog.{h,cpp} into its own header and
implementation file
* drop BCatalogData::MarkForTranslation() methods, they're not needed
* drop BCatalog::GetNoAutoCollectString() methods, they're not being
used anywhere
* cleanup the B_TRANSLATE_... macros somewhat
* add versions of the B_TRANSLATE_MARK_... macros that are meant to be
used in void context (when the string isn't being used by the program,
just meant to be picked up by collectcatkeys).
* adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed
* adjust users of BCatalogAddOn accordingly


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

More cleanup in locale kit, this time regarding namespaces.

* it's bad practice to do a 'using <namespace>' in a header, as that
is very likely to have unintended effects, so drop those from a couple
of private Locale headers
* adjust files all over the locale kit in order to fix the problems
(by explicitly importing the required classes in the implementation
files)


# 1a5c1f9ed57fae37829befc007cd51c32205c1cd 01-Nov-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Use const references instead of pointers for the read from/write to
attribute/resource method in locale kit catalogs
* Only load the embedded catalog if nothing else was found, so it can easily
be overridden
* Change the resource type to 'CADA' (CAtalog DAta) for embedded catalogs, and
use a hash of the language code as the resource ID. This allows multiple
languages to be stored in the same file and does not interfere with the user
storing his own BMessages as resources.


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


# 924ead9a3e4bc9abb66c73a7d9817654267c58fc 31-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Coding style
* Stub out the unneeded code in the buildtool version of DefaultCatalog.


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


# 54fad654ce9986a2b0ce4849608e738907509292 31-Oct-2011 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

Rework the handling of catalog loading in locale kit :
Instead of computing the mime signature and giving this to the catalog system,
give an entry_ref instead. The default catalog add-on can thus look at the
right place when searching local catalogs (embedded as resources, or stored
as files next to the executable.
* This allows different versions of the same app to each have their own
catalog set,
* And also make the embedded/local catalog searching work for add-ons and
libs, instead it only worked for apps because of a getAppInfo call.

Fix cpufrequency to make use of it properly (that wouldhave worked without the
change, but nowit's mandatory, since loading a catlog by mimesignature is not
possible anymore).

Should fix #8037.



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


# 2a06b5bdba1424eb32e9c06ea738bf35f7e626f7 02-Apr-2011 Oliver Tappe <zooey@hirschkaefer.de>

Closing #6721: avoid unescaping when linking catalogs together
* add SetRawString() to both implementations of DefaultCatalog which sets
the translated string as given
* use SetRawString() in both (standard- and build-)versions of linkcatkeys


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


# c090a0fd840440a924c08cc9bc6c256d16635a7a 26-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* updated ICU build packages with newer builds that try a bit harder to avoid
warnings and incorporate some of the ICU-patches we had in our repo before
we upgraded to 4.4.1
* fixed remaining warnings when building locale kit
* activated EnableWerror for locale kit
* added 'Unicode' license, which is the second license in use by ICU


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


# b891b0acaeb1ff1980ebb6af6b6768ec9b9be8d0 23-Jul-2010 Oliver Tappe <zooey@hirschkaefer.de>

* broke out locale-related jam rules into their own file, LocaleRules
* made locale build tools shut up about anything except warnings or errors


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


# 47f5a0f86b97c36e71c893e2035f98fd24d2b419 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Build fix under Haiku (the two max() arguments had different types).
* Improved error reporting in WriteToFile().
* UpdateAttributes() was called twice in WriteToFile().
* Cleanup.


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


# bf0f20ea81618f48f3b01e520196218948448937 24-Nov-2009 Rene Gollent <anevilyak@gmail.com>

Fix build error on 32-bit host platform (no function max(int, long int)). I unfortunately can't verify if this works or fails on a 64-bit host though.



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


# 75f152215517c2af1a93938f46d3156503329a5e 18-Sep-2009 Oliver Tappe <zooey@hirschkaefer.de>

* reintegrated gsoc-locale-kit branch into trunk - there's more
work to do, but it's about time to give this code more exposure.



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