Tuesday, November 18, 2008

wxBanker 0.4 released!

Today I released a new version of wxBanker, which is a lightweight personal finance manager. It is basically a digital checkbook register for multiple accounts; think of GnuCash but easier and more lightweight. It is written in Python/wxPython and runs on Linux, OSX, and Windows. Check out my previous post on wxBanker for a slightly more in depth functionality overview and screen shots.

The main focus of this new version was localization. It now ships with translations for 8 languages (4 of them basically complete, thanks translators!), and also supports displaying the amounts in currencies other than USD including EUR and GBP. It also sports a few of the typical bug fixes / usability improvements you would expect in a new release.

Another feature new to 0.4 is a setup.py, which allows Linux users to install it easily by running "sudo python setup.py install" in the folder, and wxBanker will install itself including a shortcut in Applications -> Office in Gnome, and store your data in ~/.wxbanker. If you are upgrading from a previous release, I recommend moving your bank.db file to ~/.wxbanker/bank.db for the easiest transition, which will also future-proof you from needing to shuffle it around in the future!

I also thought I'd highlight the launchpad integration I added awhile ago in 0.3, since I saw a recent planet post regarding Inkscape doing something similar. In the Help menu I've added convenient links to view and ask questions, and report bugs:


If you have been looking to start taking control of your finances, give wxBanker a try: https://launchpad.net/wxbanker/trunk/0.4 (or 'bzr co lp:wxbanker -r 86' for the seasoned). If you find problems or have ideas, please let me know via launchpad bugs/blueprints, blog comments, or email; if you know another language, help translate by following the Translations link on Launchpad! And remember, when you use wxBanker to count your pennies, the dollars will follow!

Tuesday, November 11, 2008

Zen and the Art of Memes

I wouldn't normally have participated in the nearest book meme going around on Planet Ubuntu, except that sentence 5 of page 56 of the nearest book happened to be divine! From Alan Watts' "The Way of Zen":

Suffering alone exists, none who suffer;
The deed there is, but no doer thereof;
Nirvana is, but no one seeking it;
The Path there is, but none who travel it.

It happened to stumble perfectly on the closing quote of that particular paragraph! If you want to participate:
  1. Grab the nearest book.
  2. Open it to page 56.
  3. Find the fifth sentence.
  4. Post the text of the sentence in your journal along with these instructions.
  5. Don’t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.

Wednesday, November 5, 2008

Microphones (and Rosetta Stone 3) in Wine

Recently I had an urge to brush up on my Spanish and thought I would try Rosetta Stone, however there is no Linux version. I thought instead of "messing around" with Wine I'd just install VirtualBox and use an XP Pro instance. Everything worked alright but the memory and CPU overhead was a little too much for my machine (1.7GHz Pentium M, 1GB DDR). It would run out of memory and thrash the HDD like crazy if almost any other program was running in Linux, defeating a large part of the advantage of virtualizing Windows in the first place.

So then I read in Wine's AppDB that Rosetta 3 seemed to work alright with recent versions, so I gave it a shot and it indeed installed perfectly with Wine 1.1.7 (using the PPA in Intrepid). The best part is that Rosetta uses a single sqlite3 database to track users' progress, so all I had to do was copy that over from the VM and all my progress and history was there in my Wine install!

But then came the problem: I couldn't get my microphone to work! It worked fine in the VirtualBox setup so I knew my hardware was fundamentally compatible. I then tried as many permutations of the follow settings as I could think of:
  • changing Wine to ALSA or OSS drivers
  • enabling and disabling all sorts of ALSA and OSS levels and captures in Volume Control
  • running Wine via `padsp`
Finally I came across an ubuntuforums thread where someone's solution to getting their microphone working with Wine was setting Wine to use OSS and then:
  1. killall pulseaudio
  2. aoss wine program.exe
And that worked for me! I was so full of joy. However, I am a little worried about what consequences killing pulse will have on the system for the duration of the session, and I don't really understand what aoss does. Can anyone enlighten me on why pulseaudio is a part of the problem here, and why aoss is necessary? This was a very helpful solution to me and thought it might be useful to others as well, but does anyone know of a better way that might co-exist with pulseaudio?

Sunday, November 2, 2008

L10N: Integrating translations into your project

This post is the second half of my series on internationalization and localization; that is, making applications accessible to non-English speakers. I am going to assume now that you have followed the instructions in the first post , and have internationalized your source, put the translation template up on Launchpad, and hopefully have a translation or two.

Since my last post, many people donated their time to translate my project wxBanker, and I have 7 translations in Launchpad now! (If anyone wants to add more, please do so, and I'll put you in the credits.) Now I'll outline the steps for actually integrating these translations into your project.

  1. Download the translations. Visit the translations page for your project in Launchpad, and click the "Download translations" link on the right. From here ensure "Everything" is selected, and change the Format to "MO format". This format is what the gettext framework we are using utilizes. Now click "Request Download". They won't typically be available immediately, but you should receive an e-mail in an hour or so with a link to the file.

  2. Once you receive the email from Launchpad, download the linked file. You should now have launchpad-export.tar.gz. Right click on it and "Extract Here". Rename the resulting "launchpad-export" folder to something like "locales", and put it in your project directory.

  3. Now all you have to do is tell gettext where the translations are. Previously we installed gettext via a line like gettext.install("wxbanker"), and now all we need to do is pass in the directory as a second argument. So assuming you renamed the launchpad-export directory to "locales" and put it in the directory of your source code, you'll change it to gettext.install("wxbanker", "locales"). This isn't the most robust and flexible way to do this, and I would recommend checking out my localization.py link below for a better example, especially if you are going to be doing this for a python application.
Now, assuming you followed all the steps in the previous post and this one, your application should be completely localized and run in the native language of the person using it! If you want to see the translation yourself, check out my own version of localization.py, which allows you to pass in the language code corresponding to the subdirectory of the locales directory, such as "--lang=es" for Spanish.

In a day or two I will also add a post on how to actually install other locales in Ubuntu and run your application in it, so that you can ensure you are seeing exactly what someone from that locale sees.

Congratulations on a localized application! Any questions?

Monday, October 27, 2008

I18N: Making your Launchpad projects translatable (and a call for translations!)

Launchpad provides a wonderful translation service called Rosetta that allows multi-lingual users to translate your application to other languages. If you are a translator and want to help translate my project (only 75 strings with a fair bunch of them being quite short), skip to https://translations.launchpad.net/wxbanker to help me out! I will include you permanently in the credits and you will have helped me greatly!

Now, for developers or anyone else interested, I'm going to explain the basic process to go from an English-only application in Launchpad to something that can be easily translated by anyone. This will internationalize your project, and in a later post I'll explain how to localize it; that is, once you have translations, how to integrate these into your project so users in other locales see the translated strings instead of English. My project is wxBanker (wxbanker.org), so I'll be using that for reference.

  1. First, you'll want to make all your user-visible strings translatable in your code. I used gettext (http://en.wikipedia.org/wiki/Gettext), and it is quite easy in Python. Basically, you wrap all strings you want to be translated in a gettext call, which is typically assigned to the underscore character to be easy to type and read. So "Hello, world!" will become _("Hello, world!"). When your application is run, this call will then translate that string into the appropriate languange (once you have everything set up, which will be Part 2 of this post).

    Sometimes you may want to restructure or break up larger strings into smaller ones. If you have two strings "Sentence A. Sentence B." and "Sentence A. Sentence C", you may want to gettext those as _("Sentence A.")+_("Sentence B.") and _("Sentence A.")+_("Sentence C."), so that Sentence A only needs to be translated once. However, make sure to give enough context for translators. Basically, apply principles of resuable software design to your strings.

  2. If you try to run your application now, it probably won't work as the underscore function won't be defined. You'll need to set the locale to the user's default and install gettext. In Python this is:

    import locale
    locale.setlocale(locale.LC_ALL, '') # use the environment default '' for ALL purposes
    import gettext
    gettext.install("wxbanker") # specify the translation namespace

    Now you should be able to run your application and everything should work normally in English; we haven't broken anything! To simplify this set up, however, I like to put those above four lines in a separate file such as localization.py, and import that in any file which wraps strings using gettext, so I don't have to duplicate those each time.

  3. Now you need to generate a translation template. This is fairly straightforward; simply run xgettext at the command line on all the files you used gettext in. For example: "xgettext file1.py file2.py file3.py". This will generate a file called messages.po, which is your template. Rename this to messages.pot (the scheme Launchpad prefers) and we can proceed!

  4. Now we'll set up Launchpad. Edit your projects details (in my case: https://launchpad.net/wxbanker/+edit) and check the box that says "Translations for this project are done in Launchpad", scroll to the bottom, and click "Change".

  5. Click the Translations tab of your project in Launchpad and upload the .pot file you generated in step #3. If this is your first time doing so, it will need to be reviewed by a human, and will take perhaps a day to get approved, at which point you will receive an email letting you know it has been and you are good to go.

  6. Your project can now be translated! Visit your Translations page again (such as https://translations.launchpad.net/wxbanker) to see the status. You won't see anything exciting if there aren't any translations yet and you aren't configured for more than English (click Select Languages in the lower right to change this), but otherwise you will see an option to translate the project for each language other than English that you know, and the status of the translation.
If you have been meaning to internationalize your project, give it a shot now! Also, please let me know if I have missed or botched any steps. We'll go through putting the (hopefully) resulting translations into your project in my next post!

Sunday, October 5, 2008

wxBanker 0.3 released!

I am proud today to release version 0.3 of wxBanker, a free, simple, lightweight personal financial management application for Linux, Windows, and OSX! It is written in Python and wxPython.

It is basically like the concept of the checkbook register brought into the 21st century, allowing you to keep track of balances and transactions across multiple types of accounts. It allows you to know the balances of your accounts without relying on your bank or credit card online interface, which is often slow to update and can't take things like uncashed checks into account. Not to mention that entering each transaction into wxBanker makes spending money with debit/credit cards more tangible and can help keep your spending in check. You can also keep track of "virtual accounts" like loans to/from friends, accounts receivable/payable, and allocate funds for specific purchases like a new computer.

You can also search your transactions to see how much you have spent in specific areas, and see a graph of your balance over time. Check out the screenshots below:





If you find GnuCash too complex for your purposes and decide to take control of your finances with wxBanker, let me know what you think! In Ubuntu you should only need to install python-wxgtk2.8 and python-numpy. Project page: https://launchpad.net/wxbanker.

Tuesday, September 30, 2008

All Dell Minis Available with Ubuntu!

I just checked out the Dell website (US) and noticed that all the Dell Inspiron Minis can now be configured with Ubuntu, and for $40 cheaper than the same Windows setup! Previously you could take the base Ubuntu system and increase the specs to match the other Windows configurations, but you would miss out on the "Instant Savings", which could save you up to $40. Now you can not only get the Instant Savings, but you save another $40 just for choosing Ubuntu.


This is just another demonstration of Dell's commitment to open source. If anyone is reading this outside of the US, let us know in the comments if you have similar options. Also, I'd love to hear from anyone who has one of these Minis, or any other Dell with pre-installed Ubuntu for that matter. What do you think?

UPDATE: From what I am reading in the comments, it sounds like the US is the only place (currently) where the Ubuntu Minis are $40 cheaper than an identical Windows XP configuration. Perhaps other places will follow soon.

Also, I didn't notice before but the second model in the picture is only $10 more than the base one after the Ubuntu discount, which means you can double your 4GB SSD to 8GB for only 10 bucks! It is hard to imagine anyone buying the base model in the US, unless someone simply doesn't notice.

Finally, if you are going to snatch one, don't forget to log in through http://www.dell.com/eppbuy if you are a student or otherwise qualify, to get 2% off. In the aforementioned middle $359 setup, this knocks a few bucks off the total bringing it to $351.82 for the 8GB setup.