[Libreoffice-commits] core.git: 3 commits - android/sdremote l10ntools/source
Andras Timar
andras.timar at collabora.com
Fri Nov 15 04:25:15 PST 2013
android/sdremote/Makefile | 12 +++++----
l10ntools/source/stringmerge.cxx | 49 +++++++++++++++++++++++++++++++--------
2 files changed, 46 insertions(+), 15 deletions(-)
New commits:
commit 96e23cb9305da8b00db2587104932ee9d5d3122c
Author: Andras Timar <andras.timar at collabora.com>
Date: Fri Nov 15 13:20:07 2013 +0100
fix Makefile of Android Impress Remote
it is not part of gbuild system
qtz does not build
Change-Id: I46fb43d21255df76775a2d7e30950bf519c58526
diff --git a/android/sdremote/Makefile b/android/sdremote/Makefile
index 740c6f6..c480bcc 100644
--- a/android/sdremote/Makefile
+++ b/android/sdremote/Makefile
@@ -10,6 +10,10 @@ ifeq ($(BUILDDIR),)
include ../../config_host.mk
endif
+STRINGEX_EXECUTABLE := $(WORKDIR_FOR_BUILD)/LinkTarget/Executable/stringex
+STRINGEX_LDPATH := LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(INSTROOT_FOR_BUILD)/$(LIBO_URE_LIB_FOLDER_FOR_BUILD):$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER_FOR_BUILD)
+STRINGEX_COMMAND := $(STRINGEX_LDPATH) $(STRINGEX_EXECUTABLE)
+
all: properties translations.done
mkdir -p ../abs-lib/libs
cp $(ANDROID_SDK_HOME)/extras/android/support/v4/android-support-v4.jar ../abs-lib/libs
@@ -36,10 +40,8 @@ endef
define android_translation_rules
$(call android_get_po,$(1)):
mkdir -p res/values-$(1)
- $(if $(filter-out qtz,$(1)), \
- echo $(SRCDIR)/translations/source/$(1)/android/sdremote/res/values.po > translations-$(1).db &&\
- $(gb_Executable_BINDIR_FOR_BUILD)/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m translations-$(1).db -l $(1), \
- $(gb_Executable_BINDIR_FOR_BUILD)/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m -l $(1))
+ echo $(SRCDIR)/translations/source/$(1)/android/sdremote/res/values.po > translations-$(1).db &&\
+ $(STRINGEX_COMMAND) -i res/values/strings.xml -o res/values-$(1)/strings.xml -m translations-$(1).db -l $(1)
endef
@@ -48,7 +50,7 @@ $(foreach lang,$(1),$(call android_translation_rules,$(lang)))
endef
define android_get_langlist
-$(foreach lang,$(filter-out en-US sat sid mai ast mni brx dgo nso kok,$(WITH_LANG_LIST)),$(subst -,-r,$(lang)))
+$(foreach lang,$(filter-out en-US sat sid mai ast mni brx dgo nso kok qtz,$(WITH_LANG_LIST)),$(subst -,-r,$(lang)))
endef
$(eval $(call android_translations_rules,$(call android_get_langlist)))
commit 1cd032658648b597d7f89b3098a40606f674ce41
Author: Andras Timar <andras.timar at collabora.com>
Date: Fri Nov 15 13:10:41 2013 +0100
do not merge translatable="false" strings to Android resource
Change-Id: Ie5653d0b03fb5090deaad6c70a9e3e638f6e24e0
diff --git a/l10ntools/source/stringmerge.cxx b/l10ntools/source/stringmerge.cxx
index d6ffbc6..7cc5d01 100644
--- a/l10ntools/source/stringmerge.cxx
+++ b/l10ntools/source/stringmerge.cxx
@@ -159,6 +159,30 @@ void StringParser::Merge(
}
}
+ for( xmlNodePtr pCurrent = pRootNode->children; pCurrent; )
+ {
+ if (!xmlStrcmp(pCurrent->name, (const xmlChar*)("string")))
+ {
+ xmlChar* pTranslatable = xmlGetProp(pCurrent, (const xmlChar*)("translatable"));
+ if (!xmlStrcmp(pTranslatable, (const xmlChar*)("false")))
+ {
+ xmlNodePtr pNonTranslatable = pCurrent;
+ pCurrent = pCurrent->next;
+ xmlUnlinkNode( pNonTranslatable );
+ xmlFreeNode( pNonTranslatable );
+ }
+ else
+ {
+ pCurrent = pCurrent->next;
+ }
+ xmlFree( pTranslatable );
+ }
+ else
+ {
+ pCurrent = pCurrent->next;
+ }
+ }
+
delete pMergeDataFile;
xmlSaveFile( rDestinationFile.getStr(), m_pSource );
xmlFreeDoc( m_pSource );
commit ba433c69e658e2edf2832878acae544bcf54133d
Author: Andras Timar <andras.timar at collabora.com>
Date: Fri Nov 15 11:14:12 2013 +0100
do not extract translatable="false" strings from Android resource
Change-Id: Id00ce654b99426c771b647e0ae6be02bfdc24359
diff --git a/l10ntools/source/stringmerge.cxx b/l10ntools/source/stringmerge.cxx
index 9e3fa7a..d6ffbc6 100644
--- a/l10ntools/source/stringmerge.cxx
+++ b/l10ntools/source/stringmerge.cxx
@@ -68,17 +68,22 @@ void StringParser::Extract( const OString& rPOFile )
{
if (!xmlStrcmp(pCurrent->name, (const xmlChar*)("string")))
{
- xmlChar* pID = xmlGetProp(pCurrent, (const xmlChar*)("name"));
- xmlChar* pText = xmlNodeGetContent(pCurrent);
- const OString sTemp =
- helper::unEscapeAll(helper::xmlStrToOString( pText ),"\\n""\\t""\\\"""\\\'","\n""\t""\"""\'");
- common::writePoEntry(
- "Stringex", aPOStream, m_pSource->name, "string",
- helper::xmlStrToOString( pID ), OString(), OString(),
- sTemp);
+ xmlChar* pTranslatable = xmlGetProp(pCurrent, (const xmlChar*)("translatable"));
+ if (xmlStrcmp(pTranslatable, (const xmlChar*)("false")))
+ {
+ xmlChar* pID = xmlGetProp(pCurrent, (const xmlChar*)("name"));
+ xmlChar* pText = xmlNodeGetContent(pCurrent);
+ const OString sTemp =
+ helper::unEscapeAll(helper::xmlStrToOString( pText ),"\\n""\\t""\\\"""\\\'","\n""\t""\"""\'");
+ common::writePoEntry(
+ "Stringex", aPOStream, m_pSource->name, "string",
+ helper::xmlStrToOString( pID ), OString(), OString(),
+ sTemp);
- xmlFree( pID );
- xmlFree( pText );
+ xmlFree( pID );
+ xmlFree( pText );
+ }
+ xmlFree( pTranslatable );
}
}
More information about the Libreoffice-commits
mailing list