Fix #8841 (broken localization support for 3rd-party apps).
* made private Catalog.h header public by moving it to os/locale/tools/CollectingCatalog.h * reintroduce B_COLLECTING_CATKEYS define (which is expected to be set during a collectcatkeys session) in order to decide whether or not to automatically include the CollecingCatalog.h header from Catalog.h * adjust jam rule for collecting catalog keys accordingly
This commit is contained in:
parent
2bcc7f40c3
commit
e19d7089a7
@ -17,11 +17,7 @@ rule ExtractCatalogEntries target : sources : signature : regexp
|
|||||||
defines = $(DEFINES) ;
|
defines = $(DEFINES) ;
|
||||||
headers = $(HAIKU_CONFIG_HEADERS) $(SEARCH_SOURCE) $(SUBDIRHDRS)
|
headers = $(HAIKU_CONFIG_HEADERS) $(SEARCH_SOURCE) $(SUBDIRHDRS)
|
||||||
$(HDRS) ;
|
$(HDRS) ;
|
||||||
|
sysHeaders = $(SUBDIRSYSHDRS) $(SYSHDRS) ;
|
||||||
# insert specific header folder containing the Catalog.h that should be
|
|
||||||
# used when collecting the catalog keys:
|
|
||||||
sysHeaders = [ FDirName $(HAIKU_TOP) headers private locale collecting ]
|
|
||||||
$(SUBDIRSYSHDRS) $(SYSHDRS) ;
|
|
||||||
|
|
||||||
if $(PLATFORM) = host {
|
if $(PLATFORM) = host {
|
||||||
sysHeaders += $(HOST_HDRS) ;
|
sysHeaders += $(HOST_HDRS) ;
|
||||||
@ -71,7 +67,8 @@ rule ExtractCatalogEntries target : sources : signature : regexp
|
|||||||
actions ExtractCatalogEntries1
|
actions ExtractCatalogEntries1
|
||||||
{
|
{
|
||||||
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
||||||
cat "$(2[2-])" | $(CC) -E $(CCDEFS) $(HDRS) - > "$(1)".pre
|
cat "$(2[2-])" \
|
||||||
|
| $(CC) -E $(CCDEFS) -DB_COLLECTING_CATKEYS $(HDRS) - > "$(1)".pre
|
||||||
$(2[1]) $(HAIKU_CATALOG_REGEXP) -s $(HAIKU_CATALOG_SIGNATURE) \
|
$(2[1]) $(HAIKU_CATALOG_REGEXP) -s $(HAIKU_CATALOG_SIGNATURE) \
|
||||||
-w -o "$(1)" "$(1)".pre
|
-w -o "$(1)" "$(1)".pre
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,13 @@ private:
|
|||||||
// Tip: Use a descriptive name of the class implemented in that
|
// Tip: Use a descriptive name of the class implemented in that
|
||||||
// source-file.
|
// source-file.
|
||||||
|
|
||||||
|
#ifdef B_COLLECTING_CATKEYS
|
||||||
|
|
||||||
|
// pull in all the macros used when collecting catalog keys.
|
||||||
|
#include <tools/CollectingCatalog.h>
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
// Translation macros which may be used to shorten translation requests:
|
// Translation macros which may be used to shorten translation requests:
|
||||||
#undef B_TRANSLATE
|
#undef B_TRANSLATE
|
||||||
#define B_TRANSLATE(string) \
|
#define B_TRANSLATE(string) \
|
||||||
@ -172,7 +179,7 @@ private:
|
|||||||
#undef B_TRANSLATE_MARK_SYSTEM_NAME_VOID
|
#undef B_TRANSLATE_MARK_SYSTEM_NAME_VOID
|
||||||
#define B_TRANSLATE_MARK_SYSTEM_NAME_VOID(string)
|
#define B_TRANSLATE_MARK_SYSTEM_NAME_VOID(string)
|
||||||
|
|
||||||
// Translation macros which do not let collectcatkeys try to collect the key
|
// Translation macros which cause collectcatkeys to ignore this key
|
||||||
// (useful in combination with the marking macros above):
|
// (useful in combination with the marking macros above):
|
||||||
#undef B_TRANSLATE_NOCOLLECT
|
#undef B_TRANSLATE_NOCOLLECT
|
||||||
#define B_TRANSLATE_NOCOLLECT(string) \
|
#define B_TRANSLATE_NOCOLLECT(string) \
|
||||||
@ -194,6 +201,8 @@ private:
|
|||||||
#define B_TRANSLATE_NOCOLLECT_SYSTEM_NAME(string) \
|
#define B_TRANSLATE_NOCOLLECT_SYSTEM_NAME(string) \
|
||||||
B_TRANSLATE_SYSTEM_NAME(string)
|
B_TRANSLATE_SYSTEM_NAME(string)
|
||||||
|
|
||||||
|
#endif /* B_COLLECTING_CATKEYS */
|
||||||
|
|
||||||
#endif /* B_AVOID_TRANSLATION_MACROS */
|
#endif /* B_AVOID_TRANSLATION_MACROS */
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,16 +2,11 @@
|
|||||||
* Copyright 2012, Haiku, Inc.
|
* Copyright 2012, Haiku, Inc.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _COLLECTING_CATALOG_H_
|
#ifndef _TOOLS_COLLECTING_CATALOG_H_
|
||||||
#define _COLLECTING_CATALOG_H_
|
#define _TOOLS_COLLECTING_CATALOG_H_
|
||||||
|
|
||||||
|
|
||||||
#include_next <Catalog.h>
|
|
||||||
|
|
||||||
|
|
||||||
// Translation macros used when executing collectcatkeys
|
// Translation macros used when executing collectcatkeys
|
||||||
#undef B_TRANSLATION_CONTEXT
|
|
||||||
|
|
||||||
#undef B_TRANSLATE
|
#undef B_TRANSLATE
|
||||||
#define B_TRANSLATE(string) \
|
#define B_TRANSLATE(string) \
|
||||||
B_CATKEY((string), B_TRANSLATION_CONTEXT)
|
B_CATKEY((string), B_TRANSLATION_CONTEXT)
|
Loading…
x
Reference in New Issue
Block a user