[Kbabel] Source references

Nicolas Goutte nicolasg at snafu.de
Mon Dec 26 12:44:21 CET 2005


I have worked on the source references (also known as contexts) in KBabel.

A few weeks ago I have fixed the problem that once you had clicked an entry 
without any valid source references (typically all rc.cpp references), not 
any other source references would work anymore for that PO file.

In the last days, I have added the parsing of source references coming from 
extractrc and extractattr, so for comment lines starting like:
#. i18n file

I have also added parsing the source reference of Gettext's "strict" mode of 
PO files, so for lines starting like:
# File

For GNU-like projects, I have introduced a new variable @POFILEDIR@ to create 
search paths starting from the directory of the PO file.

For new KBabel projects, two new search paths are added by default:
@POFILEDIR@/@COMMENTPATH@
@POFILEDIR@/../@COMMENTPATH@
(The last one is typical for GNU.) This fixes bug #114041

For projects extracting their POT files under Windows, I have added the 
support of backslahes in the source references' paths of the PO file. (That 
fixes bug #116393.)

So if you have the development versions of KBabel, it wouldbe nice if you 
could test. If you do not have it, please test KBabel 1.11.1 of KDE 3.5.1 
when it will be out (in a month or so), so that eventual problems could be 
fixed for KDE 3.5.2.

Despite the work, there are still cases where the source reference will not 
work. (Just a note: this is for PO files only. Qt translation files or XLIFF 
are not specially supported current by KBabel, as far as I know.)

PO files for KDE DocBooks have not enough information for KBabel to find back 
the source. (Only the pure file name is given as reference.) Fixing that in 
KDE will be difficult but should be possible. (I have an idea but it must 
mature a little.)

desktop_something.po files do not work either, as KBabel cannot guess 
currently the needed paths out of the file name of the PO file. Perhaps a new 
variable, for example called @KDEDESKTOPSPECIAL@ , should be needed. (I do 
not really like it, as it again puts non-Gettext KDE knowledge into KBabel.)

And last but not least, PO files whose POT files are extracted from 
directories below KDE's "top sub directories" have also to few information to 
let the source references work. (KBabel cannot guess the module name.) Fixing 
that in KDE will be very difficult.

If somebody knows another way to defeat the source references, please tell, so 
that at least it could be documented as known problem.

Have a nice day!



More information about the kbabel mailing list