So, I’m still working on the locale kit. Here are some things I did since last time :
Hello readers !
Last week we were at the RMLL (Libre Software Meeting) in France, with François (mmu_man) and Olivier (oco). Haiku has beed holding a booth and giving some talks in this conference for some years now, and it’s nice to go and meet people again.
Hello readers !
As you know, I’m currently working on the locale kit to bring it to a more polished state. The work is going well, and it’s about time for a status update. I’ve been quite busy at school for the whole year and committed few time to Haiku, so I’m catching up with a lot of things.
As you know, I worked last year as a GSoC student on the Locale Kit. Unfortunately, I had to get back to school in september and had not much free time to spend on Haiku. I attended the coding sprint at BeGeistert, but my laptop fan died while I was there and forced me to run my cpu at 800MHz, which was quite painful for coding.
This blog post talks about the changes that have been hapenning in recent versions of others Operating Systems, and wether Haiku should copy them or not.
GSoC is now over. It was quite fun to work with Haiku this summer, I learnt a lot of things, I gained commit access, and soon I’ll have a new TShirt to wear :)
After the alpha release, the locale kit was merged back into the trunk. Of course, as soon as this was done I got flooded with bug reports, ranging from build breakage on freebsd to lack of grist in the jamfiles making the catalogs mix up between apps. As far as I know, both of these are now fixed, but there is still a problem when building from Dano and the bluetooth preflet doesn’t want to be localized.
The end of GSoC is in less than two weeks now, so it's time to clean things up and get what I started working. I spent the previous week reading ICU documentation to understand how it worked, and this week I used this information to build the locale preflet.
This is not as simple as it looks. First, I had no experience of programming with the Interface kit so I had to learn how things worked.
Locale Kit Interfacing with ICU
This week two important things happened for my GSoC project: I got commit access to Haiku and I finished working on the catalog part. This mean I can now work more efficiently without having to send my patches trough the GSoC mailing list (you may have noticed I still need my code to be reviewed, however :/).
The catalogs allow strings in an application to be translated. At a first glance you may think this is the only needed thing in a Locale Kit and my work is finished, but it is not the case. The first missing part is the preflet allowing you to select your favorite language. The locale kit will now always try French, if not found default to German, then finally to English. I think this is not the setup most of you want to use.
This week I was at the RMLL in Nantes, and I was busy showing Haiku to other people and explaining them why it was so much better than linux. I had little time for GSoC coding.
Still, I made some cleanup and fixed some small bugs. The catalog part of the locale kit is now working fine and can be used to internationalize applications.
Here is a small guide for those who want to get an application speaking in their own language.
You have to alter your source code to get it working. We've tried to make this need as little changes as possible. First, you have to #include two files : Catalog.h and Locale.h. They are system headers from the locale kit. Now you have to tell the locale kit to initialize a catalog for you. A catalog is a class that you will use to map strings to their translated equivalents. The locale kit will automatically find the right data files for you, depending on the system-wide language preferences, you application mime signature, and some other magic (see the part of this post about the build system changes). So, you only have to add two lines of code:
This week i’ve been working on a big red post-it that was on last week’s picture. It was about wo things : make the catalog handling tools work as build tools, and test them in some special cases.
The first part took me almost the whole week. I started doing a full port of the locale kit, but noticed it would probably be too complex to do that. Instead, I started over with a simpler solution.