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:
Oliver Tappe 2012-08-16 21:10:53 +02:00
parent 2bcc7f40c3
commit e19d7089a7
3 changed files with 15 additions and 14 deletions

View File

@ -17,11 +17,7 @@ rule ExtractCatalogEntries target : sources : signature : regexp
defines = $(DEFINES) ;
headers = $(HAIKU_CONFIG_HEADERS) $(SEARCH_SOURCE) $(SUBDIRHDRS)
$(HDRS) ;
# 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) ;
sysHeaders = $(SUBDIRSYSHDRS) $(SYSHDRS) ;
if $(PLATFORM) = host {
sysHeaders += $(HOST_HDRS) ;
@ -71,7 +67,8 @@ rule ExtractCatalogEntries target : sources : signature : regexp
actions ExtractCatalogEntries1
{
$(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) \
-w -o "$(1)" "$(1)".pre
}

View File

@ -86,6 +86,13 @@ private:
// Tip: Use a descriptive name of the class implemented in that
// 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:
#undef B_TRANSLATE
#define B_TRANSLATE(string) \
@ -172,7 +179,7 @@ private:
#undef B_TRANSLATE_MARK_SYSTEM_NAME_VOID
#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):
#undef B_TRANSLATE_NOCOLLECT
#define B_TRANSLATE_NOCOLLECT(string) \
@ -194,6 +201,8 @@ private:
#define B_TRANSLATE_NOCOLLECT_SYSTEM_NAME(string) \
B_TRANSLATE_SYSTEM_NAME(string)
#endif /* B_COLLECTING_CATKEYS */
#endif /* B_AVOID_TRANSLATION_MACROS */

View File

@ -2,16 +2,11 @@
* Copyright 2012, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _COLLECTING_CATALOG_H_
#define _COLLECTING_CATALOG_H_
#include_next <Catalog.h>
#ifndef _TOOLS_COLLECTING_CATALOG_H_
#define _TOOLS_COLLECTING_CATALOG_H_
// Translation macros used when executing collectcatkeys
#undef B_TRANSLATION_CONTEXT
#undef B_TRANSLATE
#define B_TRANSLATE(string) \
B_CATKEY((string), B_TRANSLATION_CONTEXT)