Showing posts with label locale. Show all posts
Showing posts with label locale. Show all posts

Create a xpi language extension for IceCat

In the previous post I've explained how to compile IceCat with native support for the language of your choice. Now, I'll explain how to create a xpi language extension to install in IceCat.

Note that the extension gets the name firefox-3.0.1-g1.locale.langpack (for the European Portuguese, the name is firefox-3.0.1-g1.pt-PT.langpack.xpi). I don't know if this is due to the language files, a makefile or something else.

To create a xpi extension, just follow all the steps preceding the compilation of IceCat, like described in the previous post. Then, compile IceCat without the locale flag (just sudo ./configure; sudo make), go to browser/locales inside IceCat's source and execute this command (replacing pt-PT with your locale):

  • sudo make langpack-pt-PT
The xpi extension will be created in dist/install/, in IceCat's source. You'll just have to install it in IceCat in order to have it available in another language.

Compile IceCat with support for your language

Note: This small howto was made using gNewSense. So, in Debian and Ubuntu the procedure will probably be similar, as in other GNU/Linux distributions. I'm assuming that you know which are the dependencies to compile IceCat and have them installed.

I have all my source files in /usr/src, so this will be the "work root".

Open up a terminal, go to /usr/src and run the following commands:

  • sudo cvs -z3 -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
  • sudo cvs -z3 -d:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/tools/l10n

After that you will have a mozilla folder. Open it (cd mozilla) and execute the following command to download the locales (don't forget to replate pt-PT with the locale you want):
  • sudo make -f client.mk l10n-checkout MOZ_CO_PROJECT=browser MOZ_CO_LOCALES=pt-PT

When the download is done (that also downloads the mozilla source, but that's how it's explained in http://developer.mozilla.org/en/docs/Patching_a_Localization), a l10n directory will be created in /usr/src, containing the locale you specified. So, go back to /usr/src and enter l10n/pt-PT (remember that pt-PT must be replaced by the locale you downloaded). Now, enter the browser folder in l10n/pt-PT and use the following command:
  • sudo mkdir -p branding/unofficial

Now, without leaving that folder, you will need to copy the brand.dtd and brand.properties files and edit them:
  • sudo cp ../../chrome/branding/brand.*

My brand.dtd and brand.properties files look like this.

I also edit some other files, as you can see in this diff file.

After that, go to icecat's source in /usr/src and compile it with your locale:
  • sudo ./configure --enable-ui-locale=pt-PT; sudo make