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



Gediminas Paulauskas <menesis@delfi.lt> 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
(April):

From: Karl EICHWALDER <ke@gnu.franken.de>
Subject: Proposal: .desktop, .directory, etc. files
To: gnome-i18n@nuclecu.unam.mx
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. XXX.desktop.in, YYY.directory.in, 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
create-misc.awk):

-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
BEGIN{
  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 bug-buddy.desktop.in:

-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-
[Desktop Entry]
Name=Bug Report Tool
Comment=Report a bug (in GNOME, KDE, etc.)
Exec=bug-buddy
Icon=bug-buddy.png
Terminal=0
Type=Application

; bug-buddy.desktop.in ends here
-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=-


Enter the following command:

    awk -f create-misc.awk bug-buddy.desktop.in > 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:

From: kenneth@ripen.dk
Subject: Re: Proposal: .desktop, .directory, etc. files
To: Karl EICHWALDER <ke@gnu.franken.de>
Cc: gnome-i18n@nuclecu.unam.mx
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

Kenneth

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

-- 
work : ke@suse.de                          |
     : http://www.suse.de/~ke/             |          ------    ,__o
home : ke@gnu.franken.de                   |         ------   _-\_<,
     : http://www.franken.de/users/gnu/ke/ |        ------   (*)/'(*)





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