[Libreoffice-commits] core.git: android/sdremote l10ntools/inc l10ntools/source librelogo/CustomTarget_librelogo.mk solenv/gbuild
Zolnai Tamás
zolnaitamas2000 at gmail.com
Sun Apr 21 09:57:55 PDT 2013
android/sdremote/Makefile | 8 ++-
l10ntools/inc/export.hxx | 1
l10ntools/inc/helpmerge.hxx | 6 +-
l10ntools/inc/po.hxx | 1
l10ntools/source/common.cxx | 2
l10ntools/source/helpex.cxx | 22 ++++++--
l10ntools/source/helpmerge.cxx | 83 +++++++++++++++++----------------
l10ntools/source/merge.cxx | 33 +++++++++----
l10ntools/source/po.cxx | 89 ++++++++++++++++--------------------
l10ntools/source/propmerge.cxx | 46 ++++++++++++------
l10ntools/source/stringmerge.cxx | 56 +++++++++++++---------
l10ntools/source/treemerge.cxx | 51 ++++++++++++--------
librelogo/CustomTarget_librelogo.mk | 27 +++++++---
solenv/gbuild/Dictionary.mk | 26 ++++++----
solenv/gbuild/ExtensionTarget.mk | 88 ++++++++++++++++++++++-------------
solenv/gbuild/HelpTarget.mk | 54 ++++++++++++++-------
16 files changed, 356 insertions(+), 237 deletions(-)
New commits:
commit 36b3bcefcf13996610239f95b1dce9f291bde95d
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Sat Apr 20 09:20:31 2013 +0200
Some changes in qtz handling
Executalbes, which work one language, generat qtz by own.
(stringex,helpex,treex,propex)
So these executables can generate qtz without po file
when use them with qtz, call them with "-m" flag without parameter.
Change-Id: I56c34db7151dc3ef0ce1c85ed607719e4cbb5e92
diff --git a/android/sdremote/Makefile b/android/sdremote/Makefile
index b8ea1e9..26acfd8 100644
--- a/android/sdremote/Makefile
+++ b/android/sdremote/Makefile
@@ -36,8 +36,10 @@ 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)
+ $(if $(filter-out qtz,$(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), \
+ $(OUTDIR_FOR_BUILD)/bin/stringex -i res/values/strings.xml -o res/values-$(1)/strings.xml -m -l $(1))
endef
@@ -46,7 +48,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 qtz nso kok,$(WITH_LANG_LIST)),$(subst -,-r,$(lang)))
+$(foreach lang,$(filter-out en-US sat sid mai ast mni brx dgo nso kok,$(WITH_LANG_LIST)),$(subst -,-r,$(lang)))
endef
$(eval $(call android_translations_rules,$(call android_get_langlist)))
diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index 2230569..a1a2e8c 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -281,6 +281,7 @@ public:
bTitleFirst[ rId ] = true;
}
sal_Bool GetText( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel = sal_False );
+ static OString GetQTZText(const ResData& rResData, const OString& rOrigText);
};
diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 1f9c90a..42b2401 100644
--- a/l10ntools/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
@@ -49,12 +49,12 @@ public:
/// Method merges the String from the POfile into XMLfile. Both Strings must
/// point to existing files.
bool Merge( const OString &rPOFile_in, const OString &rDestinationFile_in ,
- const OString& sLanguage , MergeDataFile& aMergeDataFile );
+ const OString& sLanguage , MergeDataFile* pMergeDataFile );
private:
- bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const OString& sLanguage , OString const & sPath );
+ bool MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , const OString& sLanguage , OString const & sPath );
- void ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
+ void ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile* pMergeDataFile );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx
index 26bbedf..603727d 100755
--- a/l10ntools/inc/po.hxx
+++ b/l10ntools/inc/po.hxx
@@ -63,6 +63,7 @@ public:
OString getKeyId() const;
static bool IsInSameComp(const PoEntry& rPo1,const PoEntry& rPo2);
+ static OString genKeyId(const OString& rGenerator);
};
diff --git a/l10ntools/source/common.cxx b/l10ntools/source/common.cxx
index 304f44c..b143a7c 100644
--- a/l10ntools/source/common.cxx
+++ b/l10ntools/source/common.cxx
@@ -37,6 +37,7 @@ bool handleArguments(
else if ( OString( argv[ i ] ).toAsciiUpperCase() == "-M" )
{
nState = STATE_MERGESRC; // next token specifies the merge database
+ o_aHandledArgs.m_bMergeMode = true;
}
else if ( OString( argv[ i ] ).toAsciiUpperCase() == "-L" )
{
@@ -63,7 +64,6 @@ bool handleArguments(
case STATE_MERGESRC:
{
o_aHandledArgs.m_sMergeSrc = OString( argv[i] );
- o_aHandledArgs.m_bMergeMode = true;
}
break;
case STATE_LANGUAGES:
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index b148655..5c6156f 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -40,7 +40,7 @@ void WriteUsage()
<< " Syntax: Helpex -[m]i FileIn -o FileOut [-m DataBase] [-l Lang]\n"
<< " FileIn + i: Source file (*.xhp)\n"
<< " FileIn + -mi: File including paths of source files"
- << " (only for merge)"
+ << " (only for merge)\n"
<< " FileOut: Destination file (*.*) or files (in case of -mi)\n"
<< " DataBase: Mergedata (*.po)\n"
<< " Lang: Restrict the handled languages; one element of\n"
@@ -79,8 +79,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
std::cerr << "Helpex error: cannot open input file\n";
return 1;
}
- MergeDataFile aMergeDataFile(
- aArgs.m_sMergeSrc, OString(), false, false );
+ MergeDataFile* pMergeDataFile = 0;
+ if( aArgs.m_sLanguage != "qtz")
+ {
+ pMergeDataFile = new MergeDataFile(aArgs.m_sMergeSrc, OString(), false, false );
+ }
std::string sTemp;
aInput >> sTemp;
while( !aInput.eof() )
@@ -91,23 +94,28 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
aArgs.m_sOutputFile +
sXhpFile.copy( sXhpFile.lastIndexOf("/") ));
if( !aParser.Merge( aArgs.m_sMergeSrc, sOutput,
- aArgs.m_sLanguage, aMergeDataFile ))
+ aArgs.m_sLanguage, pMergeDataFile ))
{
hasNoError = false;
}
aInput >> sTemp;
}
aInput.close();
+ delete pMergeDataFile;
}
else
{
HelpParser aParser( aArgs.m_sInputFile );
- MergeDataFile aMergeDataFile(
- aArgs.m_sMergeSrc, aArgs.m_sInputFile, false, false );
+ MergeDataFile* pMergeDataFile = 0;
+ if( aArgs.m_sLanguage != "qtz")
+ {
+ pMergeDataFile = new MergeDataFile(aArgs.m_sMergeSrc, aArgs.m_sInputFile, false, false );
+ }
hasNoError =
aParser.Merge(
aArgs.m_sMergeSrc, aArgs.m_sOutputFile,
- aArgs.m_sLanguage, aMergeDataFile );
+ aArgs.m_sLanguage, pMergeDataFile );
+ delete pMergeDataFile;
}
}
else
diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 71ad315..69bde37 100644
--- a/l10ntools/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -147,7 +147,7 @@ bool HelpParser::CreatePO(
}
bool HelpParser::Merge( const OString &rPOFile, const OString &rDestinationFile,
- const OString& rLanguage , MergeDataFile& aMergeDataFile )
+ const OString& rLanguage , MergeDataFile* pMergeDataFile )
{
(void) rPOFile;
@@ -159,12 +159,12 @@ bool HelpParser::Merge( const OString &rPOFile, const OString &rDestinationFile,
//TODO: explicit BOM handling?
XMLFile* xmlfile = ( aParser.Execute( sXmlFile, new XMLFile( OUString('0') ) ) );
- bool hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , rLanguage , rDestinationFile );
+ bool hasNoError = MergeSingleFile( xmlfile , pMergeDataFile , rLanguage , rDestinationFile );
delete xmlfile;
return hasNoError;
}
-bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const OString& sLanguage ,
+bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile* pMergeDataFile , const OString& sLanguage ,
OString const & sPath )
{
file->Extract();
@@ -187,7 +187,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile
pResData.sGId = pos->first;
pResData.sFilename = sHelpFile;
- ProcessHelp( aLangHM , sLanguage, &pResData , aMergeDataFile );
+ ProcessHelp( aLangHM , sLanguage, &pResData , pMergeDataFile );
}
file->Write(sPath);
@@ -195,7 +195,7 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile
}
/* ProcessHelp Methode: search for en-US entry and replace it with the current language*/
-void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){
+void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResData *pResData , MergeDataFile* pMergeDataFile ){
XMLElement* pXMLElement = NULL;
MergeEntrys *pEntrys = NULL;
@@ -215,46 +215,51 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const OString& sCur , ResDa
sLId = pXMLElement->GetOldref();
pResData->sId = sLId;
- pEntrys = aMergeDataFile.GetMergeEntrys( pResData );
- if( pEntrys != NULL)
+ OString sNewText;
+ OUString sNewdata;
+ OUString sSourceText(
+ pXMLElement->ToOUString().
+ replaceAll(
+ OUString("\n"),
+ OUString()).
+ replaceAll(
+ OUString("\t"),
+ OUString()));
+ // re-add spaces to the beginning of translated string,
+ // important for indentation of Basic code examples
+ sal_Int32 nPreSpaces = 0;
+ sal_Int32 nLen = sSourceText.getLength();
+ while ( (nPreSpaces < nLen) && (*(sSourceText.getStr()+nPreSpaces) == ' ') )
+ nPreSpaces++;
+ if( sCur == "qtz" )
{
- OString sNewText;
- OUString sSourceText(
- pXMLElement->ToOUString().
- replaceAll(
- OUString("\n"),
- OUString()).
- replaceAll(
- OUString("\t"),
- OUString()));
- // re-add spaces to the beginning of translated string,
- // important for indentation of Basic code examples
- sal_Int32 nPreSpaces = 0;
- sal_Int32 nLen = sSourceText.getLength();
- while ( (nPreSpaces < nLen) && (*(sSourceText.getStr()+nPreSpaces) == ' ') )
- nPreSpaces++;
- pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true );
- OUString sNewdata;
- OUString sTemp = OStringToOUString(sNewText, RTL_TEXTENCODING_UTF8);
- if (helper::isWellFormedXML(OUStringToOString(XMLUtil::QuotHTML(sTemp),RTL_TEXTENCODING_UTF8)))
- {
- sNewdata = sSourceText.copy(0,nPreSpaces) + sTemp;
- }
- else
- {
- sNewdata = sSourceText;
- }
- if (!sNewdata.isEmpty())
+ const OString sOriginText = OUStringToOString(sSourceText, RTL_TEXTENCODING_UTF8);
+ sNewText = MergeEntrys::GetQTZText(*pResData, sOriginText);
+ sNewdata = OStringToOUString(sNewText, RTL_TEXTENCODING_UTF8);
+ }
+ else if( pMergeDataFile )
+ {
+ pEntrys = pMergeDataFile->GetMergeEntrys( pResData );
+ if( pEntrys != NULL)
{
- if( pXMLElement != NULL )
+ pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true );
+ OUString sTemp = OStringToOUString(sNewText, RTL_TEXTENCODING_UTF8);
+ if (helper::isWellFormedXML(OUStringToOString(XMLUtil::QuotHTML(sTemp),RTL_TEXTENCODING_UTF8)))
{
- XMLData *data = new XMLData( sNewdata , NULL , true ); // Add new one
- pXMLElement->RemoveAndDeleteAllChildren();
- pXMLElement->AddChild( data );
- aLangHM->erase( sCur );
+ sNewdata = sSourceText.copy(0,nPreSpaces) + sTemp;
}
}
}
+ if (!sNewdata.isEmpty())
+ {
+ if( pXMLElement != NULL )
+ {
+ XMLData *data = new XMLData( sNewdata , NULL , true ); // Add new one
+ pXMLElement->RemoveAndDeleteAllChildren();
+ pXMLElement->AddChild( data );
+ aLangHM->erase( sCur );
+ }
+ }
else if( pResData == NULL )
{
fprintf(stdout,"Can't find GID=%s LID=%s TYP=%s\n",
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 1555adb..401cba5 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -187,6 +187,14 @@ sal_Bool MergeEntrys::GetText( OString &rReturn,
}
+OString MergeEntrys::GetQTZText(const ResData& rResData, const OString& rOrigText)
+{
+ const OString sFilename = rResData.sFilename.copy(rResData.sFilename.lastIndexOf("/")+1);
+ const OString sKey =
+ PoEntry::genKeyId(sFilename + rResData.sGId + rResData.sId + rResData.sResTyp + rOrigText);
+ return sKey + "||" + rOrigText;
+}
+
//
// class MergeData
//
@@ -278,9 +286,6 @@ MergeDataFile::MergeDataFile(
OString sExText;
OString sExQHText;
OString sExTitle;
- OString sQTZText;
- OString sQTZQHText;
- OString sQTZTitle;
do
{
if( bInSameComp )
@@ -293,17 +298,14 @@ MergeDataFile::MergeDataFile(
case PoEntry::TTEXT:
sText = sTemp;
sExText = aActPo.getMsgId();
- sQTZText = aActPo.getKeyId();
break;
case PoEntry::TQUICKHELPTEXT:
sQHText = sTemp;
sExQHText = aActPo.getMsgId();
- sQTZQHText = aActPo.getKeyId();
break;
case PoEntry::TTITLE:
sTitle = sTemp;
sExTitle = aActPo.getMsgId();
- sQTZTitle = aActPo.getKeyId();
break;
}
if( !lcl_ReadPoChecked(aNextPo, aPoInput, sPoFileName) )
@@ -325,8 +327,8 @@ MergeDataFile::MergeDataFile(
InsertEntry(
aActPo.getResourceType(), aActPo.getGroupId(),
aActPo.getLocalId(), "qtz",
- sQTZText + "||" + sExText, sQTZQHText + "||" + sExQHText,
- sQTZTitle + "||" + sExTitle, aActPo.getSourceFile(),
+ sExText, sExQHText,
+ sExTitle, aActPo.getSourceFile(),
bCaseSensitive );
}
}
@@ -374,7 +376,6 @@ MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive
return NULL;
}
-
MergeEntrys *MergeDataFile::GetMergeEntrys( ResData *pResData )
{
// search for requested MergeEntrys
@@ -418,7 +419,19 @@ void MergeDataFile::InsertEntry(
// insert the cur string
MergeEntrys *pMergeEntrys = pData->GetMergeEntries();
- pMergeEntrys->InsertEntry( nLANG , rTEXT, rQHTEXT, rTITLE );
+ if( nLANG =="qtz" )
+ {
+ const OString sTemp = rInFilename + rGID + rLID + rTYP;
+ pMergeEntrys->InsertEntry(
+ nLANG,
+ rTEXT.isEmpty()? rTEXT : PoEntry::genKeyId(sTemp + rTEXT) + "||" + rTEXT,
+ rQHTEXT.isEmpty()? rQHTEXT : PoEntry::genKeyId(sTemp + rQHTEXT) + "||" + rQHTEXT,
+ rTITLE.isEmpty()? rTITLE : PoEntry::genKeyId(sTemp + rTITLE) + "||" + rTITLE );
+ }
+ else
+ {
+ pMergeEntrys->InsertEntry( nLANG , rTEXT, rQHTEXT, rTITLE );
+ }
}
OString MergeDataFile::CreateKey(const OString& rTYP, const OString& rGID,
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 34f3eeb..030950a 100755
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -222,28 +222,6 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream)
//Class PoEntry
-namespace
-{
- //Generate KeyId
- static OString lcl_GenKeyId(const OString& rGenerator)
- {
- boost::crc_32_type aCRC32;
- aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength());
- sal_uInt32 nCRC = aCRC32.checksum();
- ///Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs
- static const OString sSymbols =
- "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
- char sKeyId[6];
- for( short nKeyInd = 0; nKeyInd < 5; ++nKeyInd )
- {
- sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % sSymbols.getLength()];
- nCRC >>= 6;
- }
- sKeyId[5] = '\0';
- return OString(sKeyId);
- }
-}
-
//Default constructor
PoEntry::PoEntry()
: m_pGenPo( 0 )
@@ -290,8 +268,7 @@ PoEntry::PoEntry(
m_pGenPo->setMsgId(rText);
m_pGenPo->setExtractCom(
( !rHelpText.isEmpty() ? rHelpText + "\n" : OString( "" )) +
- lcl_GenKeyId(
- m_pGenPo->getReference() + sMsgCtxt + m_pGenPo->getMsgId() ) );
+ genKeyId( m_pGenPo->getReference() + rGroupId + rLocalId + rResType + rText ) );
m_bIsInitialized = true;
}
@@ -435,6 +412,25 @@ bool PoEntry::IsInSameComp(const PoEntry& rPo1,const PoEntry& rPo2)
rPo1.getResourceType() == rPo2.getResourceType() );
}
+OString PoEntry::genKeyId(const OString& rGenerator)
+{
+ boost::crc_32_type aCRC32;
+ aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength());
+ sal_uInt32 nCRC = aCRC32.checksum();
+ ///Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs
+ static const OString sSymbols =
+ "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
+ char sKeyId[6];
+ for( short nKeyInd = 0; nKeyInd < 5; ++nKeyInd )
+ {
+ sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % sSymbols.getLength()];
+ nCRC >>= 6;
+ }
+ sKeyId[5] = '\0';
+ return OString(sKeyId);
+}
+
+
//Class PoHeader
namespace
@@ -538,6 +534,26 @@ void PoOfstream::writeEntry( const PoEntry& rPoEntry )
//Class PoIfstream
+namespace
+{
+
+static bool lcl_CheckInputEntry(const GenPoEntry& rEntry)
+{
+ const OString sMsgCtxt = rEntry.getMsgCtxt();
+ const sal_Int32 nFirstEndLine = sMsgCtxt.indexOf('\n');
+ const sal_Int32 nLastEndLine = sMsgCtxt.lastIndexOf('\n');
+ const sal_Int32 nLastDot = sMsgCtxt.lastIndexOf('.');
+ const OString sType = sMsgCtxt.copy( nLastDot + 1 );
+ return !rEntry.getReference().isEmpty() &&
+ nFirstEndLine > 0 &&
+ (nLastEndLine == nFirstEndLine || nLastEndLine == sMsgCtxt.indexOf('\n',nFirstEndLine+1)) &&
+ nLastDot - nLastEndLine > 1 &&
+ (sType == "text" || sType == "quickhelptext" || sType == "title")&&
+ !rEntry.getMsgId().isEmpty();
+}
+
+}
+
PoIfstream::PoIfstream()
: m_aInPut()
, m_bEof( false )
@@ -592,31 +608,8 @@ void PoIfstream::readEntry( PoEntry& rPoEntry )
}
else
{
- const OString sMsgCtxt = aGenPo.getMsgCtxt();
- const sal_Int32 nFirstEndLine = sMsgCtxt.indexOf('\n');
- const sal_Int32 nLastEndLine = sMsgCtxt.lastIndexOf('\n');
- const sal_Int32 nLastDot = sMsgCtxt.lastIndexOf('.');
- const OString sType = sMsgCtxt.copy( nLastDot + 1 );
- if( !aGenPo.getReference().isEmpty() &&
- nFirstEndLine > 0 &&
- (nLastEndLine == nFirstEndLine ||
- nLastEndLine == sMsgCtxt.indexOf('\n',nFirstEndLine+1)) &&
- nLastDot - nLastEndLine > 1 &&
- (sType == "text" || sType == "quickhelptext" || sType == "title")&&
- !aGenPo.getMsgId().isEmpty() )
+ if( lcl_CheckInputEntry(aGenPo) )
{
- //Generate keyid if po file not includes it
- const OString sExtractCom = aGenPo.getExtractCom();
- if( sExtractCom.isEmpty() ||
- ( sExtractCom.getLength() != 4 &&
- sExtractCom.indexOf("\n") == -1 ) )
- {
- aGenPo.setExtractCom(
- ( !sExtractCom.isEmpty() ? sExtractCom + "\n" : OString( "" )) +
- lcl_GenKeyId(
- aGenPo.getReference() + sMsgCtxt +
- aGenPo.getMsgId() ) );
- }
if( rPoEntry.m_pGenPo )
{
*(rPoEntry.m_pGenPo) = aGenPo;
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index 386fa43..cdbe9d2 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -166,19 +166,21 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
return;
}
- MergeDataFile aMergeDataFile(
- rMergeSrc, m_sSource, false, m_sLang == "qtz" );
-
- const std::vector<OString> vLanguages = aMergeDataFile.GetLanguages();
- if( m_sLang != "qtz" && vLanguages.size()>=2 &&
- vLanguages[vLanguages[0]!="qtz" ? 0 : 1] != m_sLang )
+ MergeDataFile* pMergeDataFile = 0;
+ if( m_sLang != "qtz" )
{
- std::cerr
- << "Propex error: given language conflicts with "
- << "language of Mergedata file: "
- << m_sLang.getStr() << " - "
- << vLanguages[vLanguages[0]!="qtz" ? 0 : 1].getStr() << std::endl;
- return;
+ pMergeDataFile = new MergeDataFile( rMergeSrc, m_sSource, false, false );
+
+ const std::vector<OString> vLanguages = pMergeDataFile->GetLanguages();
+ if( vLanguages.size()>=1 && vLanguages[0] != m_sLang )
+ {
+ std::cerr
+ << "Propex error: given language conflicts with "
+ << "language of Mergedata file: "
+ << m_sLang.getStr() << " - "
+ << vLanguages[0].getStr() << std::endl;
+ return;
+ }
}
for( unsigned nIndex = 0; nIndex < m_vLines.size(); ++nIndex )
@@ -191,11 +193,22 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
const OString sID( sLine.copy( 0, sLine.indexOf("=") ).trim() );
ResData aResData( sID, m_sSource );
aResData.sResTyp = "property";
- MergeEntrys* pEntrys = aMergeDataFile.GetMergeEntrys( &aResData );
- if( pEntrys )
+ OString sNewText;
+ if( m_sLang == "qtz" )
+ {
+ const OString sOriginText = lcl_ConvertToUTF8(sLine.copy( nEqualSign + 1 ).trim());
+ sNewText = MergeEntrys::GetQTZText(aResData, sOriginText);
+ }
+ else if( pMergeDataFile )
+ {
+ MergeEntrys* pEntrys = pMergeDataFile->GetMergeEntrys( &aResData );
+ if( pEntrys )
+ {
+ pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang );
+ }
+ }
+ if( !sNewText.isEmpty() )
{
- OString sNewText;
- pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang );
aDestination << OString(sID + "=").getStr();
lcl_PrintJavaStyle( sNewText, aDestination );
aDestination << std::endl;
@@ -211,6 +224,7 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
}
}
aDestination.close();
+ delete pMergeDataFile;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/stringmerge.cxx b/l10ntools/source/stringmerge.cxx
index 40fe6c2..6ceb4b7 100644
--- a/l10ntools/source/stringmerge.cxx
+++ b/l10ntools/source/stringmerge.cxx
@@ -94,23 +94,21 @@ void StringParser::Merge(
{
assert( m_bIsInitialized );
- if( (m_sLang == "en-US") || (m_sLang == "qtz") )
+ MergeDataFile* pMergeDataFile = 0;
+ if( m_sLang != "qtz" )
{
- return;
- }
-
- MergeDataFile aMergeDataFile(
- rMergeSrc, static_cast<OString>( m_pSource->name ), false );
- const std::vector<OString> vLanguages = aMergeDataFile.GetLanguages();
- if( vLanguages.size()>=2 &&
- vLanguages[vLanguages[0]=="qtz" ? 1 : 0] != m_sLang )
- {
- std::cerr
- << "stringex error: given language conflicts with "
- << "language of Mergedata file: "
- << m_sLang.getStr() << " - "
- << vLanguages[vLanguages[0]=="qtz" ? 1 : 0].getStr() << std::endl;
- return;
+ 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;
+ return;
+ }
}
xmlNodePtr pRootNode = xmlDocGetRootElement( m_pSource ); //<resource>
@@ -126,13 +124,26 @@ void StringParser::Merge(
static_cast<OString>(m_pSource->name) );
xmlFree( pID );
aResData.sResTyp = "string";
- MergeEntrys* pEntrys =
- (&aMergeDataFile)->GetMergeEntrys( &aResData );
- if( pEntrys )
+ 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() )
{
- OString sNewText;
- pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang );
- sNewText = helper::escapeAll(sNewText, "\n""\t""\'""\"","\\n""\\t""\\\'""\\\"");
xmlNodeSetContent(
pCurrent,
xmlEncodeSpecialChars( NULL,
@@ -142,6 +153,7 @@ void StringParser::Merge(
}
}
+ delete pMergeDataFile;
xmlSaveFile( rDestinationFile.getStr(), m_pSource );
xmlFreeDoc( m_pSource );
xmlCleanupParser();
diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx
index d80203d..2870a2e 100644
--- a/l10ntools/source/treemerge.cxx
+++ b/l10ntools/source/treemerge.cxx
@@ -153,25 +153,39 @@ namespace
{
if( !xmlStrcmp(pCurrent->name, pNodeName) )
{
- if( pMergeDataFile )
+ if( rLang != "en-US" )
{
+ OString sNewText;
xmlChar* pID = xmlGetProp(pCurrent, (const xmlChar*)("id"));
ResData aResData(
helper::xmlStrToOString( pID ),
static_cast<OString>(io_pSource->name) );
xmlFree( pID );
aResData.sResTyp = helper::xmlStrToOString( pNodeName );
- MergeEntrys* pEntrys =
- pMergeDataFile->GetMergeEntrys( &aResData );
- if( pEntrys )
+ if( pMergeDataFile )
+ {
+ MergeEntrys* pEntrys =
+ pMergeDataFile->GetMergeEntrys( &aResData );
+ if( pEntrys )
+ {
+ pEntrys->GetText( sNewText, STRING_TYP_TEXT, rLang );
+ }
+ }
+ else if( rLang == "qtz" )
+ {
+ xmlChar* pText = xmlGetProp(pCurrent, (const xmlChar*)("title"));
+ const OString sOriginText = helper::xmlStrToOString(pText);
+ xmlFree( pText );
+ sNewText = MergeEntrys::GetQTZText(aResData, sOriginText);
+ }
+ if( !sNewText.isEmpty() )
{
- OString sNewText;
- pEntrys->GetText( sNewText, STRING_TYP_TEXT, rLang );
xmlSetProp(
pCurrent, (const xmlChar*)("title"),
(const xmlChar*)(sNewText.getStr()));
}
}
+
lcl_MergeLevel(
io_pSource, pCurrent, (const xmlChar *)("node"),
pMergeDataFile, rLang, rXhpRoot );
@@ -242,32 +256,27 @@ void TreeParser::Merge(
assert( m_bIsInitialized );
const xmlNodePtr pRootNode = xmlDocGetRootElement( m_pSource );
- if( m_sLang == "en-US" )
- {
- lcl_MergeLevel(
- m_pSource, pRootNode, (const xmlChar *)("help_section"),
- 0, m_sLang, rXhpRoot );
- }
- else
+ MergeDataFile* pMergeDataFile = 0;
+ if( m_sLang != "qtz" && m_sLang != "en-US" )
{
- MergeDataFile aMergeDataFile(
+ pMergeDataFile = new MergeDataFile(
rMergeSrc, static_cast<OString>( m_pSource->name ), false, false );
- const std::vector<OString> vLanguages = aMergeDataFile.GetLanguages();
- if( vLanguages.size()>=2 &&
- vLanguages[vLanguages[0]=="qtz" ? 1 : 0] != m_sLang )
+ const std::vector<OString> vLanguages = pMergeDataFile->GetLanguages();
+ if( vLanguages.size()>=1 && vLanguages[0] != m_sLang )
{
std::cerr
<< "Treex error: given language conflicts with "
<< "language of Mergedata file: "
<< m_sLang.getStr() << " - "
- << vLanguages[vLanguages[0]=="qtz" ? 1 : 0].getStr() << std::endl;
+ << vLanguages[0].getStr() << std::endl;
return;
}
- lcl_MergeLevel(
- m_pSource, pRootNode, (const xmlChar *)("help_section"),
- &aMergeDataFile, m_sLang, rXhpRoot );
}
+ lcl_MergeLevel(
+ m_pSource, pRootNode, (const xmlChar *)("help_section"),
+ pMergeDataFile, m_sLang, rXhpRoot );
+ delete pMergeDataFile;
xmlSaveFile( rDestinationFile.getStr(), m_pSource );
xmlFreeDoc( m_pSource );
xmlCleanupParser();
diff --git a/librelogo/CustomTarget_librelogo.mk b/librelogo/CustomTarget_librelogo.mk
index 92c8504..6affb4a 100644
--- a/librelogo/CustomTarget_librelogo.mk
+++ b/librelogo/CustomTarget_librelogo.mk
@@ -28,7 +28,7 @@ $(1) : $(2) \
endef
ifneq ($(strip $(gb_WITH_LANG)),)
-librelogo_LANGS := $(filter-out qtz,$(filter-out en-US,$(gb_WITH_LANG)))
+librelogo_LANGS := $(filter-out en-US,$(gb_WITH_LANG))
$(eval $(foreach lang,$(librelogo_LANGS),$(call librelogo_Properties_Properties,$(subst -,_,$(lang)),$(lang))))
endif
@@ -37,14 +37,23 @@ $(librelogo_DIR)/LibreLogo_%.properties : \
| $(librelogo_DIR)/.dir
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRP,1)
$(call gb_Helper_abbreviate_dirs, \
- MERGEINPUT=`$(gb_MKTEMP)` && \
- echo $(POFILE) > $${MERGEINPUT} && \
- $(call gb_Executable_get_command,propex) \
- -i $(SOURCE) \
- -o $@ \
- -m $${MERGEINPUT} \
- -l $(LANG) && \
- rm -rf $${MERGEINPUT} \
+ $(if $(filter-out qtz,$(LANG)), \
+ MERGEINPUT=`$(gb_MKTEMP)` && \
+ echo $(POFILE) > $${MERGEINPUT} && \
+ $(call gb_Executable_get_command,propex) \
+ -i $(SOURCE) \
+ -o $@ \
+ -m $${MERGEINPUT} \
+ -l $(LANG) && \
+ rm -rf $${MERGEINPUT} \
+ , \
+ $(call gb_Executable_get_command,propex) \
+ -i $(SOURCE) \
+ -o $@ \
+ -m \
+ -l $(LANG) \
+ ) \
)
+
# vim:set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/solenv/gbuild/Dictionary.mk b/solenv/gbuild/Dictionary.mk
index a7d458f..eb7ba21 100644
--- a/solenv/gbuild/Dictionary.mk
+++ b/solenv/gbuild/Dictionary.mk
@@ -59,14 +59,22 @@ gb_PropertiesTranslateTarget_DEPS := $(call gb_Executable_get_runtime_dependenci
define gb_PropertiesTranslateTarget__command
$(call gb_Output_announce,$(2),$(true),PRP,1)
-$(call gb_Helper_abbreviate_dirs,\
- MERGEINPUT=$(call var2file,$(shell $(gb_MKTEMP)),100,$(POFILE)) && \
- $(gb_PropertiesTranslateTarget_COMMAND) \
- -i $(PROPERTIES_FILE) \
- -l $(LANG) \
- -m $${MERGEINPUT} \
- -o $(1) && \
- rm -f $${MERGEINPUT} \
+$(call gb_Helper_abbreviate_dirs, \
+ $(if $(filter-out qtz,$(LANG)), \
+ MERGEINPUT=$(call var2file,$(shell $(gb_MKTEMP)),100,$(POFILE)) && \
+ $(gb_PropertiesTranslateTarget_COMMAND) \
+ -i $(PROPERTIES_FILE) \
+ -l $(LANG) \
+ -m $${MERGEINPUT} \
+ -o $(1) && \
+ rm -f $${MERGEINPUT} \
+ , \
+ $(gb_PropertiesTranslateTarget_COMMAND) \
+ -i $(PROPERTIES_FILE) \
+ -l $(LANG) \
+ -m \
+ -o $(1) \
+ ) \
)
endef
@@ -156,7 +164,7 @@ endef
# gb_DescriptionTranslateTarget__DescriptionTranslateTarget_onelang target pobase lang
define gb_DescriptionTranslateTarget__DescriptionTranslateTarget_onelang
-$(call gb_DescriptionTranslateTarget_get_target,$(1)) : POFILES += $(gb_POLOCATION)/$(3)/$(2).po
+$(call gb_DescriptionTranslateTarget_get_target,$(1)) : POFILES += $(if $(filter-out qtz,$(3)),$(gb_POLOCATION)/$(3)/$(2).po)
$(if $(filter-out qtz,$(3)),\
$(call gb_DescriptionTranslateTarget__DescriptionTranslateTarget_onelang_podeps,$(1),$(gb_POLOCATION)/$(3)/$(2).po))
diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk
index 5750070..547b8ec 100644
--- a/solenv/gbuild/ExtensionTarget.mk
+++ b/solenv/gbuild/ExtensionTarget.mk
@@ -217,24 +217,21 @@ endef
# localize .properties file
# source file is copied to $(WORKDIR)
define gb_ExtensionTarget_localize_properties
-ifneq ($(gb_TRANS_LANGS),)
-ifneq ($(ENABLE_RELEASE_BUILD),TRUE)
-$(call gb_ExtensionTarget_localize_properties_onelang,$(1),$(subst en_US,qtz,$(2)),$(3),qtz,$(firstword $(gb_TRANS_LANGS)))
-endif
-endif
-$(foreach lang,$(filter-out qtz,$(gb_ExtensionTarget_ALL_LANGS)),\
+$(foreach lang,$(gb_ExtensionTarget_ALL_LANGS),\
$(call gb_ExtensionTarget_localize_properties_onelang,$(1),$(subst en_US,$(subst -,_,$(lang)),$(2)),$(3),$(lang)))
endef
define gb_ExtensionTarget_localize_properties_onelang
$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(2)
ifneq ($(filter-out en-US,$(4)),)
+ifneq ($(filter-out qtz,$(4)),)
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \
POFILE := $(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \
$(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
$(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po :
endif
+endif
$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2)
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) \
:| $(call gb_ExtensionTarget__get_preparation_target,$(1))
@@ -243,12 +240,19 @@ $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) \
$$(call gb_Output_announce,$(2),$(true),PRP,3)
$$(call gb_Helper_abbreviate_dirs, \
mkdir -p $$(dir $$@) && \
- cp -f $$< $$@ )
- $(if $(filter-out en-US,$(4)), \
- MERGEINPUT=`$(gb_MKTEMP)` && \
- echo $$(POFILE) > $$$${MERGEINPUT} && \
- $(gb_ExtensionTarget_PROPMERGECOMMAND) -i $$< -o $$@ -m $$$${MERGEINPUT} -l $(4) && \
- rm -rf $$$${MERGEINPUT})
+ $(if $(filter qtz,$(4)), \
+ $(gb_ExtensionTarget_PROPMERGECOMMAND) -i $$< -o $$@ -m -l $(4) \
+ , \
+ $(if $(filter-out en-US,$(4)), \
+ MERGEINPUT=`$(gb_MKTEMP)` && \
+ echo $$(POFILE) > $$$${MERGEINPUT} && \
+ $(gb_ExtensionTarget_PROPMERGECOMMAND) -i $$< -o $$@ -m $$$${MERGEINPUT} -l $(4) && \
+ rm -rf $$$${MERGEINPUT} \
+ , \
+ cp -f $$< $$@ \
+ ) \
+ ) \
+ )
endef
@@ -262,7 +266,7 @@ endef
# (i.e., if $(4) is empty the en-US source file is $(2)/$(3), otherwise it
# is $(2)/$(4))
define gb_ExtensionTarget_add_helpfile
-$(foreach lang,$(filter-out qtz,$(gb_ExtensionTarget_ALL_LANGS)), \
+$(foreach lang,$(gb_ExtensionTarget_ALL_LANGS), \
$(call gb_ExtensionTarget__localize_helpfile_onelang,$(1),$(2),$(3),$(4),$(lang)) \
$(call gb_ExtensionTarget__add_compiled_help_dependency_onelang,$(1),$(lang)))
endef
@@ -276,7 +280,7 @@ endef
# $(4): relative path of source help.tree file
# $(5): relative path of localized xhp files (PlatformID included)
define gb_ExtensionTarget_add_helptreefile
-$(foreach lang,$(filter-out qtz,$(gb_ExtensionTarget_ALL_LANGS)), \
+$(foreach lang,$(gb_ExtensionTarget_ALL_LANGS), \
$(call gb_ExtensionTarget__localize_helptreefile_onelang,$(1),$(2),$(3),$(4),$(lang),$(5)) \
$(call gb_ExtensionTarget__add_compiled_help_dependency_onelang,$(1),$(lang)))
endef
@@ -309,12 +313,14 @@ $(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5).done : \
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)-xhp.done : \
$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(3)
ifneq ($(filter-out en-US,$(5)),)
+ifneq ($(filter-out qtz,$(5)),)
$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(3) : \
POFILE := $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(or $(4),$(3)))))
$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(3) : \
$(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(or $(4),$(3)))))
$(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(or $(4),$(3))))) :
endif
+endif
$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(3) : \
$(if $(filter-out en-US,$(5)),$(gb_ExtensionTarget_HELPEXDEPS)) | \
$(call gb_ExtensionTarget_get_workdir,$(1))/help/.dir
@@ -322,18 +328,26 @@ $(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(3) : \
$(2)/$(or $(4),$(3))
$$(call gb_Output_announce,$(1) $(3) $(5),$(true),XHP,3)
$$(call gb_Helper_abbreviate_dirs, \
- mkdir -p $$(dir $$@) && \
- $(if $(filter-out en-US,$(5)), \
- MERGEINPUT=`$(gb_MKTEMP)` && \
- echo $$(POFILE) > $$$${MERGEINPUT} && \
- $(gb_ExtensionTarget_HELPEXCOMMAND) -i $$< -o $$@ -l $(5) \
- -m $$$${MERGEINPUT} && \
- rm -rf $$$${MERGEINPUT}, \
- cp $$< $$@)) && \
- touch $(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)-xhp.done
+ mkdir -p $$(dir $$@) && \
+ $(if $(filter qtz,$(5)), \
+ $(gb_ExtensionTarget_HELPEXCOMMAND) -i $$< -o $$@ -l $(5) -m \
+ , \
+ $(if $(filter-out en-US,$(5)), \
+ MERGEINPUT=`$(gb_MKTEMP)` && \
+ echo $$(POFILE) > $$$${MERGEINPUT} && \
+ $(gb_ExtensionTarget_HELPEXCOMMAND) -i $$< -o $$@ -l $(5) \
+ -m $$$${MERGEINPUT} && \
+ rm -rf $$$${MERGEINPUT} \
+ , \
+ cp $$< $$@ \
+ ) \
+ ) && \
+ touch $(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)-xhp.done \
+ )
endef
+
# localize one help.tree for one language; the result is stored as
# help/$(4)/$(3) in the extension's workdir;
# $(1): extension identifier
@@ -349,12 +363,14 @@ define gb_ExtensionTarget__localize_helptreefile_onelang
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5).done : \
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)/$(3)
ifneq ($(filter-out en-US,$(5)),)
+ifneq ($(filter-out qtz,$(5)),)
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)/$(3) : \
POFILE := $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(4))))
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)/$(3) : \
$(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(4))))
$(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(4)))) :
endif
+endif
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)/$(3) : \
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)-xhp.done
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)/$(3) : \
@@ -365,15 +381,23 @@ $(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(5)/$(3) : \
$$(call gb_Output_announce,$(1) $(3) $(5),$(true),TRE,3)
$$(call gb_Helper_abbreviate_dirs, \
mkdir -p $$(dir $$@) && \
- $(if $(filter-out en-US,$(5)), \
- MERGEINPUT=`$(gb_MKTEMP)` && \
- echo $$(POFILE) > $$$${MERGEINPUT} && \
- $(gb_ExtensionTarget_TREEXCOMMAND) -i $$< -o $$@ -l $(5) \
- -m $$$${MERGEINPUT} \
- -r $$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(6) && \
- rm -rf $$$${MERGEINPUT}, \
- $(gb_ExtensionTarget_TREEXCOMMAND) -i $$< -o $$@ -l $(5) \
- -r $$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(6) ))
+ $(if $(filter qtz,$(5)), \
+ $(gb_ExtensionTarget_TREEXCOMMAND) -i $$< -o $$@ -l $(5) -m \
+ -r $$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(6) \
+ , \
+ $(if $(filter-out en-US,$(5)), \
+ MERGEINPUT=`$(gb_MKTEMP)` && \
+ echo $$(POFILE) > $$$${MERGEINPUT} && \
+ $(gb_ExtensionTarget_TREEXCOMMAND) -i $$< -o $$@ -l $(5) \
+ -m $$$${MERGEINPUT} \
+ -r $$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(6) && \
+ rm -rf $$$${MERGEINPUT} \
+ , \
+ $(gb_ExtensionTarget_TREEXCOMMAND) -i $$< -o $$@ -l $(5) \
+ -r $$(call gb_ExtensionTarget_get_workdir,$(1))/help/$(5)/$(6) \
+ ) \
+ ) \
+ )
endef
diff --git a/solenv/gbuild/HelpTarget.mk b/solenv/gbuild/HelpTarget.mk
index 5606fc0..9aa622e 100644
--- a/solenv/gbuild/HelpTarget.mk
+++ b/solenv/gbuild/HelpTarget.mk
@@ -39,16 +39,26 @@ gb_HelpTranslatePartTarget_COMMAND := $(call gb_Executable_get_command,helpex)
define gb_HelpTranslatePartTarget__command
$(call gb_Output_announce,$(2),$(true),HPX,1)
HELPFILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(filter %.xhp,$(3))) && \
-POFILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(sort $(POFILES))) && \
-$(call gb_Helper_abbreviate_dirs,\
- $(gb_HelpTranslatePartTarget_COMMAND) \
- -l $(HELP_LANG) \
- -mi $${HELPFILES} \
- -m $${POFILES} \
- -o $(call gb_HelpTranslatePartTarget_get_workdir,$(2)) \
+$(call gb_Helper_abbreviate_dirs, \
+ $(if $(filter-out qtz,$(HELP_LANG)), \
+ POFILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(sort $(POFILES))) && \
+ $(gb_HelpTranslatePartTarget_COMMAND) \
+ -l $(HELP_LANG) \
+ -mi $${HELPFILES} \
+ -m $${POFILES} \
+ -o $(call gb_HelpTranslatePartTarget_get_workdir,$(2)) && \
+ rm -f $${POFILES} \
+ , \
+ $(gb_HelpTranslatePartTarget_COMMAND) \
+ -l $(HELP_LANG) \
+ -mi $${HELPFILES} \
+ -m \
+ -o $(call gb_HelpTranslatePartTarget_get_workdir,$(2)) \
+ ) \
) && \
touch $@ && \
-rm -f $${HELPFILES} $${POFILES}
+rm -f $${HELPFILES}
+
endef
$(dir $(call gb_HelpTranslatePartTarget_get_target,%)).dir :
@@ -177,16 +187,26 @@ gb_HelpTreeTarget_COMMAND := $(call gb_Executable_get_command,treex)
define gb_HelpTreeTarget__command
$(call gb_Output_announce,$(2),$(true),TRE,1)
-POFILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(POFILES)) && \
$(call gb_Helper_abbreviate_dirs,\
- $(gb_HelpTreeTarget_COMMAND) \
- -i $(HELP_TREE) \
- -l $(HELP_LANG) \
- -m $${POFILES} \
- -o $@ \
- -r $(HELP_TEXTDIR) \
-) && \
-rm -f $${POFILES}
+ $(if $(filter-out qtz,$(HELP_LANG)), \
+ POFILES=$(call var2file,$(shell $(gb_MKTEMP)),100,$(POFILES)) && \
+ $(gb_HelpTreeTarget_COMMAND) \
+ -i $(HELP_TREE) \
+ -l $(HELP_LANG) \
+ -m $${POFILES} \
+ -o $@ \
+ -r $(HELP_TEXTDIR) && \
+ rm -f $${POFILES} \
+ , \
+ $(gb_HelpTreeTarget_COMMAND) \
+ -i $(HELP_TREE) \
+ -l $(HELP_LANG) \
+ -m \
+ -o $@ \
+ -r $(HELP_TEXTDIR) \
+ ) \
+)
+
endef
$(dir $(call gb_HelpTreeTarget_get_target,%)).dir :
More information about the Libreoffice-commits
mailing list