[Libreoffice-commits] .: android/sdremote

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 28 07:54:27 PST 2012


 android/sdremote/Makefile |   36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

New commits:
commit d9e14c63e3bdd5e289c846ca9448e3864ccbe566
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Wed Nov 28 16:42:34 2012 +0100

    sdremote: add rules to localize the apk
    
    Change-Id: Ib2034d7ce27ce9d9d9f0d325ea403fb48aeb796d

diff --git a/android/sdremote/Makefile b/android/sdremote/Makefile
index 8b06c98..1049e8d 100644
--- a/android/sdremote/Makefile
+++ b/android/sdremote/Makefile
@@ -8,7 +8,7 @@
 
 include ../../config_host.mk
 
-all: properties
+all: properties translations.done
 	mkdir -p ../abs-lib/libs
 	cp $(ANDROID_SDK_HOME)/extras/android/support/v4/android-support-v4.jar ../abs-lib/libs
 	$(ANT) debug
@@ -17,10 +17,42 @@ properties:
 	echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
 	echo sdk.dir=$(ANDROID_SDK_HOME) >../abs-lib/local.properties
 
-clean: properties
+clean: properties translations.clean
 	$(ANT) clean
 
 install: all
 	$(ANDROID_SDK_HOME)/platform-tools/adb install -r ./bin/ImpressRemote-debug.apk
 
+define android_get_podir
+res/values-$(1)
+endef
+
+define android_get_po
+$(call android_get_podir,$(1))/strings.xml
+endef
+
+define android_translation_rules
+$(call android_get_po,$(1)):
+	mkdir -p res/values-$(1)
+	echo $(SRCDIR)/translations/source/$(1)/android/sdremote/res/values.po > translations-$(1).db
+	$(OUTDIR_FOR_BUILD)/bin/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m translations-$(1).db -l $(1)
+
+endef
+
+define android_translations_rules
+$(foreach lang,$(1),$(call android_translation_rules,$(lang)))
+endef
+
+define android_get_langlist
+$(foreach lang,$(filter-out en-US,$(WITH_LANG_LIST)),$(subst -,-r,$(lang)))
+endef
+
+$(eval $(call android_translations_rules,$(call android_get_langlist)))
+
+translations.done: $(foreach lang,$(call android_get_langlist),$(call android_get_po,$(lang)))
+	touch translations.done
+
+translations.clean:
+	rm -rf $(foreach lang,$(call android_get_langlist),$(call android_get_podir,$(lang)))
+
 # vim: set noet sw=4 ts=4:


More information about the Libreoffice-commits mailing list