Proposal on *.desktop etc. files (Re: GNOME 1.1.90)

Gediminas Paulauskas <> writes:

> HELP: maybe someone has done scripts to collect all untranslated *.desktop
> etc. files from local CVS repository into some TRANSLATE-ME directory?
> *needed*

Collecting isn't that difficult; I posted an AWK script (awk, sigh).
The slightly more challenging part is to feed the translations back.
Here's my complete proposal again; now presented to the hackers with the
plea, to implement something along these lines _after_ release 1.2

From: Karl EICHWALDER <>
Subject: Proposal: .desktop, .directory, etc. files
Date: 19 Apr 2000 11:10:33 +0200

To protect the .desktop, .directory, etc. files better and to make it
easier for the package maintainers and the translators, I like to
propose the following work flow:

1.,, etc. files.  These files should
   contain the english strings only.

2. Extract all strings from .in files (cf. 1.) and write a POT file
   similar to the one we already use for regular program messages.
   Proposed file name: PACKAGE-misc.pot.

3. Translators will translate PACKAGE-misc.pot (cf. 2.) and rename it to
   PACKAGE-misc.LL.po; LL means the language code.  Updating will be
   done with msgmerge as usual.

4. Extract the translations from all the PACKAGE-misc.LL.po files
   (cf. 3.) and write the usual .desktop, .directory, etc. files.  This
   step should happen at compile time.

This work flow has the advantage that the translator doesn't have to
hunt for all these files (cf. gnome-core!) and he cannot mess up
translations done by other (foreign) translators.

An example:

Step 2 could be done using this AWK script (please, save it as

-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
  FS = "=";
  ref = "#: %s:%s\n";
  id_template = "\
msgid \"%s\"\n\
msgstr \"\"\n\n";
  name_template = ref "#, [Desktop Entry] Name\n"  id_template ;
  comment_template = ref "#, [Desktop Entry] Comment\n"  id_template ;

$1 ~ /^Name$/ {
  printf (name_template, FILENAME, FNR, $2 ) ; }

$1 ~ /^Comment$/ {
  printf (comment_template, FILENAME, FNR, $2 ) ; }

# create-misc.awk ends here
-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-

Save this fragment as

-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
[Desktop Entry]
Name=Bug Report Tool
Comment=Report a bug (in GNOME, KDE, etc.)

; ends here
-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-

Enter the following command:

    awk -f create-misc.awk > bug-buddy-misc.pot

and play with bug-buddy-misc.pot.

A script for Step 4 is still missing.  I like to hear comments (this
proposal was inspired by a question asked in a private e-mail by Ville)!

-=- End of my proposal: -=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-

And Kenneth comment:

Subject: Re: Proposal: .desktop, .directory, etc. files
Date: Thu, 20 Apr 2000 10:24:08 +0200 (CEST)

I just wanted to say, that it seem like a really great idea. This should
also be done for .soundlist .derectory, the screensaver filer, etc.

This will also eliminate a lot of work, since many strings in the
screensaver .desktop files are the same


-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-

work :                          |
     :             |          ------    ,__o
home :                   |         ------   _-\_<,
     : |        ------   (*)/'(*)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]