Improved .desktop translation

MoManager manages translations for the .desktop files in /usr/share/applications.

Previously, only the 'Name' field was translated, I have now added the 'Comment' field.

A langpack PET created by MoManager has /usr/share/, which is a collection of .desktop files with the appropriate translated 'Name' and 'Comment' fields.
Refer to /usr/sbin/momanager to see how this directory is created, and /usr/share/doc/langpack-template/ for the langpack post-install script (which will perform the translations on /usr/share/applications).

I have extended this so that the Puppy Package Manager will recognise if /usr/share/ exists (meaning a langpack installed) and will apply a translation if a matching .desktop file exists in /usr/share/ when a package is installed.
Refer to script /usr/local/petget/

I think that L18L and others were modifying '' in their langpacks, but now need to consider return to the official script.

Woof commit:

Posted on 26 Sep 2012, 9:43


Posted on 26 Sep 2012, 10:02 by BarryK
Have made some mods to the scripts, have to do some urgent work, will get back online later and do another woof commit.

Posted on 26 Sep 2012, 18:51 by BarryK
Re mods
Ok, I was busy all day, at home this evening.

I tweaked the code a bit, also modified MoManager slightly.

A translator can now accumulate translated .desktop files in /usr/share/, and they will all be copied into the langpack PET.

There was a restriction before, that only .desktop files of installed packages were being offered by MoManager for translation, and hence for inclusion in the langpack.

Now however, the translator can make a big collection of them. Say that the translator installs OpenOffice and then uses MoManager to create translated .desktop files (assuming not already) -- MoManager places all .desktop files into usr/share/ in the langpack.

In the future, say a different Puppy running, the translator installs the latest langpack, then those OpenOffice .desktop files will be installed also. When MoManager is used to create another langpack, those OpenOffice .desktop files will go into it. It does not matter that OO is not installed in the current pup.

In this way, or even by manually inserting translated .desktop files into /usr/share/, the translator can create a langpack with a big collection of .desktop files to cater for future pkg installations.

As already noted, the PPM checks in /usr/share/ when it installs a pkg.

Latest Woof commit:

Posted on 26 Sep 2012, 19:08 by L18L
return to the official
First reason for the inofficial was that updating an existing translations was not possible.

2nd: Entering new translations was slow, 1 minute for the refresh of momanager, so I had used /usr/share/sss/menu_strings for this.

Yes, return to the official scripts sounds good!
I will be working on that.

Posted on 26 Sep 2012, 19:15 by L18L
official 2
Barry, I did not see your last comment when submitting mine.
So I am sorry if that sounds somewhat confusing.

I will be working on that.

Posted on 26 Sep 2012, 20:19 by L18L
I have enabled translation of PACKAGE and KATEGORY in petget/ but I am not sure
please look at
Thank you

Posted on 27 Sep 2012, 8:05 by BarryK
Updating .desktop
Ah yes, I see. You wanted the langpack to update an already-existing translation in a .desktop file.

Ok, done, see Woof commit:

Posted on 27 Sep 2012, 8:54 by BarryK
The file /tmp/petget-installed-pkgs-log written in must remain as English, as it gets parsed by other scripts -- well, currently only does that.

So, I have implemented the translation of PACKAGE: and CATEGORY: in /usr/local/petget/petget and

Woof commit:

Posted on 2 Oct 2012, 2:26 by L18L in langpack
I think that L18L and others were modifying '' in their langpacks, but now need to consider return to the official script.
Barry, see my post at forum please.

Posted on 3 Oct 2012, 24:35 by rodin.s
New doesn't work
New doesn't work here. I have replaced old with new one and menu is not translated while installing package. Maybe some entries are translated but not all and 'desktop-directories' are not translated at all. So I put back old one which works.

Posted on 11 Oct 2012, 7:33 by BarryK
Re: new doesn't work
I have tested with your ru langpack 120720 and the new

Installing from the commandline:
# petget /mnt/sda10/temp3/

The install script seems to have worked correctly.

All .desktop files in /usr/share/applications have translation inserted.

Only some files in /usr/share/desktop-directories are translated, as many .directory file names have changed. You will need to look at the new files and provide translations for them.

The old only seemed to work correctly, as you were probably re-installing after having tried with the latest, not in a pristine puppy.

Posted on 11 Oct 2012, 8:05 by BarryK
langpack hacks script
Ok, I have put in a call to your hacks script, see Woof commit:

I had a quick look at your hacks script. One problem is that you should not have absolute paths. Instead of "/usr/sbin/gparted_shell", have "./usr/sbin/gparted_shell" or "usr/sbin/gparted_shell".

This is so the script will work if the langpack is selected in Woof, as a builtin package. Which would be the case if someone was building a German Puppy.

Posted on 12 Oct 2012, 22:00 by L18L
re: langpack hacks script
Thank you.

Okay, so I will use relative paths.