* 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
This commit is contained in:
+12
-4
@@ -274,7 +274,7 @@ actions ResAttr1
|
||||
# Extract catalog entries from the sourcefile and put the output textfile in
|
||||
# target. This output file is then used to create the binary catalog with
|
||||
# linkcatkeys.
|
||||
rule ExtractCatalogEntries target : source : signature
|
||||
rule ExtractCatalogEntries target : source : signature : regexp
|
||||
{
|
||||
# get compiler and defines for the platform
|
||||
local headers ;
|
||||
@@ -320,6 +320,11 @@ rule ExtractCatalogEntries target : source : signature
|
||||
CC on $(target) = $(cc) ;
|
||||
|
||||
HAIKU_CATALOG_SIGNATURE on $(target) = $(signature) ;
|
||||
if $(regexp) = "" {
|
||||
HAIKU_CATALOG_REGEXP on $(target) = ;
|
||||
} else {
|
||||
HAIKU_CATALOG_REGEXP on $(target) = -r $(regexp) ;
|
||||
}
|
||||
|
||||
SEARCH on $(source) += $(SEARCH_SOURCE) ;
|
||||
|
||||
@@ -333,7 +338,7 @@ actions ExtractCatalogEntries1
|
||||
{
|
||||
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
||||
cat "$(2[2-])" | $(CC) -E $(CCDEFS) $(HDRS) - > "$(1)".pre
|
||||
$(2[1]) -s $(HAIKU_CATALOG_SIGNATURE) -w -o "$(1)" "$(1)".pre
|
||||
$(2[1]) $(HAIKU_CATALOG_REGEXP) -s $(HAIKU_CATALOG_SIGNATURE) -w -o "$(1)" "$(1)".pre
|
||||
}
|
||||
|
||||
rule LinkApplicationCatalog target : sources : signature : language
|
||||
@@ -359,9 +364,10 @@ actions LinkApplicationCatalog1
|
||||
-s $(HAIKU_CATALOG_SIGNATURE) -o "$(1)"
|
||||
}
|
||||
|
||||
rule DoCatalogs target : signature : sources : sourceLanguage
|
||||
rule DoCatalogs target : signature : sources : sourceLanguage : regexp
|
||||
{
|
||||
# DoCatalogs <target> : <signature> : <sources> [ : <sourceLanguage> ]
|
||||
# [ : <regexp> ]
|
||||
#
|
||||
# Extracts the catkeys from a target's source files, generates the
|
||||
# default catalog from them, and also generates catalogs for all
|
||||
@@ -373,12 +379,14 @@ rule DoCatalogs target : signature : sources : sourceLanguage
|
||||
# sources: List of cpp files where to search keys.
|
||||
# sourceLanguage Short name of the language of used for the strings in
|
||||
# the sources. Optional: default is "en".
|
||||
# regexp The regular expression used to parse the files.
|
||||
# Optional: default is matching be_catalog->GetString
|
||||
|
||||
local generatedCatalog = [ FGristFiles $(sourceLanguage:E=en:S=.catalog) ] ;
|
||||
|
||||
# generate catkeys file from sources
|
||||
ExtractCatalogEntries $(generatedCatalog:S=.catkeys)
|
||||
: [ FGristFiles $(sources) ] : $(signature) ;
|
||||
: [ FGristFiles $(sources) ] : $(signature) : $(regexp) ;
|
||||
|
||||
# find translations
|
||||
local translationsDir
|
||||
|
||||
Reference in New Issue
Block a user