diff options
author | David Tardon <dtardon@redhat.com> | 2013-01-02 13:51:20 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-01-02 13:57:15 +0100 |
commit | afa240330b51fb3607cfa6390aeb4e085cd1c525 (patch) | |
tree | 1abba68e3a49d5b3eab79ac69cd7322a71b7d34f /solenv | |
parent | 5ee54bcb9c7713c7233b0bb9f7671c6e61047585 (diff) |
only package .ui translations that can be produced
That means that there is corresponding .po file for given language.
As a slight optimization, do not even try to run uiex if _no_
translation would be produced.
Change-Id: I901e88b20edfb55e4f8bc661bacf8218b603bdcb
(cherry picked from commit 76091d814ca084ba66fcb9db8bc4565c47ee16a5)
Signed-off-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/gbuild/UI.mk | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/solenv/gbuild/UI.mk b/solenv/gbuild/UI.mk index 00572b01a7e8..f6f4e00d4b02 100644 --- a/solenv/gbuild/UI.mk +++ b/solenv/gbuild/UI.mk @@ -147,6 +147,34 @@ $(call gb_UI__package_uifile,$(1),$(1)_ui_localized,res/$(3)/$(notdir $(2)),$(2) endef +# gb_UI__add_translations_impl target uifile langs +define gb_UI__add_translations_impl +$(call gb_UILocalizeTarget_UILocalizeTarget,$(2)) +$(call gb_UI_get_target,$(1)) : $(call gb_UILocalizeTarget_get_target,$(2)) +$(call gb_UI_get_clean_target,$(1)) : $(call gb_UILocalizeTarget_get_clean_target,$(2)) +$(call gb_Package_get_preparation_target,$(1)_ui_localized) : $(call gb_UILocalizeTarget_get_target,$(2)) +$(foreach lang,$(3),$(call gb_UI__add_uifile_for_lang,$(1),$(2),$(lang))) + +endef + +# gb_UI__add_translations target uifile langs +define gb_UI__add_translations +$(if $(strip $(3)),$(call gb_UI__add_translations_impl,$(1),$(2),$(3))) + +endef + +# Adds translations for languages that have corresponding .po file +# +# gb_UI__add_uifile_translations target uifile +define gb_UI__add_uifile_translations +$(call gb_UI__add_translations,$(1),$(2),\ + $(foreach lang,$(gb_UI_LANGS),\ + $(if $(wildcard $(gb_POLOCATION)/$(lang)/$(patsubst %/,%,$(dir $(2))).po),$(lang)) \ + ) \ +) + +endef + # Adds .ui file to the package # # The file is relative to $(SRCDIR) and without extension. @@ -156,11 +184,7 @@ define gb_UI_add_uifile $(call gb_UI__add_uifile,$(1),$(2)) ifneq ($(gb_UI_LANGS),) -$(call gb_UILocalizeTarget_UILocalizeTarget,$(2)) -$(call gb_UI_get_target,$(1)) : $(call gb_UILocalizeTarget_get_target,$(2)) -$(call gb_UI_get_clean_target,$(1)) : $(call gb_UILocalizeTarget_get_clean_target,$(2)) -$(call gb_Package_get_preparation_target,$(1)_ui_localized) : $(call gb_UILocalizeTarget_get_target,$(2)) -$(foreach lang,$(gb_UI_LANGS),$(call gb_UI__add_uifile_for_lang,$(1),$(2),$(lang))) +$(call gb_UI__add_uifile_translations,$(1),$(2)) endif endef |