summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000g@gmail.com>2012-11-20 00:24:20 +0100
committerZolnai Tamás <zolnaitamas2000g@gmail.com>2012-11-20 00:31:52 +0100
commit073ff5518f2e341dde7d7ce732cfecb029c85ce6 (patch)
tree1b25306105a1c5d6515fdbafc9b968b521360895
parent23ffae787b9b052748f7f3a6f67c4e2f8f2c9cbb (diff)
Generate qtz properties
Qtz has no own po files so use one of configured langauge's po files (en-US excludex) Plus copy all properties files independently of localization Change-Id: Ica7ccb7d3111f2fc2b3bbde4b839cb564967130a
-rw-r--r--l10ntools/source/propmerge.cxx3
-rw-r--r--solenv/gbuild/ExtensionTarget.mk21
2 files changed, 14 insertions, 10 deletions
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index a858f44d8210..689e931c4b72 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -182,7 +182,8 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
MergeDataFile aMergeDataFile( rMergeSrc, m_sSource, false );
- if( aMergeDataFile.GetLanguages()[0] != m_sLang )
+ const std::vector<OString> aLanguages = aMergeDataFile.GetLanguages();
+ if( m_sLang != "qtz" && !aLanguages.empty() && aLanguages[0] != m_sLang )
{
std::cerr
<< "Propex error: given language conflicts with "
diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk
index 63dbc4d244f7..472b50d2c83f 100644
--- a/solenv/gbuild/ExtensionTarget.mk
+++ b/solenv/gbuild/ExtensionTarget.mk
@@ -234,6 +234,9 @@ endef
# localize .properties file
# source file is copied to $(WORKDIR)
define gb_ExtensionTarget_localize_properties
+ifneq ($(filter-out en-US,$(gb_ExtensionTarget_ALL_LANGS)),)
+$(call gb_ExtensionTarget_localize_properties_onelang,$(1),$(subst en_US,qtz,$(2)),$(3),qtz,$(firstword $(filter-out en-US,$(gb_ExtensionTarget_ALL_LANGS))))
+endif
$(foreach lang,$(gb_ExtensionTarget_ALL_LANGS),\
$(call gb_ExtensionTarget_localize_properties_onelang,$(1),$(subst en_US,$(subst -,_,$(lang)),$(2)),$(3),$(lang)))
endef
@@ -242,9 +245,9 @@ define gb_ExtensionTarget_localize_properties_onelang
$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(2)
ifneq ($(filter-out en-US,$(4)),)
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \
- POFILE := $(gb_POLOCATION)/$(4)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
+ POFILE := $(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \
- $(gb_POLOCATION)/$(4)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
+ $(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
endif
$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2)
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) \
@@ -253,13 +256,13 @@ $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) \
$(gb_ExtensionTarget_PROPMERGETARGET)
$$(call gb_Output_announce,$(2),$(true),PRP,3)
$$(call gb_Helper_abbreviate_dirs, \
- $(if $(filter-out en-US,$(4)), \
- MERGEINPUT=`$(gb_MKTEMP)` && \
- echo $$(POFILE) > $$$${MERGEINPUT} && \
- mkdir -p $$(dir $$@) && \
- $(gb_ExtensionTarget_PROPMERGECOMMAND) -i $$< -o $$@ -m $$$${MERGEINPUT} -l $(4) && \
- rm -rf $$$${MERGEINPUT}, \
- cp $$< $$@))
+ mkdir -p $$(dir $$@) && \
+ cp -f $$< $$@ )
+ $(if $(filter-out en-US,$(4)), \
+ MERGEINPUT=`$(gb_MKTEMP)` && \
+ echo $$(POFILE) > $$$${MERGEINPUT} && \
+ $(gb_ExtensionTarget_PROPMERGECOMMAND) -i $$< -o $$@ -m $$$${MERGEINPUT} -l $(4) && \
+ rm -rf $$$${MERGEINPUT})
endef