This Week In Metacity

January 22nd, 2010 by Thomas Thurman

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

January 20th, 2010 by Thomas Thurman

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

January 9th, 2010 by Thomas Thurman

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

January 7th, 2010 by Thomas Thurman

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

January 7th, 2010 by Thomas Thurman

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.

Two thoughts about Belltower

December 2nd, 2009 by Thomas Thurman

I have a Maemo application called Belltower in testing, which lists towers hung for English full-circle change ringing (rather than any tower in the world which happens to contain bells). Here is a screencast of the app in use. The data comes from Dove’s Guide. It allows you to

  • find all towers nearby, using the GPS
  • find a tower by name
  • find a tower by geographical area (country, then county, then alphabetically)
  • bookmark towers and come back to them later

Here are two questions about Belltower on which I’d like your feedback.

1. The front screen currently looks like this:

But I’m wondering whether it would be more Maemo-ish to give it an interface like the app manager and the media player. Something like this (excuse the quick mockup):

What do you think?

2. Generalising Belltower. An application to find belltowers is useful for ringers, but the same code could come in useful in other ways for other people. Eiffel on t.m.o suggested that there should be a wiki which lists sets of geographical points within a particular category, such as

  • belltowers
  • Tube stations
  • public toilets
  • perhaps a chainstore might want a set of points for its own stores
  • stone circles
  • UFO sightings…

which could be fed automatically by sites such as Dove and openstreetmap, or just by people editing the wiki itself. Each point would have

  • a name
  • a short block of HTML giving facts about the point (such as, for a Tube station, which lines it was on)
  • possibly a picture
  • possibly a URL to follow for more information
  • and always a latitude and longitude pair.

Then son-of-Belltower should be able to pull from this wiki with a custom API; the user could select which overlay they were interested in.

I think this idea has a lot of merit. I may do it. I’d like to hear your ideas about it as well.

Your mountains so lofty

November 9th, 2009 by Thomas Thurman

There has been quite a bit of discussion on the GNOME wiki about how CSS themes could be improved. I would very much like your feedback too.  (The section numbers are taken from the Cowbell documentation.)

Also, I am not sure whether to add optional CSS theming support into standard Metacity and then split it out into libcowbell so it can be easily used by other WMs, or to do the libcowbell split first. It’s probably simpler the second way, but the first brings more immediate and obvious results.

I wrote a poem the other day:

April in Paris

The sea lies solid under ice,
The blizzard seldom stops;
The glögi’s running freely
In friendly coffee-shops;
The trams still run and life goes on
And still I can’t remember
Why no-one ever calls a song
“Helsinki in November”.

(It’s actually far more like this in December, so maybe I should make that the month; but then you’d all know that I was employing poetic licence. February even more, but then it wouldn’t rhyme.)

I went to St Nicholas’s yesterday, where everyone was very friendly as usual, and they held a minute’s silence for Remembrance Sunday. It seems that a lot of people are posting “what my grandfather did in the war” stories, so here are the exploits of my own grandfather, Bob Thurman.

I have expanded my old triolets blog into a site called triolets.org. Here’s another I recently wrote for Fin:
To sleep next to you
when the weather is cold
is trusted and true.
To sleep next to you
is decades from new
yet it never grows old
to sleep next to you
when the weather is cold.

On the plane over here, and occasionally in the evenings, I played around with automatic translation into Shavian. We’ve had some problems using Launchpad for translation, so I experimented with doing things upstream the old-fashioned way. Though the translation is automatic, it needs to be hand-checked; otherwise, things like XML elements get translated. But it’s a quick and simple thing to do, and I’ve checked quite a few of them already. I know some of the people reading this are interested in Shavian, so if you want to join in, please do. Once we get GNOME in Shavian, we will of course automatically have GNOME in Deseret, Unifon and Tengwar. I imagine having everything marked up in a phonemic alphabet might actually be useful for screen readers, too.

CSS on window borders experimental layout language

October 29th, 2009 by Thomas Thurman

cowbellI’m happy to announce the first experimental version of Metacity with support for CSS window borders (”Cowbell”). This work was largely supported by Collabora Ltd.

You can:

This diagram should explain everything, perhaps.

I would especially like to hear from:

  • theme artists, to let me know whether it’s adequately powerful;
  • anyone else interested in hacking on this with me;
  • the GTK client-side decoration people, so that we can harmonise the way we represent things;
  • people who know a lot about CSS and can offer insights into the suitability of the way we represent things;
  • people who know a lot about the Dublin Core and can offer insights into whether our metadata system uses it appropriately;
  • maintainers of other window managers (especially Mutter), so we can talk about including CSS support in other window managers;
  • everyone else, to suggest which of the directions for future development are most interesting.

I think it may perhaps be helpful to set up a Cowbell mailing list, so that we can compare notes on implementations. For example, I haven’t written down anywhere how to place an image to the right of the title, which is commonly needed (you use border-image).

Photo © Craft*ology, cc-by-nc.

Wednesday in brief

October 22nd, 2009 by Thomas Thurman

Cowbell, Shavian and a sonnet

October 21st, 2009 by Thomas Thurman

I haven’t posted for a while.  Here are four things:

  1. Collabora have been supporting the CSS-on-window-borders project recently by letting me work on it during work hours.  Here is a status update.
  2. Recent updates to shavian.org.uk include a gentle Shavian tutorial and translations of all the recent XKCDs into Shavian.
  3. Many years ago, I wrote a sonnet for use on a server’s custom 404 page:

    So many years have passed since first you sought
    the lands beyond the edges of the sky,
    so many moons reflected in your eye,
    (familiar newness, fear of leaving port),
    since first you sought, and failed, and learned to fall,
    (first hope, then cynicism, silent dread,
    the countless stars, still counting overhead
    the seconds to your final voyage of all…)
    and last, in glory gold and red around
    your greatest search, your final quest to know!
    yet… ashes drift, the embers cease to glow,
    and darkened life in frozen death is drowned;
    and ashes on the swell are seen no more.
    The silence surges. Error 404.

    It’s been spreading itself around, mostly without my permission, so I’m releasing it under a Creative Commons licence.  Fly free, little sonnet!  Please feel free to copy it onto your own sites, and if you would, let me know you’ve done so.

  4. I need to write more of the Maemo tutorials.  They will be coming soon.  Sorry; things have been busy.