Thursday, March 6, 2008

Code like crazy

That's what I do these days. Code like crazy. Mostly on Narro.

The first public release (a thing that is installable by anyone) should come in a month.

Now let me make this perfectly clear. This application is meant to help localization communities to do a better job, by allowing more people to translate, not for the developers to manage translations. That's the reason why it works only with one pair of languages. Original and translation. If you're already thinking at de-CH and de-DE, there are no worries. You can just take the suggestions from de-CH and import them into de-DE. Or the other way around.

When I started to write the application, I used Drupal's user management system because I just didn't need one of my own. I was thinking of an application that just did the job for me and only me. Since people got interested and wanted to use it, I thought Drupal was way too much overhead. I've got qcodo in there, I'll most probably use some ZendFramework as well so Drupal had to go.

I've wrote a simple user management system, login procedure, registration, permission and preferences. I still have to do a forgotten password thingie.

I've wrote a plugin handler and a first plugin. I'm still not sure about the need of these plugins, but hey, I need a special thing for Romanian, and I cannot distribute that for all of you. I have in the database s and t with comma under and I want people to be able to use my application with s and t with cedilla as well. Because we have people typing both of these caracters. Yes, it's madness, but I got that now in a plugin. Just delete it if you don't need it. Or maybe I'll add an active flag so it can be deactivated.

The application still works like the only working copy available online. Yes, that's the one with Drupal in it. Get over there and try it if you're curious. But I'm really using that one for the translation of those projects, so don't add thousands of suggestions, please. You can add suggestions without an account in the project named Firefox 3 (for Narro tests).

I am now working on the import/export procedures. I used to do this in the command line and I had cvs/svn commands there so I'll have to change this a bit. I need to build a page for import/export. Let me describe how would you import and export Firefox using Narro. I have a basic bash script to execute all these commands.
cvs -z3 co -r MOZILLA_1_8_BRANCH mozilla/
cd mozilla
Here I create a file .mozconfig with this in it:
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_CO_LOCALES=ro

I need to do the above only once, for my first checkout. Then, each time I want to import the changes from CVS in narro I execute:
make -f l10n-checkout
rm -rf ../l10n/en-US
make -f tools/l10n/ create-en-US
make -f tools/l10n/ check-l10n
cd ../l10n
rm -f mozilla.tar.bz2
tar cjf mozilla.tar.bz2 *
The next step is to run the php script to import mozilla.tar.bz2.
php importer.php --import-mozilla --project_id 2 --archive mozilla.tar.bz2
That's it. On my copy, I execute all the commands inside importer.php, but I cannot assume that you'll have cvs, make on the server where you're installing Narro. So you'll just do the cvs thing and produce the archive, then upload it in Narro. If you do have a server, well you'll just add a cron to do it all for you.

If I had to start a new translation, I'd just have to make an archive only with en-US in it.

The export operation is now done this way:
php importer.php --export-mozilla --project_id 2 --archive mozilla.tar.bz2
Just untar the archive over the l10n directory that you have. I am doing it automatically, the only thing I do is review the translation with a simple cvs diff command. It's not necessary, but I just like to check before I commit.

Now if all this sounds complicated, I understand. Mozilla promised me a server so I could install Narro there and you won't have to know nothing about cvs at all. You'll just push export and import buttons and that's it.

If you're a cvs freak and this sounds scary to you, I can give you more details in the comments upon request, as this is not the subject here.

Ok, that's it for today's briefing, see you in a few days with some pictures and demos and further development news.

No comments: