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:55:12 +0100 |
commit | 76091d814ca084ba66fcb9db8bc4565c47ee16a5 (patch) | |
tree | ef0f7ef4bcb4c6f7f46a28a99e9b12b0df33f785 /solenv | |
parent | 8620f8b51dcc2c9f50364d42e756fd8b11bdc1e3 (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
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 1662481391a8..5e284640e69f 100644 --- a/solenv/gbuild/UI.mk +++ b/solenv/gbuild/UI.mk @@ -148,6 +148,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. @@ -157,11 +185,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 |