1. Well, I’ve got a bit of time…

    …and I think I’ve ignored the last two or three “hassle”s I’ve received. 🙂

    Over the last few weeks, I have been working on improving PledgeBank’s translations – Welsh has gone live, Russian is coming along very well, and German and Spanish too – and using feedback from the translators to help make the translation .po files complete (making sure they even include strings used in our JavaScript, and adding any strings accidentally missed out). I’ve also been working on HearFromYourMP, which though currently live and with initial MP messages, is having its “launch” on Monday in the Houses of Parliament – quite exciting. So today I’m watching out for anything going wrong (we moved the site to a brand new server yesterday), tweaking the text and emails, adding some more features, and making sure everything is generally ship-shape.

  2. Changing language twice with gettext

    PledgeBank is quite an unusual site. Many international websites simply need translation (e.g. Debian in Chinese), there aren’t any data items which vary between regions. Others have multiple international markets, with a special website tweaked for each one (for example Amazon in Canada, which has some French and English text on every page).

    PledgeBank is slightly different. First of all the interface needs translating into other languages, like Debian. And we don’t quite have markets like Amazon. Partly this is because we don’t yet know what our markets are, so we just make sites for every country and language combination. We have pledges, which have both a local area and a language associated with them. We’ve also got global pledges.

    All this means that sometimes pledges and text in multiple languages gets shown on one page. For example, if your browser is configured for the Brazilian language, and you are in Brazil, then www.pledgebank.com will look like this. At the time of writing there is only one Brazilian pledge, so below it we show some global pledges in English as examples.

    We use some software called GNU gettext to do our translations. Obviously, I’m not telling the truth – people do the translation, gettext just substitutes the translations into the pages. It’s a great piece of software, simple, old, well used and supported, with good tools for translators to update translations with.

    For some time there’s been a bug in PledgeBank. On certain pages the language can change back and forth several times, and gettext would start returning translations for earlier languages rather than the current one. I’m setting the LANG environment variable to tell it what language to use. After much debugging and an email to GNU, it turns out that this is to do with gettext’s cache. The cache was behaving differently on FreeBSD and Linux, which was confusing me even more.

    To clear the cache you rebind the text domain, that is call textdomain(textdomain(NULL)), after changing the environment variable. This makes everything work happily everywhere. And the main point of this post is to get that nugget into search engines, so anybody else with the same problem has a hope of finding out..

  3. YCML work

    Today, I have been working on YourConstituencyMailingList (which will thankfully not be its final title, I keep spelling Constituency wrong myself 🙂 ). The database now has knowledge of which member of a YCML is the MP, and records comments made by that person, so that they can appear differently in the thread of comments. Also comment email alerts for when new comments are posted to a particular message; I guess I should add RSS feeds of comments, messages, and so on too. A Welsh translation of PledgeBank is coming along nicely, hope to have that up as soon as it’s ready.

  4. Back from the farm

    I guess I should post the photos from our week in Wales. An excellent time was had by all, and I haven’t had to eat since. 😉 We started testing PledgeBank in Portuguese (many thanks to Fabiana for the translation), worked on YCML and what to do with international pledges, and more, all whilst sharing a 26.4k (if we were lucky) dial-up connection. I also began getting to grips with juggling, something I’ve always wanted to do but never got around to. 🙂

    We worked in a lovely converted room in the first floor of a barn. The farm came complete with chickens, peacocks, dog, cat, and sheep. Sheep grazed in the field next door to our office. The birds seemed to be doing all right for themselves, grazing around the farm. The bucket of water was probably mostly for the dog, Molly, but the chickens had turns too. After setting off on our walk, we quickly came across a pretty church. Even from far away to the east, you could still make out the farm, our office and the field where our tent was. One field contained many beehives. Another farm we stumbled across had the intriguing sign: 'Last inhabited 1955 by Ted Triggs and family' Views of the Brecons were magnificent. Proceeding in a circular route round to the west, we came in view of our farm again. Again, lovely views of the Welsh hills. I think the sheep near the office were spying on us. When sheep realise you have food for them, they run rather fast and make the ground shake. No sense of decorum, they just climb on top of each other to get to the food. Goodbye to the peacocks and hens, who don't seem to notice our going.
  5. Wanted: Gettext Volunteer(s)

    In the three days since PledgeBank launched we’ve had lots of people from around the world asking if they could help translate the site into other languages. We’d love for this to happen, but in order to do so the site needs to be adapted to work in different tongues. The system we plan to use is gettext, and we’re looking for a volunteer to take a lead on making this happen. So if you’ve direct experience with gettext, or you think you could bend it to your will, please get in touch.