diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-11-08 11:13:59 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-11-08 11:13:59 +0100 |
commit | 9e682e30e7cd2d90ad37921934fbf0f5f1897eb3 (patch) | |
tree | 99e3607c256c4e7994e50a1e5327be195c9022ab /l10ntools | |
parent | 428d9e15f98630df9a652be2b2f5064ac1bc7a89 (diff) |
Localize.cxx add correct header to po
Belong to dictionaries modul
Change-Id: Ifd8303fd294de2369383cc2ce7ebdd1487c90463
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/localize.cxx | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index f808af59d6cd..c4af640834af 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()) { |