Categories
main mozilla tech

Express Mozilla

Recently I asked Mozilla for new set of business cards. The overall concept of paper cards you give to people is becoming less appealing and I definitely like the “google me” approach, not only because that’s what we really do to find someone, but also because it expresses Google’s vision and theme.

Since I was able to choose the back of the card, I started wondering… How to express Mozilla theme? How to express Mozilla?

After a few hours of trying and failing to produce anything that would even remotely give me the feeling, I went to Mark Surman’s blog for inspiration and found his blog post about visualizing Mozilla in one sentence with wordle. *Click*

Then it went fast. Took similar approach, copied all comments with suggestions, sorted them, gave to wordle which produced this. From there, I used Gimp to resize it and boom, done. Let me know what you think 🙂

Business card - front
Gandalf's business card - front

Business card - back
Gandalf's business card - back

Categories
main mozilla tech

AMO loses accent

Since the beginning of times, AMO has been using unique localization format codenamed as “monopo”. It bases on gettext, but instead of using string in source language as an ID:

msgid "What's your name?"
msgstr "¿Cómo te llamas?"

it uses a unique identifier as an ID and lists places where the entity is used in a comment above it:

#: views/addons/policy.thtml:78 views/addons/policy.thtml:79
msgid "test_whats_name"
msgstr "¿Cómo te llamas?"

This customization makes the PO file work very differently. You cannot localize using your po file only – you don’t know the source string you’re translating, so you need to have en-US file and your file and compare them. But the greater issue is an incompatibility of such format with most Gettext tools and libraries.

Gettext is probably the most popular localization format in the open source world. In result, over years, huge number of localization tools, libraries and API’s to languages has been created in order to simplify and support localization efforts. Due to the po->monopo switch AMO localizers were limited in their choice and even internally, AMO equivalents of get_entity function (named ___() and n___() for plurals) were pretty complex.

What once served us well, was not the choice we wanted to keep forever and by the power of bugzilla I have been assigned to challenge the status quo.

At the beginning there was darkness and lightning, all across the Earth… ekhm, not this one.

This hydra had four heads and all of them had to be attacked simultaneously in order to minimize the SNAFU window while in transition:

  1. AMO localization code has been crafted to work with monopo
  2. AMO templates and code has been calling for entities by the unique id – ___(‘test_whats_name’) instead of ___(‘What’s your name’)
  3. AMO localization files were written using the monopo syntax
  4. Our toolchain (like export-po.py or Verbatim) was customized to work with monopo

Wrt. the format, we decided to switch to normal gettext and keep context where needed (for example when there are multiply strings with the same english name – in order to avoid duplication).

On the 6th of August I had the weapons ready and Wil Clouser decided to make the switch before the next AMO release giving us little but 3 days to switch. Brave man he is.

We did the switch and on the 13th od August the first battle was called. We won on all fronts except the templates switch which against the plan happened to remove context reference from the function call.

In result in a few places where we kept the context we did not ask for it. So instead of ___(‘What’s your name?’, ‘test_whats_name’) we had only ___(‘What’s your name?’). This call did not work because in the .po file we had both, context and ID (and we cannot get the ID without a context in such case).

Yesterday I finished crafting a new weapon to fix this. The plan was to take en_US po file, iterate through all templates and PHP files in AMO code and check if the entity ID matches one from en_US po file and if the po file entity has context. If this is the case, then replace the function call with a new one containing context.

The only remaining issue was that what we tried to fix were the cases in our entity pool that had multiply ID’s identified by context only. And in this case we were using ID to match entity from PO file with an entity from the code. How do we know if we matched the right entity?

Consider the following case. We have an entity with id “Recover your password”. It may be a window title, a link to a recovery tool or title of an email. It may be translated differently depending on the context (and it would be translated differently in Polish) so we want to have multiple entities here. Since Gettext uses english string as an ID we cannot have 3 entities with the same ID so we need to add what’s called msgctxt. It looks like this:

msgctxt "email_title"
msgid "Recover your password"
msgstr "Odzyskaj hasło"

msgctxt "tools_link"
msgid "Recover your password"
msgstr "Odzyskiwanie hasła"

Now, in the broken template file we have ___(‘Recover your password’) and we need to match it to one of the entities to replace it with ___(‘Recover your password’, ‘tools_link’). But how do we get the right entity?

Fortunately, we were storing source comments for each entity which gave us a list of template files in which the entity has been used. And we preserved this while transiting. It looked like this:

#: views/addons/policy.thtml:78 views/addons/email.thtml:19
msgctxt "email_title"
msgid "Recover your password"
msgstr "Odzyskaj hasło"
#: views/addons/menu.thtml:28 views/addons/layout.thtml:79
msgctxt "tools_link"
msgid "Recover your password"
msgstr "Odzyskiwanie hasła

Now, we just took the comment, extracted files from it and made sure that the template file we’re fixing is on the list of files extracted from the comment. If it did, we’re using the right entity. If not, try the next one.

With this script in hand, last night we did the final switch, marked the bug as fixed and are open for last commits before the new AMO release!

The whole thing was possible thanks to L10n-drivers team and Addons team cooperation and Wil Clouser’s decision not to hit the nail on the head. Since today, AMO is a quite canonical gettext project 🙂

What’s next?

We’ll now work on tools (like extract-po.py) to regain the ability to narrow localization sections. Previously one could use the ID to find out which entities are from statistics or editor sections and deprioritize them. Now we’ll try to give him that info while extracting entities.

Categories
main mozilla tech

MCS – round two

Over the last quarter of 2008 and somewhere into first months of 2009 I was working on the project called Mozilla Community Sites. We got a lot at the time, with initial implementations for several products, the Theme, Logo, style guidelines and the whole concept that was originally introduced by Pascal Chevrel and me in 2004 really took off.

Then, at some point I had to call it a release and switch to other tasks, while MCS was waiting there for people to pick it up and use. From the very early days of the project, I knew it’s one of the projects that has to be maintained by the community of its users and upstreaming patches people make while deploying will set the speed of the project. In the end, we have to use the work to understand what’s most important and I’m personally maintaining only one community website – wiki.aviary.pl, so I can’t be the only driving force.

Over a few months we saw a lot of experimentation with MCS, and there are at least 10-15 sites that are using some aspects of the project (for example Mozilla Lietuvoje, Mozilla Argentina or Mozilla Srbija) and people started approaching me and sending patches, asking for bug fixes, features and plans. I would like to especially thank Tomer, Jesper, Guillermo and RQ.

Unfortunately, until now, I really failed to find time to push MCS further, and I feel like I was blocking it by being an inactive owner of the project. Things are slowly changing as RQ started pushing patches to the repo, Jesper and Topal started working on their sites working around me, Tomer suggesting to start a community group forum for MCS and me wrapping up my other projects to have a clean slate to work on MCS once again, this time, collaborating in a group! Yay! 🙂

So, I’d like to thank everyone involved in this project and apologize for not being able to be active when it was needed, and I’ll do my best to make myself and the project back on tracks. Rimas committing patches and Jesper getting an HG account is a solid first step. I want to start a group project for MCS next week, and I hope we’ll have more people joining the project now. In the time of EU MozCamp, we should have a lot of exciting things done here 🙂

Categories
main mozilla tech

Silme 0.5.1 released

3 weeks after Silme 0.5 release, we’re proud to announce the first minor update to Silme – 0.5.1.

Silme 0.5.1 carries 5 changes, each of them making it a little better. In particular it fixes bugs that were blocking Adrian Kalla‘s version of compare-locales to get its first release.

So, what’s new in 0.5.1?

  • New method: silme.diff.EntityList.has_entity() should make testing entities in diff faster
  • Two bugs in silme.io.jar that made it impossible to use
  • Performance improvements in silme.io.jar.get_package() (can we upload silme script to Fastest Firefox? ;)) by just ignoring to load zip entries for directories
  • We don’t close ZIP file in get_package if we didn’t open it there. It was a bug that caused silme.io.jar to fail with subpackages
  • Major rework of URI schema accepted in silme.io.jar. It is now possible to do:
    ioc = silme.io.Manager.get('jar')
    l10npack = ioc.get_package('jar:chrome/package.jar!locale/ab-CD/package')

This is the very first minor release in the history of Silme projects, and we’re happy to make it!

You can download it from HG repository or use pypi for silme0.5.1.

I’d like to thank Adrian who helped by identifying bugs and writing patches for this release. You may also want to check his newest project which uses Silme to create a sleek localization extension for Komodo! It’s called Koala 🙂

Next in line is Silme 0.7 which will bring new features and optimizations and we’re planning an alpha release to happen early next week. If you’re interested in hacking localization related code and never tried silme, it may be a good moment to give it a try and help us on the way to 0.7 🙂

Categories
main mozilla tech

Slides from eLiberatica 09 talk

Today I had a pleasure to give a talk at eLiberatica 09.

It was one of the most complex and most challenging talks I ever had to give. It was about the Mozilla. It was about who we are, and how we try to describe ourselves. About how we think of ourselves and the challenges we face.

The rationale for doing such talk is to do what we have to – to over-communicate. To manifest ourselves and explain ourselves to people who care about the web. To rephrase some questions that people pose – about the goals, about how to measure a success, about how to make sure we stay meaningful while staying true to our mission.

Explaining Mozilla and explaining the kind of semantic space in which we brainstorm these days is an extremely complex goal. It’s harder than speaking about new experiments and features that we work on. It’s even slightly against what people want to hear about. But I believe it’s vitally important. We have to express ourselves and explain ourselves and I decided to give it a try at eLiberatica.

Bonus points goes for the fact that I wasn’t speaking in my native language, and also the audience listen to such a complex talk in a foreign language.

Despite all of that, I believe it went well. I feel thankful that people bared with me through all those topics, and I hope the deck may be useful for other speakers willing to mix and mesh it 🙂

I definitely recommend a keynote version for the best experience, but pdf dump provided for those who don’t use keynote:

Categories
main mozilla tech

Silme 0.5 now at easy_install

Adrian Kalla added Silme 0.5 to pypi repository so that you can download it and build dependencies in the python style.

It can’t get any simpler than:

easy_install silme

Also, if you missed it (I know you did), here comes the very first documentation. It comes out of doxygen (which is probably the best of the worst choices for python docs) but it works and it’s there for your convenience. 🙂

If you happen to be a master of doxygen and you know how to make it work better, contact me pls!

Categories
main mozilla tech

MCT: Style guide

It’s been a while since the last update on MCS but things were moving on and it’s time to catch up with the progress in the project.

picture-1Description

Today, I’d like to introduce you to a new Mozilla Community Theme style guide. MCT Style Guide is a document that explains the design decisions made by the theme authors that allows people who use the theme to extend it following the original concepts and keeping their new elements in sync with original one.

Rationale

Mozilla Community Theme was created to give us a fresh theme that can make it easier for communities to set up a professionally looking website without having to look for a designer or crafting something on their own. Three months after the release, MCS is becoming a popular option among opicture-2ur communities when they’re making their choices with regard to the website. We like to think that the reason is because we offered maximum freedom and flexibility with this set, letting people do what they want, while providing high quality of the design itself.

One element that we did not cover very well until today, was how to extend the theme. How to move forward. Not only modify what we gave you, but also add new elements, theme new websites, or T-shirts, or posters… That’s where the Style Guide hits.

Style Guide

Style Guide is a short book that presents the concept choices together with list of modification options that, in the theme author’s opinion, will match the theme and let you keep the unified look and feel no matter where you’ll go.picture-3

What’s exciting about it, is that it opens communities to a new level where they have all the tools and resources that usually professional web agencies have and they can develop their skills and get accustomed to the new concepts. While working on our hobbies, we’re getting real experience that translates directly into our portfolio.

 
 

picture-5This Style Guide lets you dig into:

  • color palettes
  • typography decisions
  • layout and grid models
  • branding options
  • methods of preserving space and light between text blocks that influences readability of the text
  • texture options that influence how the website looks
  • and others…

picture-4We hand this to you, so that you can experiment and develop the theme further or just customize it to your needs. What’s really important and exciting is that as all other parts of this project, the style guide is open! You can download Indesign document or editable PDF document and hack the Style Guide itself.

I’d also like to use this moment to thank Tara Shahian and Seth Bindernagel who have worked together with the theme authors on this 1.0 release of the guide. 🙂

So, grab it here and… we’re accepting patches 🙂

Categories
main mozilla tech

Silme 0.5 released

silme logoProjects need releases. It’s important. It’s like a birthday for a project – they get a milestone to mark the progress.
On the other hand we have developers. They need unlimited time and no deadlines. When one meet another, we have an interesting arm-wrestling battle between those two, but ultimately one has to obey to the Oath of the Bazaar, if you know what I mean.

Release

So, here we are, Silme was asking for a release for long enough and I postponed it over and over so it’s time to make the cut. Today, I’m proud to announce the very first official release of Silme – python l10n library. Silme has been announced to mozilla.dev.l10n long time ago, and since then it has been continuously developed in a small, but quite interesting project structure with support from Adrian Kalla, Stefan Plewako, Ricardo Palomares, Staś Małolepszy and management guidance from Seth Bindernagel.

It’s very, very hard to explain Silme concept to those who never tried to work on localization development.

Let me try: It’s like a DOM API for localization.

Works? Probably not… Well. Let me try the descriptive way. Silme is a toolset for a developer who wants to work on localization tools. It can read localization files, it can write them, it can modify them, it can search through them, it can process them, merge, split, localize and help you get some statistics out of the localization files. It probably can juggle them, although support for this is rather experimental.

Categories
main mozilla

Aviary.pl meeting in Cracow T=-04:00

349304929_f05d0627e7In for hours (approximately) I should be in Cracow together with 14 other members of Aviary.pl team celebrating next successful year for the team and historical moment for one of the projects we localize – Mozilla Firefox became a market leader according to Gemius (and today has ~46.6% of market share).

We’re going to talk about the past, present and the future, vote for a team leader, plan Ultimate Tech Dictionary (called “Godzenie Wody z Ogniem”) and discuss opportunities for improving our day-to-day operations.

You can find more info at wiki.aviary.pl, and photos from past all-hands on flickr.

Categories
main mozilla tech

Reroute to FOSDEM

Yesterday, after horrible 19 hours of flight (plus 3 hours of ferry from Victoria to Vancouver) I landed in Warsaw.

Now, I’m wrapping up to get on the plane to Brussels for FOSDEM 09!

If all goes well I should regain control over myself from Mr. JetLag soon. Right in time for the most exciting event in the year. I can’t wait for Mark’s keynote! 🙂