Bug 52192

Summary: New localization tooling (kill SDF)
Product: LibreOffice Reporter: Andras Timar <timar74>
Component: LibreOfficeAssignee: Tamás Zolnai <zolnaitamas2000>
Status: RESOLVED FIXED    
Severity: normal CC: andika
Priority: medium    
Version: 3.6.0.0.beta2   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description Andras Timar 2012-07-17 11:54:37 UTC
Currently our translators work with po files and we store po files in git. However, LibreOffice build system still uses the old sdf file format internally, and conversion from/to sdf takes a lot of time.

Tasks:

1. Extract strings from source directly to pot (with all necessary information, including keyid, and if possible, be compatible to current pot files).

2. Merge translations from po to LibreOffice source files.
    + checks at merge time 
      * build breaker bugs should be detected (like gsicheck)
      * compare msgid to source en-US string and don't merge if they don't match
Comment 1 Andras Timar 2012-07-17 12:30:13 UTC
For the 1st step (extraction):
1. Create en-US.sdf (make translations), it will be in workdir/$OUTDIR/CustomTarget/translations/translate/sdf-template/en-US.sdf
2. Create pot files. I use translate-toolkit with the following patch
--- translate/convert/oo2po.py.orig	2010-08-23 08:45:46.000000000 +0200
+++ translate/convert/oo2po.py	2012-04-14 16:14:42.000000000 +0200
@@ -75,10 +75,9 @@
             else:
                 # if the language doesn't exist, the translation is missing ... so make it blank
                 part2 = oo.ooline()
-        if "x-comment" in theoo.languages:
-            translators_comment = theoo.languages["x-comment"]
-        else:
-            translators_comment = oo.ooline()
+        line = oo.ooline()
+        line.text = part1.getparts()[11]
+        translators_comment = line
         key = oo.makekey(part1.getkey(), self.long_keys)
         unitlist = []
         for subkey in ("text", "quickhelptext", "title"): 

The command: oo2po -P -i sdf-template/en-US.sdf -o pot

3. Add keyids. The command:

perl /path/to/l10ntools/scripts/addkeyid2pot.pl pot

The result is something similar that you can download from http://dev-www.libreoffice.org/l10n/latest-pot/ (see 3.6 files for reference)

First task is to extract pot files from the source in a single step, fast (C++). Re-use as much of possible from existing code.
Comment 2 Andras Timar 2012-08-25 11:24:16 UTC
*** Bug 52469 has been marked as a duplicate of this bug. ***
Comment 3 Andras Timar 2013-01-14 19:52:18 UTC
Task completed, closing.