Mozilla team and Ubuntu Hardy Heron

This is the first post on the new domain, so I would like to make it a bit special :).

Hardy Heron will be released in five days, and Ubuntu’s Mozilla team has been quite busy preparing all the goodies. So, what has Mozilla team done?

www.ubuntu.com in Firefox 3 beta 5

Firefox 3 beta 5 is in the official repositories. It replaces the old Firefox 2, which can still be installed from the repositories. It is a pity that Firefox 3 release candidate is coming out few days after Hardy, but Firefox 3 beta 5 is very useful and pretty stable for day-to-day use. Just look at the reviews. And I’m sure we’ll be able to install Firefox 3 as soon as it comes out from Fabien Tassin’s Personal Package Archive.

Also, many members have been testing, editing and packaging Firefox 3 (and upgraded some of Firefox2) extensions for Ubuntu, so this release brings more of them than before. Currently, around 30 extensions are in the repositories. The work is still in progress, so expect more. If you would like to see your favourite extensions, feel free to suggest them at Firefox 3 extensions wiki. Ubufox extension makes it easy to install other extensions. Start it from Tools -> Add-ons -> Get Ubuntu extensions.

Get Ubuntu extensions

Prism, which allows to users to move webapps to their desktop, is also in the repositories. Be sure to check it out.

And, if you feel like living on the wild side, you can test Thunderbird 3 alpha from Fabien’s Personal Package Archive. No links, since this can be very dangerous. You have been warned :).

Congrats to the whole Mozilla team, and to the Ubuntu community :).

Tags: , , , , ,

getString/getFormattedString in JS and XUL

I’ve been working on one Firefox extension lately. As with most of the them, there was a need to work with strings :). It had the stringbundleset, with defined stringbundles. We also needed a getString and getFormattedString (gS/gFS) functions for the class. Well, it seemed easy enough: try to fetch from the first bundle, check if the string is null, if it is, try to fetch from the second bundle (got used to C++ :))…

I’ve looked up on the Internet to see what does stringbundle’s gS/gFS returns. Their definition can be found at MDC’s page on stringbundles. Unluckily, there’s no info what happens if a string is not found. Luckily, MDC’s tutorial on property file says that gS/gFS returns null in that case. I tried that and it didn’t work. It would just throw an exception.

So, I searched through the code to see if there’s some other gS/gFS (which I should have done in the start). There was one other class that had them. No “if (!string)” testing, but catching an exception :). If you bumped upon this problem, here’s an example of the solution:

[sourcecode language='jscript']var result;
try {
  result = document.getElementById(stringBundleFirst).getString(key);
}
catch (e) {
  result = document.getElementById(stringBundleSecond).getString(key);
}
return result;[/sourcecode]

Happy coding :).

Tags: , , , , ,