[Kbabel] Default behaviors (header-wise) in KBabel

Stanislav Visnovsky visnovsky at kde.org
Mon Oct 31 15:18:49 CET 2005


Dňa Sobota 29 Október 2005 14:36 Nicolas Goutte napísal:
> On Saturday 29 October 2005 08:00, Daichi Kawahata wrote:
> > On Fri, 28 Oct 2005 20:31:46 +0200

<skip>

>
> > > > > > >   o It replaces given proper header string at
> > > > > > > `Project-Id-Version' with ISO 639 language code.
> > > > > >
> > > > > > In fact it is the filename that it places there.
> > > > > >
> > > > > > (In KDE, PO files are not named by the language but like the
> > > > > > corresponding POT file. And the directories are ordered by
> > > > > > language, not by POT file.)
> > > > >
> > > > > Probably so, but I've seen many times the following case from
> > > > > KBabel:
> > > > >
> > > > >     -"Project-Id-Version: Mousepad 0.2.2\n"
> > > > >     +"Project-Id-Version: ca\n"
> > > >
> > > > Yes, because in your project, the PO files are named like the
> > > > language code: ca.po . KBabel drops the .po extension and uses the
> > > > basename as project name.
> > > >
> > > > That is convenient in KDE, apparently not at all for you.
> > > >
> > > > > This clearly discarded proper give information.
> > > >
> > > > Because by default KBabel is told to do so.
> > >
> > > In the the project configure dialog, there is settings for save (the
> > > "save" icon). On the "Header" tab, you can select which fields of the
> > > headers are updated.
> > >
> > > So if you want you can uncheck the "Project" checkbox and then the
> > > "Project-Id-Version" will not be changed anymore on save.
> > >
> > >
> > > Alternatively you can set the "Project-Id" edit box, but I do not know
> > > which "magic" string will do what you intend to do.
>
> I have checked again in the meantime: there is only two "magic" strings and
> there are those already used. So there is no solution in this way.
>
> > Please look a subject, what I asked is not knowing usage of KBabel, it
> > was changing default behaviors of KBabel,
>
> Well, the default behaviour of KBabel will probably always remain oriented
> to what KDE needs. What is probably missing is an easier entry level for
> non-KDE projects.
>
> Probably the "GNU" setting in the wizard is not enough, at least according
> to your feedback. (Also it could also be possible that for some software
> projects, GNU settings are as extreme/unsuitable as KDE ones.)

Probably. But the default behavior also works for GNU packages, where the PO 
file is named like 'gettext.cs.po'.

>
> > okay I understood ISO language codes
> > at the `Project-Id-Version' come from directories `$lang.po/', but what's
> > logic behind there?
>
> No, you seem to have misunderstood me.
>
> The @PACKNAME@ "magic" string takes the file name (in your case ca.po) and
> uses the basename of the file name (for you: ca).
>
> The logic is that in KDE the PO files have the same names than the
> corresponding POT files (except the final T in the extension). So for a
> kdelibs.pot, the translation would be in kdelibs.po. And "kdelibs" makes a
> good project name. (The version number in the Project-Id is not used in
> KDE.)
>
> > I mean, PO file I used as example isn't unique, the
> > most KBabel users tend to make a mess against the header.
>
> Probably because the setting about Project-Id is the most KDE-specific of
> all settings of KBabel. (I will have to check what the "GNU" setting of the
> wizard sets. Perhaps the problem is (also?) there.)

Yes, because the value is completely undefined AFAIK.

>
> > For example (from libxfcegui4-4.2.3, in Xfce):
> >
> >   # SOME DESCRIPTIVE TITLE.
> >   # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
> >   # This file is distributed under the same license as the PACKAGE
> > package. # FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
> >   #
> >   #, fuzzy
> >   msgid ""
> >   msgstr ""
> >   "Project-Id-Version: PACKAGE VERSION\n"
> >   "Report-Msgid-Bugs-To: \n"
> >   "POT-Creation-Date: 2005-10-28 20:54+0900\n"
> >   "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
> >   "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
> >   "Language-Team: LANGUAGE <LL at li.org>\n"
> >   "MIME-Version: 1.0\n"
> >   "Content-Type: text/plain; charset=CHARSET\n"
> >   "Content-Transfer-Encoding: 8bit\n"
> >
> >
> > yeah, that's initial header strings by `make *.pot', then usually I
> > create target PO file with `msginit (--locale=$lang)', in this case
> > I used `de', generated PO file has header below,
>
> To compare: KBabel's philosophy would be to open the POT file and save it
> as PO file. KBabel would be supposed to set all headers correctly (at least
> for KDE, if the project configuration was done correctly).
>
> The msginit program is barely needed in KDE, as its main information would
> be the plural formula, but plurals are not handled like this in KDE. (It is
> planned to return to the Gettext behaviour in KDE 4, now that the Gettext
> development version has message context support.)

KBabel is able to do that if you want. It is even able to ask msginit for the 
proper header.

Stano


More information about the kbabel mailing list