User:Toniher/Building langpacks: Difference between revisions
Jump to navigation
Jump to search
(build langpack) |
No edit summary |
||
| Line 37: | Line 37: | ||
** In chrome.manifest file, remove manifest chrome/an.manifest line (not necessary) | ** In chrome.manifest file, remove manifest chrome/an.manifest line (not necessary) | ||
** Save them back and you're done. | ** Save them back and you're done. | ||
== Convert PO files to l10n dir == | |||
If you are using Pootle, you're likely to start with a bunch of PO files and not typical DTD and properties files. | |||
* [http://translate.sourceforge.net/wiki/toolkit/index Install Translate Toolkit] | |||
* [https://translate.svn.sourceforge.net/svnroot/translate/src/trunk/tools/mozilla/get_moz_enUS.py Install get_moz_enUS.py somewhere in your system path] | |||
* Create en-US l10n dir: <code>get_moz_enUS.py -s mozilla-beta -d l10n -p browser</code> (this will create only browser files) | |||
* Create PO templates from l10n/en-US: <code>moz2po -P -t l10n/en-US -i l10n/en-US -o po/pot</code> | |||
* Copy POT files: <code>cp -rf po/pot po/pot.pre</code> | |||
* Rename POT files to PO: <code>find po/pot -name "*.pot" -exec rename "s/\.pot/\.po/" {} \;</code> | |||
* Your locale PO files (e.g. an) are saved in an.pre directory (under an, there are dirs such as browser, toolkit, etc. with PO files inside) | |||
* Merge any missing PO file (even not translated, better than nothing, it would crash otherwise): <code>pomerge -i po/an.pre -t po/pot.pre -o po/an</code> Generates po/an directory. | |||
* Adds any missing one: <code>rsync -r --ignore-existing po/pot/* po/an</code> | |||
* Generate l10n/an: <code>po2moz -t l10n/en-US -i po/an -o l10n/an</code> | |||
== Links == | |||
* [http://www.softcatala.org/wiki/Projectes/Softvalenci%C3%A0/Adaptaci%C3%B3_del_programari#Mozilla Reference for Valencian langpack] | |||
Latest revision as of 06:58, 17 April 2012
Some notes about building langpacks.
Create a working directory and choose base repository you are going to use. E. g.: beta
- Clone base directory:
hg clone http://hg.mozilla.org/releases/mozilla-beta
- Create l10n directory. Example with an.
hg clone http://hg.mozilla.org/users/toniher_softcatala.org/an l10n/an
Inside mozilla-beta directory, create a .mozconfig file with the following content:
ac_add_options --disable-compile-environment mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/aragon ac_add_options --with-l10n-base=/home/toniher/remote-work/mozilla-hg/mozilla-beta/l10n ac_add_options --enable-application=browser ac_add_options --enable-official-branding
Langpack will be created in a subdirectory inside aragon dir. l10n-base should be changed to fit the path in your system. If creating a langpack for other applications, you should change browser for mail or other.
- Inside mozilla-beta, launch this command:
make -f client.mk configure.
- This will generate a
Makefilein: aragon/browser/locales
- Go to aragon/browser/locales, and execute:
make langpack-an
- A langpack will be generated in: aragon/dist/linux-x86_64/xpi (depending on your system)
- XPI is a ZIP file. You can change some things inside:
- In install.rdf, increase major version, let's say, from 12.0 to 12.*
- In chrome.manifest file, remove manifest chrome/an.manifest line (not necessary)
- Save them back and you're done.
Convert PO files to l10n dir
If you are using Pootle, you're likely to start with a bunch of PO files and not typical DTD and properties files.
- Create en-US l10n dir:
get_moz_enUS.py -s mozilla-beta -d l10n -p browser(this will create only browser files) - Create PO templates from l10n/en-US:
moz2po -P -t l10n/en-US -i l10n/en-US -o po/pot - Copy POT files:
cp -rf po/pot po/pot.pre - Rename POT files to PO:
find po/pot -name "*.pot" -exec rename "s/\.pot/\.po/" {} \; - Your locale PO files (e.g. an) are saved in an.pre directory (under an, there are dirs such as browser, toolkit, etc. with PO files inside)
- Merge any missing PO file (even not translated, better than nothing, it would crash otherwise):
pomerge -i po/an.pre -t po/pot.pre -o po/anGenerates po/an directory. - Adds any missing one:
rsync -r --ignore-existing po/pot/* po/an - Generate l10n/an:
po2moz -t l10n/en-US -i po/an -o l10n/an