Archive for January, 2007

AMO Preview Updates

Thursday, January 18th, 2007

A new round of updates have been pushed to the preview site, including:

  • Added a user’s information page
  • Added breadcrumbs and a search box to every page
  • Added the plugins page, linked to from the navigation menu
  • Polished some rough edges, including:
    • Using ngettext() for pluralization
    • Added friendlier messages (eg. when a new user registers)
    • Attempts to guess a users language from their browser headers
  • There is a full list of feedback we’ve addressed on the wiki

Thanks for all your comments. Your ideas and suggestions help us to prioritize what changes will be in our next release. Please put any new input on our feedback page or in a comment here.

Teaching CakePHP to be Multilingual (part 1)

Wednesday, January 17th, 2007

The international community is an essential part of Firefox. Whether it’s coming up with ideas, writing code, or just using the browser every day, Firefox is influenced by people around the globe. In an effort to embrace this relationship we decided that Remora, the next version of addons.mozilla.org, should be localizable. I see that Mike shaver published the first in a series of articles on how volunteers could localize AMO3 into different language already. I’d like to build off the definitions he provided, but get into the coding and integration with CakePHP aspect a little bit more.

Since the technical complexity is such a broad topic, I’ve divided the subject into a few sections which I’ll post separately. The rest of this post will focus on what the end goal was and what our plan of attack was. The second will cover localizing static content, and the third, dynamic content.

To add to Mike’s descriptions, when I write “static content”, I’m referring to strings on the page, like “Home”, “About”, or the “Search” button at the top of this page. These are strings that are actually in the template files. Dynamic content refers to information coming from a database, like authors, descriptions and titles. They both produce the same effect for a visitor (a localized page), but they take very different paths to get there.

When looking at localization options, we had three main goals: speed, robustness, and friendliness. The site we’re replacing is getting several hundred hits per second, so our solution had to be fast, but we also wanted something tried and true that wouldn’t break down or trip over itself. The last goal, friendliness, refers to a low barrier of entry for localizers. Whatever we give a localizer has to be simple to use.

Anyone who has searched for the answer to an i18n or l10n question knows there is always more than one way to reach their goal. The, now defunct[1], CakePHP wiki used to offer two tutorials for handling i18n.

For static content, the i18n tutorial used separate template files (.thtml) for each language, which can become awkward to maintain and can be difficult for localizers to translate if they aren’t familiar with HTML and PHP markup. When editing large pieces of text it can be important for a localizer to be able to add additional formatting, however, our pages consist of many short strings, mainly titles and navigation elements. We didn’t feel the additional complexity would benefit the project.

The i18nv2 tutorial leverages the PEAR::Translation2 package for dynamic content. This appeared promising at first, but we realized it couldn’t support the relationships we were planning. Translation2 uses two keys to lookup a value. A rough example would be that you can lookup an item (value 1) from a category (value 2). We actually needed a three key lookup, eg. getting a specific parameter (value 1) from an item (value 2) in a category (value 3).

The CakePHP tutorials point in the right direction, and will work for many sites, but they didn’t quite fit with Remora. I’ll dig into our implementation for localizing static content in the next post.

As a quick reminder, all of the source code in the Remora project is viewable in our SVN Repository.

[1] At the time of original writing, the CakePHP wiki was still available online. The dead links have been removed from this post.

What can Airbag do for you?

Thursday, January 11th, 2007

Airbag is an open-source multi-platform crash reporting system that will replace Talkback as Mozilla’s crash reporting tool in Firefox 3. Ben Smedberg has talked about why this is oh-so-cool, and a lot of people are excited about replacing Talkback.

But setting up the client side of things is half the battle. Our next challenge is setting up a server system than can receive, store and display the data that Airbag collects.

Ted Mielczarek (luser on IRC) and volunteers at Seneca College have been blazing trails (of hot code!) in both of these areas. They have worked on a web interface (among other things) based on Airbag and it’s really exciting to see things taking shape.

Ted and I set up an Airbag wiki page to document Mozilla’s implementation of Airbag. In the coming weeks we will be gathering ideas for our Airbag web tool and forming a better list of requirements.

We’re excited to hear what you think. Please leave a comment or add some ideas to the wiki. This will help us get the most out of Airbag so we can improve Firefox and other Mozilla applications. We’re looking for some answers to questions like:

Thanks!

AMO Preview Updates

Tuesday, January 9th, 2007

Since we launched the AMO 3.0 preview last week, we’ve been busy reading feedback and implementing fixes.

Here is a brief list of changes that have been merged into the alpha since last week:

  • A reorganized front page
  • New static content translations including French, Japanese, and Korean
  • Added the “Search Engines” page, linked from the right-hand menu
  • Fixed some of the unfriendly error pages (including a new 404 page)
  • And many more fixes from our feedback page

Thanks for all the comments and bugs you’ve filed so far. If you’ve got more ideas or changes you’d like made, now is the time to let us know.

Localizing AMO3 (part 1: overview and static)

Wednesday, January 3rd, 2007

As morgamic mentioned, we’re very excited about finally being able to provide a great add-ons experience in more than just English. (Don’t get me wrong, I love English, but there are other great languages as well.)

There are three major parts to localization in the “Remora” code base:

  • Localization of static web content. These are the sorts of things that you would find hard-coded into markup in the current site, and includes the text of links to different sections of the site, error messages, and help text. We’re using gettext for this, and performing the translation should hopefully be pretty straightforward.
  • Localization of dynamic site content. Right now, this is pretty much only the names and descriptions of categories, but will likely grow a bit to include other kinds of database-driven site-wide text that users see. (There are a few more examples right now on the admin and reviewer side as well.) We don’t have good tools for this today, but there are few enough entries in need of this sort of translation that we can probably manage with manual entry by an admin for a while.
  • Localization of user and developer content. Add-on descriptions, screen shots and their captions, review text, version notes, that sort of thing. This localized data is managed by the site users themselves, so localizers shouldn’t need to do anything special to accomodate it. (It’s possible, perhaps even likely, that localizers will want to help authors get localized descriptions of their add-ons, but that’s another discussion entirely.)

This post is about the process for doing the first part of the localization (static gettext translation) of Remora. Hopefully it’ll be quite straightforward, especially for people who already have experience with gettext-based localization. There are currently a little fewer than 500 strings to localize, but only about 300 of them affect the public site.

(If you’re the sort of person who can set up a moderately-complex PHP application, then you might want to follow the installation instructions to set up your very own Remora, but that isn’t strictly necessary for localizing the site.)

First, you should learn a language other than English. We can’t provide assistance with this step, unfortunately.

With that out of the way, you’ll want to get a copy of the English gettext “po” file. You can find the trunk version of it here. That file will be updated live with our development, so we might end up wanting to have localizers follow tags, but for now we want to let people stay as up-to-date as they’re willing, and we don’t expect a ton of changes to the public-facing strings before we deploy Remora.

You can translate that file by hand, or there are various tools to make it easier. Wikipedia has some details here, though you won’t have to compile things to “mo” format.

Note: this file contains all the strings for the site, including those for the admin/reviewer/developer parts. The strings for those parts of the site are not frozen yet, so translating them at this point will likely be a bit of a waste, since they’ll need to be revisited in the nearish future. We recommend that translators only bother with msgids that are a “key”, like “user_form_firstname”, and skip the ones that use English text as their msgids, like “Back to Review”. As strings become more frozen, they’ll be converted to use the key form.

Once you have a translation complete, you should take the .po file and attach it to a bug filed against the Public Pages component of addons.mozilla.org. The summary of your bug should be of the form “gettext for AMO (your-locale-here)” — please look for an existing bug beforehand, ideally before starting your work! If you haven’t been active in localization of Mozilla products before, you should probably try to connect with the existing localization community for your locale of choice, to avoid duplication of effort and to help you get up to speed.

(We’re going to be working with the localization leads to figure out how to best manage “module ownership” of different site localizations, so this process may change in the near future. We appreciate your patience in this matter!)

So, to summarize:

  1. Check to make sure that nobody has already done the localization that you’re interested in!
  2. Get the English string file to start from.
  3. Translate the msgids with names_like_this into your language.
  4. Attach the resulting “messages.po” file to a new bug.

As implied by the title of this post, there will be other posts to come on localizing other elements of AMO, but the static part should give people a great start on giving us an add-ons site that better reflects the global nature of the Mozilla community.

AMO 3.0 Alpha - Public Preview

Tuesday, January 2nd, 2007

We are excited to announce the release of a public preview of the next addons.mozilla.org. Our goal is to help Firefox improve the way people use the web. We recognize the important of add-ons and how they contribute to one of Firefox’s strong points — customizability.

Why a Rewrite?

This August we set out to rewrite the existing site in order to replace some outdated code and functionality. Some major features like localization required a rewrite, while other issues such as database structure and extensibility needed to be addressed as well.

For more about our design process and the inner workings of the site, please see our project wiki page where we discuss a lot of the challenges we faced.

New Features

Highlights:

  • Site content l10n using gettext
  • Database-driven dynamic l10n for user-submitted content
  • Better review system
  • Threaded discussion forums to help developers and users support their extensions
  • Unified login — one login for both developer and public tools
  • Better search with proper weighting
  • Site-wide unit and web tests to ensure site quality

A Look Ahead

We are most proud to say that we are going to offer the new site in a variety of languages. In the coming weeks we will be working with contributors from around the world to help us translate the new site. We would like to see addons.mozilla.org translated into every locale Firefox currently ships in.

Justin Scott (fligtar) has been cooking up some awesome developer tools to make developing and submitting add-ons a much better experience. One of the cool tools he has created allows users to actually open an add-on and explore its code directly from a webpage. Check back later for an update on the developer tools.

As a part of the developer tools rewrite, we are revamping the review process. The way add-ons get submitted and reviewed will be more streamlined and will ensure that only cool (and safe!) add-ons get the spotlight. The new process discussed briefly on Justin’s blog will also lighten the load on our reviewer volunteers and prevent delays for submissions.

Tell Us What You Think

As we are in alpha, we would like to hear what you think so we can make improvements. If you find a bug or just want to make a general comment, please post it here or on the consolidated wiki page, and we will follow-up on them. Please note that all of the information in the alpha is reset every 8 minutes.

We look forward to hearing what you think!