[Libreoffice-commits] core.git: android/sdremote l10ntools/Executable_stringex.mk l10ntools/inc l10ntools/Module_l10ntools.mk l10ntools/source Repository.mk solenv/gbuild

Andras Timar andras.timar at collabora.com
Sun Nov 17 01:55:45 PST 2013


 Repository.mk                              |    1 
 android/sdremote/Makefile                  |   42 ------
 l10ntools/Executable_stringex.mk           |   36 -----
 l10ntools/Module_l10ntools.mk              |    1 
 l10ntools/inc/stringmerge.hxx              |   41 ------
 l10ntools/source/localize.cxx              |    2 
 l10ntools/source/stringex.cxx              |   42 ------
 l10ntools/source/stringmerge.cxx           |  193 -----------------------------
 solenv/gbuild/extensions/pre_BuildTools.mk |    1 
 9 files changed, 2 insertions(+), 357 deletions(-)

New commits:
commit 4c530d3d18727567d3c5ec3721dc46866b34d2e0
Author: Andras Timar <andras.timar at collabora.com>
Date:   Sun Nov 17 10:58:20 2013 +0100

    good-bye stringex, you served well
    
    It will be better to handle Android Impress Remote localization
    independent of the big LibreOffice source tree. Instead of
    stringex, we will use android2po, a 3rd party utility for conversion
    strings.xml <-> pot/po.
    
    Change-Id: I4eae53e4f8d94c55e5564d54c5e5c214bc9569d7

diff --git a/Repository.mk b/Repository.mk
index ac07ba1..eca28ce 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -54,7 +54,6 @@ $(eval $(call gb_Helper_register_executables,NONE, \
 	sp2bv \
 	svg2odf \
 	svidl \
-	stringex \
 	transex3 \
 	treex \
 	uiex \
diff --git a/android/sdremote/Makefile b/android/sdremote/Makefile
index c480bcc..b46df56 100644
--- a/android/sdremote/Makefile
+++ b/android/sdremote/Makefile
@@ -10,11 +10,7 @@ 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
+all: properties
 	mkdir -p ../abs-lib/libs
 	cp $(ANDROID_SDK_HOME)/extras/android/support/v4/android-support-v4.jar ../abs-lib/libs
 	$(ANT) debug
@@ -23,44 +19,10 @@ properties:
 	echo sdk.dir=$(ANDROID_SDK_HOME) >local.properties
 	echo sdk.dir=$(ANDROID_SDK_HOME) >../abs-lib/local.properties
 
-clean: properties translations.clean
+clean: properties
 	$(ANT) -quiet -keep-going 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 &&\
-	$(STRINGEX_COMMAND) -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 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)))
-
-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)))
-	rm -rf $(foreach lang,$(call android_get_langlist),translations-$(lang).db)
-	rm -f translations.done
-
 # vim: set noet sw=4 ts=4:
diff --git a/l10ntools/Executable_stringex.mk b/l10ntools/Executable_stringex.mk
deleted file mode 100644
index 4f9edfd..0000000
--- a/l10ntools/Executable_stringex.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-
-$(eval $(call gb_Executable_Executable,stringex))
-
-$(eval $(call gb_Executable_set_include,stringex,\
-    -I$(SRCDIR)/l10ntools/inc \
-    $$(INCLUDE) \
-))
-
-$(eval $(call gb_Executable_use_libraries,stringex,\
-    sal \
-))
-
-$(eval $(call gb_Executable_use_static_libraries,stringex,\
-    transex \
-))
-
-$(eval $(call gb_Executable_add_exception_objects,stringex,\
-    l10ntools/source/stringmerge \
-    l10ntools/source/stringex \
-))
-
-$(eval $(call gb_Executable_use_externals,stringex,\
-    boost_headers \
-    libxml2 \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/l10ntools/Module_l10ntools.mk b/l10ntools/Module_l10ntools.mk
index 9797252..d391ed7 100644
--- a/l10ntools/Module_l10ntools.mk
+++ b/l10ntools/Module_l10ntools.mk
@@ -21,7 +21,6 @@ $(eval $(call gb_Module_add_targets_for_build,l10ntools,\
     Executable_pocheck \
     Executable_propex \
     Executable_treex \
-    Executable_stringex \
     StaticLibrary_transex \
 ))
 
diff --git a/l10ntools/inc/stringmerge.hxx b/l10ntools/inc/stringmerge.hxx
deleted file mode 100644
index 626da77..0000000
--- a/l10ntools/inc/stringmerge.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_L10NTOOLS_INC_STRINGMERGE_HXX
-#define INCLUDED_L10NTOOLS_INC_STRINGMERGE_HXX
-
-#include <libxml/tree.h>
-#include <rtl/string.hxx>
-#include <vector>
-
-/** Class for Android strings.xml localization
-
-    Parse strings.xml files, extract translatable strings
-    and merge translated strings.
-*/
-class StringParser
-{
-private:
-    xmlDocPtr m_pSource;
-    OString m_sLang;
-    bool m_bIsInitialized;
-
-public:
-    StringParser(
-        const OString& rInputFile, const OString& rLang );
-    ~StringParser();
-
-    bool isInitialized() const { return m_bIsInitialized; }
-    void Extract( const OString& rPOFile );
-    void Merge(
-        const OString &rMergeSrc, const OString &rDestinationFile );
-};
-
-#endif // INCLUDED_L10NTOOLS_INC_STRINGMERGE_HXX
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 4b7afd7..5bd55b4 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -186,7 +186,6 @@ bool handleFile(
         { RTL_CONSTASCII_STRINGPARAM(".xcu"), "cfgex", false },
         { RTL_CONSTASCII_STRINGPARAM(".xrm"), "xrmex", false },
         { RTL_CONSTASCII_STRINGPARAM("description.xml"), "xrmex", true },
-        { RTL_CONSTASCII_STRINGPARAM("strings.xml"), "stringex", true },
         { RTL_CONSTASCII_STRINGPARAM(".xhp"), "helpex", false },
         { RTL_CONSTASCII_STRINGPARAM(".properties"), "propex", false },
         { RTL_CONSTASCII_STRINGPARAM(".ui"), "uiex", false },
@@ -270,7 +269,6 @@ void handleFilesOfDir(
 bool includeProject(const OString& rProject) {
     static const OString projects[] = {
         "accessibility",
-        "android",
         "avmedia",
         "basctl",
         "basic",
diff --git a/l10ntools/source/stringex.cxx b/l10ntools/source/stringex.cxx
deleted file mode 100644
index 1b507f8..0000000
--- a/l10ntools/source/stringex.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <iostream>
-#include "sal/main.h"
-
-#include "common.hxx"
-#include "stringmerge.hxx"
-
-SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
-{
-    common::HandledArgs aArgs;
-    if( !common::handleArguments(argc, argv, aArgs) )
-    {
-        common::writeUsage("stringex","string.xml");
-        return 1;
-    }
-
-    StringParser aParser(aArgs.m_sInputFile, aArgs.m_sLanguage);
-    if( !aParser.isInitialized() )
-    {
-        return 1;
-    }
-
-    if( aArgs.m_bMergeMode )
-    {
-        aParser.Merge( aArgs.m_sMergeSrc, aArgs.m_sOutputFile );
-    }
-    else
-    {
-        aParser.Extract( aArgs.m_sOutputFile );
-    }
-    return 0;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/stringmerge.cxx b/l10ntools/source/stringmerge.cxx
deleted file mode 100644
index 7cc5d01..0000000
--- a/l10ntools/source/stringmerge.cxx
+++ /dev/null
@@ -1,193 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <iostream>
-#include <fstream>
-#include <cassert>
-#include <cstring>
-
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/xmlstring.h>
-
-#include "export.hxx"
-#include "helper.hxx"
-#include "common.hxx"
-#include "po.hxx"
-#include "stringmerge.hxx"
-
-//Parse strings.xml file
-StringParser::StringParser(
-    const OString& rInputFile, const OString& rLang )
-    : m_pSource( 0 )
-    , m_sLang( rLang )
-    , m_bIsInitialized( false )
-{
-    m_pSource = xmlParseFile( rInputFile.getStr() );
-    if ( !m_pSource ) {
-        std::cerr
-            << "Stringx error: Cannot open source file: "
-            << rInputFile.getStr() << std::endl;
-        return;
-    }
-    if( !m_pSource->name )
-    {
-        m_pSource->name = new char[strlen(rInputFile.getStr())+1];
-        strcpy( m_pSource->name, rInputFile.getStr() );
-    }
-    m_bIsInitialized = true;
-}
-
-StringParser::~StringParser()
-{
-}
-
-//Extract strings form source file
-void StringParser::Extract( const OString& rPOFile )
-{
-    assert( m_bIsInitialized );
-    PoOfstream aPOStream( rPOFile, PoOfstream::APP );
-    if( !aPOStream.isOpen() )
-    {
-        std::cerr
-            << "stringex error: Cannot open po file for extract: "
-            << rPOFile.getStr() << std::endl;
-        return;
-    }
-
-    xmlNodePtr pRootNode = xmlDocGetRootElement( m_pSource ); // <resource>
-    for( xmlNodePtr pCurrent = pRootNode->children->next;
-        pCurrent; pCurrent = pCurrent->next)
-    {
-        if (!xmlStrcmp(pCurrent->name, (const xmlChar*)("string")))
-        {
-            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( pTranslatable );
-        }
-    }
-
-    xmlFreeDoc( m_pSource );
-    xmlCleanupParser();
-    aPOStream.close();
-    m_bIsInitialized = false;
-}
-
-//Merge strings to localized strings.xml file
-void StringParser::Merge(
-    const OString &rMergeSrc, const OString &rDestinationFile )
-{
-    assert( m_bIsInitialized );
-
-    MergeDataFile* pMergeDataFile = 0;
-    if( m_sLang != "qtz" )
-    {
-        pMergeDataFile = new MergeDataFile(
-            rMergeSrc, static_cast<OString>( m_pSource->name ), false, false );
-        const std::vector<OString> vLanguages = pMergeDataFile->GetLanguages();
-        if( vLanguages.size()>=1 && vLanguages[0] != m_sLang )
-        {
-            std::cerr
-                << "stringex error: given language conflicts with "
-                << "language of Mergedata file: "
-                << m_sLang.getStr() << " - "
-                << vLanguages[0].getStr() << std::endl;
-            delete pMergeDataFile;
-            return;
-        }
-    }
-
-    xmlNodePtr pRootNode = xmlDocGetRootElement( m_pSource ); //<resource>
-
-    for( xmlNodePtr pCurrent = pRootNode->children;
-        pCurrent; pCurrent = pCurrent->next)
-    {
-        if (!xmlStrcmp(pCurrent->name, (const xmlChar*)("string")))
-        {
-            xmlChar* pID = xmlGetProp(pCurrent, (const xmlChar*)("name"));
-            ResData  aResData(
-                helper::xmlStrToOString( pID ),
-                static_cast<OString>(m_pSource->name) );
-            xmlFree( pID );
-            aResData.sResTyp = "string";
-            OString sNewText;
-            if( m_sLang == "qtz" )
-            {
-                xmlChar* pText = xmlNodeGetContent(pCurrent);
-                const OString sOriginText =
-                    helper::unEscapeAll(helper::xmlStrToOString( pText ),"\\n""\\t""\\\"""\\\'","\n""\t""\"""\'");
-                xmlFree( pText );
-                sNewText = MergeEntrys::GetQTZText(aResData, sOriginText);
-            }
-            else if( pMergeDataFile )
-            {
-                MergeEntrys* pEntrys = pMergeDataFile->GetMergeEntrys( &aResData );
-                if( pEntrys )
-                {
-                    pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang );
-                    sNewText = helper::escapeAll(sNewText, "\n""\t""\'""\"","\\n""\\t""\\\'""\\\"");
-                }
-            }
-            if( !sNewText.isEmpty() )
-            {
-                xmlNodeSetContent(
-                    pCurrent,
-                    xmlEncodeSpecialChars( NULL,
-                        reinterpret_cast<const xmlChar*>(
-                            sNewText.getStr() )));
-            }
-        }
-    }
-
-    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 );
-    xmlCleanupParser();
-    m_bIsInitialized = false;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/gbuild/extensions/pre_BuildTools.mk b/solenv/gbuild/extensions/pre_BuildTools.mk
index 929a46b..2e216fa 100644
--- a/solenv/gbuild/extensions/pre_BuildTools.mk
+++ b/solenv/gbuild/extensions/pre_BuildTools.mk
@@ -25,7 +25,6 @@ gb_BUILD_TOOLS = \
 		propex \
 		rsc \
 		saxparser \
-		stringex \
 		svidl \
 		transex3 \
 		treex \


More information about the Libreoffice-commits mailing list