l10ntools/source/lngmerge.cxx | 1 + l10ntools/source/localize.cxx | 24 +++++++++++++++--------- l10ntools/source/po.cxx | 4 ++-- l10ntools/source/renewpo.cxx | 25 +++++++++++++++++-------- 4 files changed, 35 insertions(+), 19 deletions(-)
New commits: commit 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb Author: Zolnai Tamás <zolnaitamas2...@gmail.com> Date: Sat Nov 10 11:58:48 2012 +0100 Add some check to renewpo Change-Id: I7b90785516f172f7b552a9e5ae30d02f7c52d7cf diff --git a/l10ntools/source/renewpo.cxx b/l10ntools/source/renewpo.cxx index 241db58..32d19d5 100644 --- a/l10ntools/source/renewpo.cxx +++ b/l10ntools/source/renewpo.cxx @@ -158,14 +158,23 @@ void HandleLanguage(struct dirent* pLangEntry, const OString& rPath, { sActUnTrans = DelLocalId(sActUnTrans); } - PoEntry aPE(sActUnTrans, vTypes[nIndex]); - const OString sActStr = - sActTrans.getToken(vTypes[nIndex],'\t'); - aPE.setMsgStr(sActStr); - aPE.setFuzzy( sActStr.isEmpty() ? false : - static_cast<bool>(sActTrans.getToken(PoEntry::DUMMY,'\t'). - copy(nDummyBit++,1).toBoolean())); - aNewPo.writeEntry(aPE); + try + { + PoEntry aPE(sActUnTrans, vTypes[nIndex]); + const OString sActStr = + sActTrans.getToken(vTypes[nIndex],'\t'); + aPE.setMsgStr(sActStr); + aPE.setFuzzy( sActStr.isEmpty() ? false : + static_cast<bool>(sActTrans.getToken(PoEntry::DUMMY,'\t'). + copy(nDummyBit++,1).toBoolean())); + aNewPo.writeEntry(aPE); + } + catch( PoEntry::Exception& ) + { + cerr + << "Invalid sdf line " + << sActUnTrans.replaceAll("\t","\\t").getStr() << '\n'; + } } } //Check wheather next entry is in the same po file commit 643ffdf621a056a266c1c6121388e4d0b06adb0d Author: Zolnai Tamás <zolnaitamas2...@gmail.com> Date: Thu Nov 8 17:16:06 2012 +0100 Add an extra empty line to lngmerge It worked with eof before so an extra line is needed. See also this commit: 06175e8b19625cb5a43b1ae5ae63e419cee7e053 Change-Id: Ic3f43a52801429258df620229269b8426f1e2995 diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index efc6c81..42b6384 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -66,6 +66,7 @@ LngParser::LngParser(const rtl::OString &rLngFile, pLines->push_back( new rtl::OString(sLine) ); std::getline(aStream, s); } + pLines->push_back( new rtl::OString() ); } else nError = LNG_COULD_NOT_OPEN; commit ed879cdf2957fcfb013a894dd1ed8bf512f10301 Author: Zolnai Tamás <zolnaitamas2...@gmail.com> Date: Thu Nov 8 12:05:55 2012 +0100 Correct typo in po header Change-Id: Ic98467f5c32a0a84af62f68fbe84c68c3e37f1c1 diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 9dd6d6a..18c0ef1 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -683,8 +683,8 @@ PoHeader::PoHeader( const OString& rExtSrc ) "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" - "X-Genarator: LibreOffice\n" - "X-Accelerator_Marker: ~\n")); + "X-Generator: LibreOffice\n" + "X-Accelerator-Marker: ~\n")); m_bIsInitialized = true; } commit 9e682e30e7cd2d90ad37921934fbf0f5f1897eb3 Author: Zolnai Tamás <zolnaitamas2...@gmail.com> Date: Thu Nov 8 11:13:59 2012 +0100 Localize.cxx add correct header to po Belong to dictionaries modul Change-Id: Ifd8303fd294de2369383cc2ce7ebdd1487c90463 diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index f808af5..c4af640 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -262,17 +262,23 @@ void handleCommand( << outFilePath.getStr() << "\n"; throw false; //TODO } - rtl::OString relativPath; - if (!inPath.copy(inPath.indexOf(project), - inPath.lastIndexOf('/')-inPath.indexOf(project)). - convertToString(&relativPath, osl_getThreadTextEncoding(), - (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR - | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) + + //Add header to actual po file { - std::cerr << "Error: Cannot convert pathname from UTF-16\n"; - throw false; //TODO + const sal_Int32 nProjectInd = inPath.indexOf(project); + const OString relativPath = + project == OUString("dictionaries") ? + OUStringToOString( + inPath.copy( nProjectInd + 13, + inPath.lastIndexOf('/')- nProjectInd - 13), + RTL_TEXTENCODING_UTF8 ) : + OUStringToOString( + inPath.copy( nProjectInd, + inPath.lastIndexOf('/')- nProjectInd), + RTL_TEXTENCODING_UTF8 ); + + rPoOutPut.writeHeader(PoHeader(relativPath)); } - rPoOutPut.writeHeader(PoHeader(relativPath)); } while (!in.eof()) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits