summaryrefslogtreecommitdiff
path: root/l10ntools/source/po.cxx
AgeCommit message (Collapse)AuthorFilesLines
2013-05-02Some code scrubingZolnai Tamás1-47/+22
Add doxygen documentation for classes and methods Delete useless comments. Add include guards where missing. Delete some useless typedef. Change-Id: I9bba16560790239d7775fcd40981465e70e5d437
2013-04-21Some changes in qtz handlingZolnai Tamás1-48/+41
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
2013-04-13Make l10ntools executables escape clearZolnai Tamás1-87/+13
Steps of escaping process: 1. Executables unescape the string for export(if necessary) 2. Po class work with unescaped string 3. Escape strings to PO format and write out 4. Read from PO and unescape strings 5. Executables make own transformation on string and merge Use general functions for escaping (helper) Delete unneeded escaping methods(xrmmerge, merge) Delete some unused method from PoEntry class Change-Id: I7f9414581aae9e6de7d1573862a32cdbd68c9545
2013-03-31Make a bit cleaner transformation of help stringsZolnai Tamás1-80/+2
*Not escape tags and double quots in tags, but find tags(icu regexp) when merge and use this infromation to make strings valid. *Define a new Quot function for helpex, which works with icu UnicodeCharacter. *Move tag search to xmlparse.cxx and use icu just in helpex. *QuotHTML not unescape just replace xml charcters. (unescaping is also useless in uimerge.cxx) *Move UnQuotHTML() to helper. (was used it in xmlparse.cxx and cfgmerge.cxx) *Use UnQuotHTML() in uimerge.cxx too. Change-Id: Ice8940ef69279709a1c5d84c6ae1b0d62a71ca76
2013-03-16Get rid of generating temporary sdf fileZolnai Tamás1-59/+63
Working: 1. Localize add header to po files. 2. Executables append po entries to po files. 3. Localize delete entryless po files and empty directories Plus a bunch of clean up. Change-Id: I58e300eaee4cee948203cc9d3e642ca9462d0d26
2013-03-09Use simpler keyid with 5 digitsZolnai Tamás1-7/+7
Change-Id: Iac743d4f298b43067fe5db9199eb39c3301f827e
2013-03-09Delete PoHeader constructor used by renewpoZolnai Tamás1-36/+0
Change-Id: I360a9c96eacf9b7b8bd80214a3fc4c9faa01e631
2013-02-27fdo#39446 - Bloat Removal. Removing uncallable code with callcatcherJean-Noël Rouvignac1-7/+0
Removed several unused methods. Could not remove ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent() and ScVbaFormat<ooo::vba::excel::XStyle>::setAddIndent(com::sun::star::uno::Any const&) because it breaks compilation (they are implementing pure virtual methods). Should Test::test1Table1Page() really be removed? (test class) Conflicts: unusedcode.easy Change-Id: I98a761f66f28e3a82661c10a5fa1dc7e109fff2f
2012-12-29po.cxx: use static and const to increase efficiencyZolnai Tamás1-8/+11
Change-Id: I146808171df2240aaa7901978f94cb260a3def6e
2012-12-24fdo#58673 Generate the same keyid for pots as for mergeZolnai Tamás1-4/+4
Change-Id: I65c71d22570c62c84d359b12aa5375016be1f69a
2012-12-13Fix adding keyid to po when read from fileZolnai Tamás1-8/+9
Change-Id: I29fdd23da97f1102974a6b5821c224264a37efc3
2012-12-11Skip poheaderZolnai Tamás1-29/+9
Po headers can be various and they don not contain any needed information for merge so skip it without any checking. Change-Id: I6d81b7c85bfdbfd961361d98131ed80ba304e9ba
2012-12-11Revert "performance tuning of helpex"Stephan Bergmann1-217/+20
This reverts commit f1335171987272b66c2e1e0b02cddb28d44502ec. lcl_EscapeTextBlanks in l10ntools/source/po.cxx looks broken to me; for one, there are 't' vs. '\t' and 'r' vs 't' typos, but then it also does not allocate a large enough sBuff, so *out++ writes past the end -- keeps SEGVing for me here.
2012-12-11performance tuning of helpexNorbert Thiebaud1-20/+217
callgrind (on text/swriter/guide translated in 'fr') before Ir = 889,687,925 after Ir = 406,372,177 (405,668,292 w/o the 'native' memory allocator) time confirms: before 0.288/0.272/0.016 after 0.146/0.131/0.015 the output before and after were diff-ed and every generated xhp files are identical. All improvements where done still using 'normal' sal and c++ API. There are still some low-hanging fruits, like XMLUtil:QuoteHTML (probably 20-30 millions Ir to shave there) The destruction of XMLElements is also singularly high (11% of the remaining Ir count) But the bulk of what is left is OString management (alloc/acquire/release/ free/copy), and I/O using streams Change-Id: Ia316c953cd4bd46fc33a58a0c10f26b0ffa042c2 Reviewed-on: https://gerrit.libreoffice.org/1262 Tested-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-12-03fixes for where fast string operator+ is not perfectly source compatibleLuboš Luňák1-3/+3
Change-Id: I80af0399037e4f68113338139e7f2ad2400e65ab
2012-11-25Some cosmetics in l10ntoolsZolnai Tamás1-55/+30
Add comment to new classes Delete unneeded getLanguage() method Make inline GenPoEntry's setter methods Fix some typo Change-Id: I8f337b8c57e1eab7696415dc7297c64e2436f35d
2012-11-20work around ambiguity with msvc and old gccLuboš Luňák1-1/+1
C:/cygwin/home/tinderbox/master-build/l10ntools/source/po.cxx(188) : error C2666: 'std::fpos<_Statetype>::operator !=' : 2 overloads have similar conversions with [ _Statetype=_Mbstatet ] C:/PROGRA~2/MICROS~1.0/VC/include\iosfwd(116): could be 'bool std::fpos<_Statetype>::operator !=(const std::fpos<_Statetype> &) const' with [ _Statetype=_Mbstatet ] or 'built-in C++ operator!=(std::streamoff, long)' while trying to match the argument list '(std::fpos<_Statetype>, long)' with [ _Statetype=_Mbstatet ] Change-Id: Id1375d68996414c5ccf75d5d3ebc0afad061e3d2
2012-11-20-Werror=trigraphsStephan Bergmann1-1/+1
Change-Id: I47f285e94d9437e837a0aaa25c0682b4d2187974
2012-11-19Use icu regex in l10ntools instead of i18nregexpZolnai Tamás1-51/+26
Change-Id: I9062aafa2fefa26b7b1edf0440f4675b2f469e5d
2012-11-18Correct skipping source file line of msgctxtZolnai Tamás1-3/+5
Change-Id: I7aed7a75c6e9b36efca9837c0137075065bcd1e6
2012-11-18Revert "Write source file into po entries' msgctxt"Zolnai Tamás1-4/+1
This reverts commit b0f07bbbc4f179d442ff96471669f02e82686657.
2012-11-18Revert "Correct skiping source file line of msgctxt"Zolnai Tamás1-1/+2
This reverts commit 7f81bbb1c7f090d9e962e5c2cb7b694298bfe1c8.
2012-11-18Correct skiping source file line of msgctxtZtamas1-2/+1
Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660
2012-11-18Write source file into po entries' msgctxtZtamas1-1/+4
So (msgctxt, msgid) pair is unique in one po file Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660
2012-11-18Revert "put filename into msgctxt, because po entries must be unique"Andras Timar1-6/+5
This reverts commit 889574a50c8f5bdffed9f3eb70426cedae0a589c.
2012-11-18put filename into msgctxt, because po entries must be uniqueAndras Timar1-5/+6
Change-Id: I700b668863c2b20cdf60fa672a994b8ae4dc613a
2012-11-18Write source file into po entries' msgctxtZtamas1-2/+4
So (msgctxt, msgid) pair is unique in one po file Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660
2012-11-08Correct typo in po headerZolnai Tamás1-2/+2
Change-Id: Ic98467f5c32a0a84af62f68fbe84c68c3e37f1c1
2012-10-11Use isFuzzy() instead of getFuzzy()Zolnai Tamás1-3/+3
to make more obvious its aim Change-Id: Idc98ae8ce2218c9d387c4f2cb6e4d5603b56aab3
2012-10-11Use MsgCtxt, MsgId and MsgCtxtZolnai Tamás1-76/+76
which are fit better to concept of po. Change-Id: I772e691465351b1492bdb756fc67e3a9de265c25
2012-10-10Move GenPoEntry out of headerZolnai Tamás1-33/+124
GenPoEntry is part of implementation rather than an autonom class thus its place is in cxx file. Because of pointer members we have to override copy constructor and copy operator. In PoHeader class these methods are unneeded so make it non-copyable. The m_bIsinitialized member's meaning widen with that m_aGenPo points an object. So check it not just in getter but in setter methods too. Change-Id: I26ebb885c81d14820076e0d46625c60cc1cf7984
2012-10-10Delete WhiteSpace member of GenPoEntryZolnai Tamás1-12/+3
This member allows us to use more kind of whitespace between po entries but we use one end line everywhere so this variable is unneeded. Change-Id: I4e3c9040ca73580fd01484bb91325a9df04cb4e4
2012-10-10Relocate KeyId to PoEntryZolnai Tamás1-39/+53
KeyId is PoEntry specific attribute rather than part of GenPoEntry. In GenPoEntry it is just part of extracted comment. Four character long helptext/x-comment can lead to incorrect behaviour during file reading. With checking it in sdf-po constructor we can prevent this kind of po comming into existence. Change-Id: I48cc8f34d2c1ca8b86baea25384f5b697f16dd66
2012-10-09Use _t suffix for typedefZolnai Tamás1-5/+5
Change-Id: I8501739e9fb1b184facebc406ed6e20de1f7ab0a
2012-10-09Use static, lcl_ and anonymus namespaceZolnai Tamás1-202/+225
for local functions Change-Id: I0393c9552ca353e80ac61d258a280cbcd53e1cba
2012-10-01Add some new checkingZolnai Tamás1-3/+12
Plus use UpperCamelCase name for some variable. Change-Id: Iaba8b6f47f03b723aa31ef4b45f8b6fd78b7866f
2012-09-30Use new startsWith() method of OStringZolnai Tamás1-14/+8
Change-Id: If8787b007767aa2701ff1b13883bcf33df12a8fc Reviewed-on: https://gerrit.libreoffice.org/737 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-30Corrections for mergeZolnai Tamás1-1/+1
-Correct po type-checking -Use new "lang" variable instead of nonexistent one -Add input parameter to ulfex Change-Id: I1dc17363179d69d40144b6a998eb1bf223bd05e9 Reviewed-on: https://gerrit.libreoffice.org/736 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-30Correct escaping tagsZolnai Tamás1-1/+3
which worked wrong with some language like Asturian Change-Id: Icd5939316ac84a3e569a9cbc04e38edda59dead1 Reviewed-on: https://gerrit.libreoffice.org/735 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-30Move setting of po msgid to constructorZolnai Tamás1-9/+3
because this is part of initialization Change-Id: If6ebe46cea93e378c9060f2c3ced09ab44a3d82a Reviewed-on: https://gerrit.libreoffice.org/729 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-30Make Po classes robusterZolnai Tamás1-45/+201
-Make PoOfstream\PoIfstream classes for checked po input\output -Make copyability obvious -Handle runtime errors with exceptions -Use assertions to define exceptations for programmers Plus some correction -Use simplier indentation -In renewpo.cxx, define sdf file as a tempfile instead of make it in current location -Use constructor to renew poheader -Use const where needed Change-Id: Ic11ce3b9eee9a9fa9fbc4ccda154623160ad9d8a Reviewed-on: https://gerrit.libreoffice.org/728 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-30Not use initializer-list for vectorZolnai Tamás1-4/+6
Change-Id: I6ed72b28be3ad00224cbf7308b4f27a6fb25e24e Reviewed-on: https://gerrit.libreoffice.org/726 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-24Use PoEntry and PoHeader more like an interfaceZolnai Tamás1-150/+111
Delete all members except member with type GenPoEntry and use getter methods to define them. Plus correct renewpo. Change-Id: I97665b406467053fce8b4864b47456762887e715 Reviewed-on: https://gerrit.libreoffice.org/681 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-09-20Use po file for merge 1. stepZolnai Tamás1-42/+133
Make executables to waiting for po as input Add some function to po files Rewrite makefiles to use po files for merge Change KeyId generator not to use xml special charachters One filetype remain: properties Change-Id: If2bd2ae7afc61518c2d838a3cae301ef62dd9761 Reviewed-on: https://gerrit.libreoffice.org/593 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2012-09-03Make interface for PoEntryZolnai Tamás1-35/+85
Use composition insted of inheritance Make all necessary method. Make header file clear Make header file clear Plus cleanup. Change-Id: Idfcc7a4a4f51b402ec86a9685e8ad9fdb23fea71 Reviewed-on: https://gerrit.libreoffice.org/530 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-08-31Correct KeyId generatorZolnai Tamás1-5/+6
Use integer aritmetic and less cast Change-Id: I6fc0667fcbcee5f1a2dc964e2653c042338afa0c Reviewed-on: https://gerrit.libreoffice.org/523 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-08-31Implement more Po method for mergeZolnai Tamás1-49/+275
Implement file oprerations(entire reading and rest part of writing) Convert text to merge/sdf form Plus cleanup Change-Id: I6bab9bb202fcdc6d0f2a13f6c44d28e22c688e1e Reviewed-on: https://gerrit.libreoffice.org/520 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-08-30More cleanup aka clean up cleanupZolnai Tamás1-35/+16
Use integers consistently Change headers Make variable initialization uniform Change-Id: I91937704a80c0d5997ad81591ce79076794a4e32 Reviewed-on: https://gerrit.libreoffice.org/517 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-08-29Some cleanupZolnai Tamás1-11/+11
Use normal integer types when it's unecessary to use sal_int types. Delete some hack from code. Change-Id: I93f0b1f260578d3aa9609b7e9d8a79053693971b Reviewed-on: https://gerrit.libreoffice.org/510 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>
2012-08-29Improve KeyId generationZolnai Tamás1-56/+36
Move KeyId from PoEntry to GenPoEntry to make these classes more separated. Replace crc24 with crc32 (boost/crc). Extend KeyId's charset to [33,126] intervallum of ASCII Change-Id: If761a572e2a2651af3eab253a1582569ea68e440 Reviewed-on: https://gerrit.libreoffice.org/509 Reviewed-by: Andras Timar <atimar@suse.com> Tested-by: Andras Timar <atimar@suse.com>