This Week In Metacity

This week: Collabora have been supporting me in working on Metacity over the last week or so.  I began by trying to get the CSS themes branch merged, but then decided that a better use of my time would be patch review, especially given the impending feature freeze.  Here’s a partial list of some of the things I’ve touched; I’ll update it for this week when this week’s over.

ProjectJournal: Producing the Metacity Journal and other Metacity blog posts has been a helpful record of people’s work on the program, but blogging about the project does tend to drive out actual maintenance and development.  For this reason, a while ago I wrote a program called ProjectJournal which would prepare Metacity Journal posts automatically.

ProjectJournal used to scan IMAP folders for Bugzilla notifications and svn checkins.  It would then output a list of bugs that had been touched, files that had been modified, and translations that had been made, as well as any hits for the name of the project on Google Blog Search, add a photo, and then post it as a draft to blogs.gnome.org.  Then a human (me) would come along and tidy it up and write the introduction, resulting in posts like this one.  It was a neat hack, and saved a lot of time, but it’s rotted because it was never rewritten to work with git.  Also, Bugzilla should be queryable directly now, though ours isn’t at a version where the API supports queries, so it would have to be done with a screen-scraper.  Ugh.

What I’m wondering is whether any of you would be interested in using such a tool for your own projects, if I resurrected and modernised it.  Do let me know.

(For several months there was also a daily Bug of the Day post, but although that was fun and got the community discussing the issues, it didn’t help the time I had available for coding.  Perhaps the project needs someone who likes writing better than coding, a sort of public recorder.  Or perhaps I could carry on doing it if there were many other people writing the code.)

Posts that might interest you: In case you’re not reading the Metacity blog, here are some interesting posts from the last week:

Feel free to dive in on the discussions.  Feel even more free to volunteer to write patches for some of these; I’ll try to give you all the help you might need.

Podcast: At one point I used to record myself reading all the Metacity blog posts (such as this one).  I’m not sure whether I should bring this feature back, or what should happen to it further if I did.

Introduction to software localisation for conlangers

Some people have asked on CONLANG-L whether it’s possible to translate free software into constructed languages. I said I would put some instructions together, and people were interested, so here goes.

Caveats:

  1. This is about the free desktop. It will describe how to localise GNOME or KDE. I don’t know anything about how to do this on the Mac or on Windows, so my advice to you will consist approximately of “please install Ubuntu“.
  2. Be sure you know what you’re letting yourself in for. There are about 45,000 strings which need translation in GNOME, although you can get a decent effect by translating only a few thousand. Then there are the applications themselves on top of that.
  3. If you’re translating into a language which uses characters which don’t appear in Unicode, I’m going to assume you’ve already made your computer able to display them. Matters such as designing a character set, getting space in CSUR, and building fonts are outside the scope of this tutorial.
  4. This is just enough to get you going; I’ll be cutting some corners and waving my hands around some of the difficult bits.
  5. Before we start, you should have both the “gettext” package and the Gimp installed.
  6. What I’m going to say is true for most programs, but a few have their own way of doing things.  Firefox is one of these.

Here’s what we’re going to do: we’ll change the titlebar of the GNU Image Manipulation Program (the Gimp) to display in a conlang. Since I’m writing this, I’ll translate the titlebar into my own conlang, Nimyad; work out what it is in yours before you go on. Bear in mind that “GNU” is a proper noun and should not be translated.

The phrase “GNU Image Manipulation Program”, rendered in Nimyad, is “dajath GNU camimoth lirinanen”, or in the con-script:

Next we’ll need an ISO 639 code. These are rather difficult to come by for conlangs (even Toki Pona was rejected), but fortunately the codes between qaa and qtz form a private use area. We’ll say that Nimyad is qny; pick one of your own and use it in what follows.

Now you need the translation template for the Gimp. You can get it here; click the green arrow next to “POT file” and it will download. Now rename the gimp.master.pot file to qny.po and open it in a text editor. (Don’t use Emacs for this; it tries too hard to be helpful and will confuse you.) Find the lines which say

msgid “GNU Image Manipulation Program”
msgstr “”

This means that the string “GNU Image Manipulation Program” is translated to nothing at all. That’s not very useful yet, so put your conlang’s translation in there, after the msgstr, between the quotes. Save the file.

Now we need to compile the .po file into a .mo file, which is the format that the programs themselves can read. Run: msgfmt qny.po

If it worked, you will have a file called messages.mo in the current directory. If it didn’t, make sure you did in fact install the “gettext” package!

Create the locale directory: sudo mkdir -p /usr/share/locale/qny/LC_MESSAGES
and move the file in: sudo mv messages.mo /usr/share/locale/qny/LC_MESSAGES/gimp20.mo

Finally you’ll need to create all the locale data other than the actual language. You can just base that off another locale, such as en_GB, for now: sudo localedef -v -c -i /usr/share/i18n/locales/en_GB -f UTF-8 /usr/lib/locale/qny/

It will probably throw up a lot of errors, which you can ignore at the moment.

When you have a fair number of strings translated, it will make sense to run in the qny locale all the time.  But for now we’ll just run it as needed.  So: now at last you’re ready to type: LANG=qny gimp&

And you should see:

Well, that’s one string down, 45,000 to go.  You see that the strings which haven’t yet been translated fall back to US English.

Finally: now that you’ve seen how easy translation is, if you happen to speak any of these languages, please consider contacting the translation team and offering your help.

Let me know if you have any questions!

Using the Shavian alphabet on the N900

For a while I’ve wanted to take notes in the Shavian alphabet on my N900.  The other night I finally got around to putting in Shavian support. It was a whole lot easier than I’d imagined: about ten minutes’ work, and as so often I’m rather impressed at how flexible Maemo is. This post was enormously helpful.

You can switch alphabets using the system menu; excuse the dreadful antialiasing on the icon I whipped up in a few seconds. When you’re typing in Shavian, the Fn (bluearrow) key will let you type in the Latin alphabet briefly.

And the notes application (and Conboy) don’t have any problem with the non-BMP codepoints needed.

I would package this, but I’m not sure it would be useful to anyone but me. On the other hand, it might be helpful for other people who wanted to know how to do something similar.

BBC Micro

In unrelated news, last night I packaged the Maemo port of Beebem which I’ve been talking about for a while.  So if you want to play around with the BBC Micro, go and have a look. Be warned that it’s very, very flaky.

I’d rather like feedback on whether and how well it works for you, and suggestions on how to fix any of the points raised in that post.

Contentment

Brown paper packages tied up with stringsI was having a discussion earlier on IRC about the role of the N900’s App Manager. The question I’m raising is: is it legitimate to package non-programs which can be already downloaded in another way?

Here’s an example.  A film which is DFSG-free such as Sita Sings the Blues could be packaged as an app.  The package would install the .mp4 of the film, which would then appear in Media Player, but perhaps would also have an icon in the launcher.  (Of course people can already find Sita on the web and watch or download it there, giving the same effect, but then they might be more likely to find it in the app launcher.)

Far-fetched?  Not really; there are already iPhone apps which contain only a book, and there are existing Debian packages which only install free HTML and text content.

Since films are essentially documents which can be opened by Media Player, the question can be generalised: Should documents be packaged, or only apps? When someone ports Frotz to the N900, should it have its own separate download manager for Z-machine games inside it as the iPhone port does, or should each game become available in the App Manager as a separate package as used to be done on Debian?

And then there are radio stations such as Soma FM which have iPhone apps to let you listen to them.  Now of course you can already do this in the N900’s media player, so would it be worthwhile for them to package a specific N900 app which connected to their streams?  Or to make a package which only populated the media player with a list of them?

But just because people do something with the iPhone it’s not necessarily a good idea:

  • media packages should probably install into /home/user/MyDocs or /media/mmc*, but the conventional place for large files in app packages is /opt, which would fill up quite quickly with a few Sita-sized films
  • each package gets to run scripts as root, and this may have more security considerations than people are comfortable with just to watch a film
  • people expect app stores to contain apps (don’t they?)

I think an alternative route would be to have one standard application which could maintain a browsable list of Free content, and which could download it for you as appropriate.  Maybe it could be extensible to act as a download manager for Free content for the emulators and so on, as well as just films and text.  What do you think of all this?

Photo © Caro’s Lines, cc-by-nc-sa.