Categories
main mozilla tech

The world stands on its head

Unrelated opening
Every one of us has those moments when you find yourself old. Even teenagers do, when their younger friends teach them how to use the latest hype du jour on the Internet. I, for one, feel profanely old today, and kind of hardly accepting the reality of the approaching “middle age” thing.

“It’s rare that you see an artist in his 30s or 40s able to really contribute something amazing.” said Steve Jobs. Thanks Steve…

But that was not supposed to be about me becoming 26. It was supposed to be about another miracle that nobody expected to ever happen. Or at least, I’m still genuinely surprised whenever I see the dream of yesterday becoming reality of today.

So, maybe for many of you it will not come as anything striking, kind of  “yea, Poland has always had good community and Firefox market share is above average”, but for me it’s an impossible coming real.


Down to the point
Ranking.pl just published another round of their browser stats for Poland. According to those, Chrome just passed 3% of market share in Poland. It is a real deal. I remember Firefox having 3% – in December 2004, month after 1.0 release, after 6 years of work, Mozilla based browser reached 3% of market share. But that’s not only that! Opera just week ago gained a point and reached 10% of market share in Poland! I remember it – May 2005 – Firefox 1.x at 10.2%.

And having that, we have also Firefox breaking 52% of market share in Poland! 52% is the high and it is clearly an outstanding result that heavily influences the way we should think about Internet in Poland. It’s an amazing award from the users to the Mozilla project and, especially, a group of people in the Aviary.pl team and those working on Mozillapl.org community forum.

In result of all of this, Internet Explorer in Poland, the one web browser that dictated, for over 10 years, how the web looks like, ten years in which the Internet has been shaping up, this web browser has now only 33.38% of market share. One third. Vox populi at its best.

We have 2/3 of users using modern web browsers, and if we add IE8 here, it gets to 3/4, 75% of users. IE6 is used by less than 9% of users and it means that, for example, just by watching the stats, companies will do better by investing in making sure their website works with Opera than checking it in IE6!

Hard to express this feeling. It’s amazing that we can see modern browsers not cannibalizing each other, but sharing the market share gains.

Wake up, revisit the web today, it’s party time!
Think of what’s possible because of that. We have the Web today that means something different for the users and web authors. They can slowly start to ignore IE6, and that is a real deal for everyone who does the web hacking. Users can utilize the powerful webtools, banks can invest in reach online banking, people are also free to choose their operating system because their online experience wont degrade because of that. People can choose out of four major web browsers that are in a healthy competition or they can choose from one of the less mainstream, but still high quality ones like K-Meleon, Camino, Seamonkey, Arora, Epiphany… Over 52% of Polish internet users can change how the websites look via extensions, and how their browser works and what they see via adblocks, flashblocks and others. They can influence their experience and by vast majority they chose their web browser by themselves, understanding what they are doing and knowing that they have a choice now.

I’m pretty sure that this is true not only for Poland, but for other countries. Hungary, where Firefox is at 52%. Latvia with Firefox at 50%,  Bulgaria, where Firefox is above 45% and just passing by IE. Ukraine where Opera has 34% and Firefox has 26%… and I’m still talking about just one region, while the rest of Europe is going through the similar process.

Five years after Firefox 1.0 has been released, we have a different web. The web which has new challenges and opportunities. We have to raise to them and I believe that the next 5 years is going to be super exciting!

Categories
main mozilla tech

Silme is getting ready for 1.0

Not today, maybe not tomorrow, but Silme library is getting ready for its prime time.

I’m currently working on Silme 0.9 which is shaping up to be a release where we packed up all the lessons we learned while working on the project for the last year and a half. It’s going to be the last release with non-frozen API before 1.0 so we have to be sure we’re happy with 0.9 before we release it.

Then, we’ll have Silme 1.0 which is a goo moment to revisit the name of the library. I know native english speakers may find it a good idea 😉

Categories
main mozilla tech

Update on Verbatim

Just a short note. After getting a very positive feedback in Prague on the Verbatim project, and fairly negative on its performance, I spent some time making it faster and snappier and got it to the point when I believe this problem is mitigated and we can push Pootle Verbatim’s incarnation to production.

So what’s going on right now?

We’re working with the IT team to get a new virtual machine with its own public vhost (you can track the progress in bug 523920). This should happen very soon and once we’re there, we’ll let you know and start using Verbatim to help you manage website localization.

Categories
main mozilla tech

MiniOpenWebCamp in Prague :)

As a part of the Mozilla DevDay in Prague this Friday we will hold a Mini Open Web Camp at the afternoon.

Drumbeat img by Mark Surman

The idea is to use the energy of DevDay participants to get their feedback on the major issues we’re currently addressing with Mozilla project.

We have a room booked, and we hope to attract all algorithmically impaired people (the others will probably go to Mozilla Labs Hack Session) to join us for a two hour brainstorm.

The formula may change, but currently we’re planning to set a list of topics and go over them with Mark Surman (ED in Mozilla Foundation) and Tristan Nitot (President of Mozilla Europe) igniting each of them by having a short conversation in front of the public. At some point, we’re turning it into a round table and invite participants to share their views and address the concerns.

The meeting will probably be small enough to gain an atmosphere of teamwork and I hope it’ll be a great journey over the current challenges of the Internet and an opportunity to make an impact on how those might be solved!

Please, do not hesitate to register, and join us there 🙂

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 po polsku tech

Zmiana rozmiaru zdjęcia z uwzględnieniem zawartości

Poniższy tekst jest tłumaczeniem artykułu “Content aware image resizing“, zamieszczonego na stronie hacks.mozilla.org na licencji Creative Commons Attribution 3.0 United States License. Autorem tekstu jest Christopher Blizzard. Spis wszystkich tłumaczeń artykułów z hacks.mozilla.org dostępny jest na stronach wiki.aviary.pl.

Obejrzyj demo w Firefox 3.5.

200px-nasa-cairZmiana rozmiaru obrazka z uwzględnieniem zawartości jest metodą skalowania obrazka bez zniekształcania zawartości, innymi słowy: nielinearne rozszeranie obrazków. Algorytm ten został po raz pierwszy opisany przez Shai Avidan i Ariela Shamira i opublikowany w 2007 (“Seam Carving for Content-Aware Image Resizing.”)

Od tego czasu powstało kilka świetnych implementacji tego algorytmu dostępnych na licencjach wolnego oprogramowania takich jak wtyczka do Gimpa czy CAIR – aplikacja napisana w C++.

Teraz, dzięki Canvas i językowi JavaScript możliwe jest wykonanie tego w przeglądarce bez użycia wtyczki.

Od wersji 1.5, Firefox oferuje możliwość manipulacji bitmapą z poziomu API Canvas. Wersja 3.5 nie tylko wprowadza jeszcze szybszy silnik JavaScript, ale też dodaje nową metodę dla Canvas – createImageData – umożliwiając tworzenie nowych rozwiązań.

Na potrzeby tego dema został zaimplementowany fragment algorytmu do zmiany rozmiaru obrazka z uwzględnieniem zawartości. Szerokość zdjęcia może byc zmieniana dynamicznie bez zmiany jego wysokości. Ta implementacja korzysta z wykrawania szwów (seam carving) do zmiany rozmiary obrazka, śledząc mało widoczne pionowe linie.
200px-cair-stepsJest to cztero-krokowy algorytm zagnieżdzony. Jedna iteracja zmienia rozmiar obrazka o jeden piksel. Na początek obrazek jest pobierany do kontekstu Canvas, a następnie rozpoczyna się iteracja:

  1. Zdjęcie jest przeliczane do skali szarości
  2. Obliczane są krawędzie na zdjęciu (Użyty jest algorytm o nazwie Sobel convolution) oraz jego matryca energetyczna
  3. Wykrywane są szwy o najmniejszej energii (pionowe linie o grubości 1 piksela nieprzerwanie idące od góry do dołu matrycy energetycznej)
  4. Nastepnie piksel z wykrytego szwu jest usuwany z oryginalnego zdjęcia i wynik jest wklejany jako źródło dla kroku 1

Każdy z poprzednich kroków przechowuje w rozmiarze źródła zdjęcia całą matrycę danych. Choć te matryce nie są pełnymi zdjęciami, tylko artefaktami po algorytmie, przechowywanie ich jest znacznie wygodniejsze niż użycie prostych tablic (JS Array) i dlatego własnie wykorzystana jest tu metoda kontekstu Canvas o nazwie createImageData. Jedną z zalet zastosowania takiego procesu jest to, że można pokazywać pośrednie kroki które zostały wykonane w trakcie obliczania efektu końcowego.

To demo pokazuje w jaki sposób można wykonać bardziej inteligentne zmienianie rozmiar obrazka niż proste spłaszczanie pikseli w CSS. Mając możliwości manipulowania obrazek oraz moc obliczeniową dostępną z poziomu przeglądarki otwiera nowy zakres możliwości do tworzenia aplikacji WWW prezentujących dane wizualne użytkownikom. A to demo to przecież korzysta tylko z ułamka tych możliwości…

Categories
main mozilla po polsku tech

Spotkanie Mozillowców w Warszawie

Z okazji wydania Firefoksa 3.5, organizujemy nieoficjalne spotkanie Mozillowców w Warszawie 🙂

Termin: Piątek, 3 lipca, 2009

Miejsce: pub Euforia, Złota 11, na tyłach domów centrum

Formuła: spotykamy się o 19:00, pijemy kto co lubi, gadamy o sieci i standardach i projektach Mozilli.

Zapraszam wszystkich zainteresowanych!!! 🙂

p.s. jeśli wybierasz się, daj proszę znać, będzie mi łatwiej zarezerwować miejsce wiedząc ile osób przyjdzie 🙂

Categories
main mozilla po polsku tech

Firefox 3.5 wydany!

W nawiązaniu do poprzeniego wpisu… To już oficjalne! Firefox 3.5 jest już publicznie dostępny, przetestowany i stabilny!

20090630_firefox_3.5fZapraszam do pobrania i zapoznania się z informacjami o wydaniu oraz do obejrzenia statystyk pobierania na żywo, a jutro, o 20:50 polskiego czasu nastąpi Shiretoko Shock Weave – moment w którym cała społeczność Mozilli w jednym momencie poinformuje na sieciach społecznościowych o tym wydaniu 🙂

Chciałbym przy okazji nieskromnie zwrócić uwagę czytelników na niesamowitą robotę jaką wykonuje w Polsce zespół Aviary.pl, a w szczególności lider zespołu – Hubert Gajewski oraz lider lokalizacji Firefoksa – Marek Stępień. To dzięki tej pracy polska lokalizacja jest tak wysokiej jakości! 🙂