Localizing with Mercurial

  • Revision slug: Localizing_with_Mercurial
  • Revision title: Localizing with Mercurial
  • Revision id: 299313
  • Created:
  • Creator: jbeatty
  • Is current revision? No
  • Comment

Revision Content

 

In Mozilla, we use the the Mercurial version control system (Hg) to manage our source code and localizations. Mercurial allows localizers to work locally (on their machines) and then push (an Hg term) changes to a remote repository, which usually is hosted on the Mozilla servers (hg.mozilla.org). Localizing current versions of Firefox, Thunderbird and SeaMonkey includes working with Mercurial. If the documentation is incomplete or you have questions, please drop by the #l10n or #hg channels on irc.mozilla.org. The Mercurial FAQ are also worth a read, should you run into trouble.

 

For the eager and quick, below you'll find instructions on installing and configuring Mercurial, instructions on receiving an Hg account commit priviledges, as well as a few tasks you can complete without account priviledges.

 

Installing Mercurial

Follow the instructions below to install Mercurial on your system. Once you've installed Mercurial, we'll walk through the steps to configure it.

Mercurial on Linux

You can easily install Mercurial from the command line by issuing one of the following commands. Choose the appropriate command for your distribution.

# Debian/ubuntu
$ apt-get install mercurial

# Fedora
$ yum install mercurial

# Gentoo
$ emerge mercurial

# OpenSolaris
$ pkg install SUNWmercurial

If you prefer a graphical interface, you can download and install MercurialEclipse here.

Did it work?

Open a Terminal window and enter hg --version. If you see a message about the version of Mercurial (e.g. Mercurial Distributed SCM (version 1.3.1)), you have installed Mercurial successfully!

More details

For more details on installing Hg on Linux systems, refer to the instructions on Mercurial's Download page.

Mercurial on Windows

With Windows, you have a couple of install options:

  • For a command line interface, download and install {{ interwiki("wikimo", "MozillaBuild") }} package. This will not only install Hg, but also all the tools required to build Mozilla products on Windows. Trust us, you'll want this eventually.
  • TortoiseHg.pngFor a graphical interface, you may want to install TortoiseHg, which integrates with your Windows Explorer shell. It also installs the command line utility.

Mercurial Installer.pngPart of the command line Hg install for Windows involves making sure the hg executable is in the system's %PATH% variable (TortoiseHg doesn't need this step). Use the add_path.exe utility found in C:\mozilla-build\hg to do this.

PS C:\Users\your_id> cd C:\mozilla-build\hg
PS C:\mozilla-build\hg> .\add_path.exe /result .

Note the dot (".") at the end of the second command, which means the current directory. If the utility modified your %PATH% successfully, a dialog will open saying, "%PATH% has been updated correctly."

Alternatively, you can edit the %PATH% variable manually. In order to do so, right-click on your computer icon, choose Properties > Advanced > Environmental Variables, select PATH and click Edit. If you don't see PATH among the options, you'll have to click Add and edit it within the Add dialog. See the screenshot for an example.PATH.jpg

Did it work?

  1. Go to Start > Run...
  2. Type cmd.exe and click OK. A new shell window should appear. 
  3. Type hg --version in the new shell window. If you see a message about the version of Mercurial (e.g. Mercurial Distributed SCM (version 1.3.1)), you have installed Mercurial successfully!

 

More details

For more details on installing Hg on Windows, refer to the instructions on Mercurial's Download page.

 

Mercurial on Mac OSX

Installing Hg on Mac OSX is super easy. You can install Mercurial via MacPorts through the Terminal, like so:

$ sudo port install mercurial

You can also install it by downloading the dmg package from the Hg download page. It has an install dialog that will walk you through the process.

If you prefer a graphical interface, you can download and install MercurialEclipse here.

Did it work?

Open a Terminal window and type hg --version. If you see a message about the version of Mercurial (e.g. Mercurial Distributed SCM (version 1.3.1)), you have installed Mercurial successfully!

 

More details

For more details on installing Hg on Mac OSX, refer to the instructions on Mercurial's Download page.

 

Configuring Mercurial

Once you've installed Mercurial, you'll need to configure it before you can use it successfully.

Your Mercurial configuration is contained within a config file which you must create yourself. Your config file is called either.hgrc (UNIX systems) or Mercurial.ini (Windows), depending on your operating system.

Your config file should have the following settings:

[ui]
username = Your Real Name <user@example.com>
merge = internal:merge

[defaults]
commit = -v

[diff]
git = 1
showfunc = 1
unified = 8

To configure Hg, follow these steps:

  1. Create a new file in your favorite text editor.
  2. Copy the settings above and paste them into your new file.
  3. Save the file as either .hgrc (UNIX systems) or Mercurial.ini (Windows) and save it in either $HOME/ or C:\mozilla-build\hg\ or C:\Program Files\Mercurial\.

Tools

There are a few tools to interface with Mercurial. Starting of course with the command line client, but for those of you that prefer GUI tools, there’d be TortoiseHg for Windows, and there’s Mercurial Eclipse for the fans of that cross platform environment.

Repositories

There are several repostiories that contain en-US files that most locales will want to deal with.

  • mozilla-aurora contains the files for Firefox.next (currently Firefox 4.0).
  • comm-aurora contains the files for SeaMonkey and Thunderbird which are not already part of Firefox.

{{ Note("When you get the comm-aurora repository, this will include the mozilla-aurora repository as well. You can therefore use the one set up for developing Firefox, SeaMonkey and Thunderbird without having to pull mozilla-aurora a second time.") }}

Some locales may want to localise mozilla-central and comm-central which may change strings at any time. Speak to the L10n drivers if you want to do this.

Pulling en-US for the first time

To get the en-US files, you’ll have to pull mozilla-aurora (or -aurora) or comm-aurora.

Firefox only

If you are only working on Firefox use:

hg clone http://hg.mozilla.org/releases/mozilla-aurora/

This will create a clone of the mozilla-aurora repository in the directory mozilla-aurora.

Any combination of Firefox, SeaMonkey, Thunderbird

If you are working on any combination of Firefox, SeaMonkey, Thunderbird use:

hg clone http://hg.mozilla.org/releases/comm-aurora/
cd comm-aurora
python client.py checkout

The first command will create a clone of the comm-central repository in the directory comm-aurora. The second command will move you into that directory.

The third command will do a clone of mozilla-aurora, and pull some other hg repositories. The other directories are required for SeaMonkey and Thunderbird.

Updating en-US

To update your mozilla-aurora working copy, go to your mozilla-aurora dir and

hg pull
hg update -c

This will both get new changesets from mozilla-aurora and apply those changes in your working copy.

To update your comm-aurora working copy, go to your comm-aurora dir and

python client.py checkout

This will both get new changesets from comm-aurora, mozilla-aurora and the other appropriate locations and apply those changes in your working copy.

Pull your locale

All locales are in one mxr, . The repositories are separate, though, you get a list of the repos at . To clone your localization, please use (replacing ab-CD with your locale code)

hg clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD/

or update with

hg pull -u

Sending your changes to mozilla

Before committing any changes, add these lines to your ~/.hgrc file:

[ui]
username = Your Name <your.email@example.com>

With mercurial you work in your own repository. Before committing your work you should ensure that there are no changes made to the remote repository, to do this, pull your locale, as per the section above.

After finishing a change or set of changes and checking you have updated to the latest, you should commit:

hg commit -m "message identifying the change (bug 555)"

Unlike CVS this won’t send your changes to Mozilla’s repository. First you need to push the changes. To push to l10n-aurora and other mozilla-hosted repositories you have to have committer access, and you must edit the file (your-local-hg-root AKA the directory you pulled your locale into)/.hg/hgrc (note, this is NOT your ~/.hgrc) to add this lines (replacing ab-CD with your locale code):

[paths]
default = http://hg.mozilla.org/releases/l10n/...-aurora/ab-CD/
default-push = ssh://hg.mozilla.org/releases/l10n/m...-aurora/ab-CD/

You’ll need to tell ssh which account to use for your pushes, too, by editing ~/.ssh/config and adding the lines

Host hg.mozilla.org
User user@host.domain

user@domain is your account, with a real @ instead of the % that you used for CVS. Afterwards you can push your work to the repository (and check the result on the dashboard)

hg push

A .mozconfig

Firefox via mozilla-central

If you followed the steps above to get just mozilla-aurora, your directory layout would look like

mozilla-aurora
+ browser
de
+ browser

and a .mozconfig would look like

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fx-de
ac_add_options --with-l10n-base=..
ac_add_options --disable-compile-environment
ac_add_options --enable-application=browser

You would put this file in the directory mozilla-aurora.

Note: the --with-l10n-base is relative to the objdir, not the srcdir.

If you want to build a localized version directly, you add the line

ac_add_options --enable-ui-locale=<language code>

Another option is to build without this and create and use a language pack, as described below.

Firefox via comm-central

If you followed the steps above to get comm-central, your directory layout would look like

comm-central
+ mozilla
  + browser
de
+ browser

and a .mozconfig would look like

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../../fx-de
ac_add_options --with-l10n-base=..
ac_add_options --disable-compile-environment
ac_add_options --enable-application=browser

{{ Note("The make -f client.mk configure command must be run from the comm-aurora/mozilla directory.") }}

The --with-l10n-base line is correct with just “..”. This is due to the way the environment works within comm-aurora.

This file should be placed in comm-aurora/mozilla.

The same remark applies about building a localized version directly.

Thunderbird and SeaMonkey

If you followed the steps above to get comm-central, your directory layout would look like

comm-aurora
+ mail
+ suite
de
+ mail
+ suite

and a .mozconfig for Thunderbird would look like

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../tb-de
ac_add_options --with-l10n-base=..
ac_add_options --disable-compile-environment
ac_add_options --enable-application=mail

Replace tb-de with sm-de and mail with suite for a SeaMonkey .mozconfig.

This file should be placed in the directory comm-aurora.

The same remark applies about building a localized version directly.

Run make -f client.mk build from the comm-aurora directory.

Compare-locales

Compare-locales works like it did, for Firefox:

compare-locales mozilla-aurora/browser/locales/l10n.ini . de

or for Thunderbird:

compare-locales comm-aurora/mail/locales/l10n.ini . de

Replace mail with suite if you want to check SeaMonkey.

Building langpacks etc

There’s a small change here, you have to add --with-l10n-base as a configure argument, pointing to the base dir of your l10n repo. Follow Creating a Language Pack, adjust the paths as needed.

 

Getting your Mercurial account priviledges

To get write access to the l10n hg repositories on the Mozilla server, there's a bit of paper work to be done. The localization team owner needs to file a bug requesting an hg account. You need to follow the instructions regarding the contributor form. Write access to the hg repositories requires a ''voucher'', which, for the owner, will be done based on the review by Mozilla. For peers of a localization, the owner can vouch (once she or he is registered).

 

{{ languages( { "es": "es/L10n_en_Mercurial", "fr": "fr/Localisation_avec_Mercurial" ,"nl": "/Nl/L10n_met_Mercurial"} ) }}

Revision Source

<p>&nbsp;</p>
<p>In Mozilla, we use the the&nbsp;<a href="../../../../en/Mercurial_basics" rel="internal">Mercurial</a>&nbsp;version control system (Hg) to manage our source code and localizations. Mercurial allows localizers to work locally (on their machines) and then&nbsp;<code style="font-size: 14px; ">push</code>&nbsp;(an Hg term) changes to a remote repository, which usually is hosted on the Mozilla servers (<a class="external" href="http://hg.mozilla.org/" title="http://hg.mozilla.org/">hg.mozilla.org</a>).&nbsp;Localizing current versions of Firefox, Thunderbird and SeaMonkey includes working with Mercurial. If the documentation is incomplete or you have questions, please drop by the&nbsp;<a href="irc://irc.mozilla.org/l10n" title="irc://irc.mozilla.org/l10n">#l10n</a> or <a href="irc://irc.mozilla.org/hg" title="irc://irc.mozilla.org/hg">#hg</a>&nbsp;channels on irc.mozilla.org. The&nbsp;<a class="internal" href="/en/Mercurial_FAQ" title="En/Mercurial FAQ">Mercurial FAQ</a>&nbsp;are also worth a read, should you run into trouble.</p>
<p>&nbsp;</p>
<p>For the eager and quick, below you'll find instructions on installing and configuring Mercurial, instructions on receiving an Hg account commit priviledges, as well as a few tasks you can complete without account priviledges.</p>
<p>&nbsp;</p>
<h2 id="Install_Mercurial">Installing Mercurial</h2>
<p>Follow the instructions below to install Mercurial on your system.&nbsp;Once you've installed Mercurial, we'll walk through the steps to <a href="/en/Mercurial_FAQ#Configuration" title="en/Mercurial FAQ#Configuration">configure</a> it.</p>
<h3 id="Install_Mercurial_on_Linux">Mercurial on Linux</h3>
<p>You can easily install Mercurial from the command line by issuing one of the following commands. Choose the appropriate command for your distribution.</p>
<pre>
# Debian/ubuntu
$ apt-get install mercurial

# Fedora
$ yum install mercurial

# Gentoo
$ emerge mercurial

# OpenSolaris
$ pkg install SUNWmercurial
</pre>
<p>If you prefer a graphical interface, you can&nbsp;<a href="http://javaforge.com/project/HGE" title="http://javaforge.com/project/HGE">download and install MercurialEclipse here</a>.</p>
<h4 id="Did_it_work.3F">Did it work?</h4>
<p>Open a Terminal window and enter&nbsp;<code>hg --version</code>. If you see a message about the version of Mercurial (e.g. <code>Mercurial Distributed SCM (version 1.3.1)</code>), you have installed Mercurial successfully!</p>
<h4>More details</h4>
<p>For more details on installing Hg on Linux systems, refer to the&nbsp;<a class="external" href="http://mercurial.selenic.com/downloads/" title="http://mercurial.selenic.com/downloads/">instructions on Mercurial's Download page</a>.</p>
<h3 id="Install_Mercurial_on_Windows">Mercurial on Windows</h3>
<p>With Windows, you have a couple of install options:</p>
<ul>
  <li>For a&nbsp;<strong>command line interface</strong>,&nbsp;download and install {{ interwiki("wikimo", "MozillaBuild") }} package. This will not only install Hg, but also all the tools required to build Mozilla products on Windows. Trust us, you'll want this eventually.</li>
  <li><a href="/@api/deki/files/3863/=TortoiseHg.png" title="TortoiseHg.png"><img align="right" alt="TortoiseHg.png" class="internal rwrap" src="/@api/deki/files/3863/=TortoiseHg.png?size=thumb" style="width: 160px; height: 115px;" /></a>For a&nbsp;<strong>graphical interface</strong>, you may want to <a class="external" href="http://tortoisehg.bitbucket.org/" title="http://tortoisehg.bitbucket.org/">install TortoiseHg</a>, which integrates with your Windows Explorer shell. It also installs the command line utility.</li>
</ul>
<p><a href="/@api/deki/files/3861/=Mercurial_Installer.png" title="Mercurial Installer.png"><img align="right" alt="Mercurial Installer.png" class="internal rwrap" src="/@api/deki/files/3861/=Mercurial_Installer.png?size=thumb" style="width: 160px; height: 125px;" /></a>Part of the command line Hg install for Windows involves making sure the <code>hg </code>executable is in the system's <code>%PATH%</code> variable (TortoiseHg doesn't need this step). Use the <code>add_path.exe</code> utility found in <code>C:\mozilla-build\hg</code>&nbsp;to do this.</p>
<pre>
PS C:\Users\your_id&gt; cd C:\mozilla-build\hg
PS C:\mozilla-build\hg&gt; .\add_path.exe /result .
</pre>
<p>Note the dot ("<code>.</code>") at the end of the second command, which means <em>the current directory</em>. If the utility modified your <code>%PATH%</code> successfully, a dialog will open saying, "<code><em>%PATH%</em></code><em> has been updated correctly</em>."</p>
<p>Alternatively, you can edit the <code>%PATH%</code> variable manually. In order to do so, right-click on your computer icon, choose <code>Properties &gt; Advanced &gt; Environmental Variables</code>, select <code>PATH </code>and click <code>Edit</code>. If you don't see <code>PATH</code> among the options, you'll have to click <code>Add</code> and edit it within the <strong>Add</strong> dialog. See the screenshot for an example.<a href="/@api/deki/files/3862/=PATH.jpg" title="PATH.jpg"><img align="right" alt="PATH.jpg" class="internal rwrap" src="/@api/deki/files/3862/=PATH.jpg?size=thumb" style="width: 160px; height: 71px;" /></a></p>
<h4 id="Did_it_work.3F">Did it work?</h4>
<ol>
  <li>Go to <code>Start &gt; Run...</code></li>
  <li>Type <code>cmd.exe </code>and click <code>OK</code>. A new shell window should appear.&nbsp;</li>
  <li>Type <code>hg --version</code> in the new shell window.&nbsp;If you see a message about the version of Mercurial (e.g. <code>Mercurial Distributed SCM (version 1.3.1)</code>), you have installed Mercurial successfully!</li>
</ol>
<p>&nbsp;</p>
<h4 style="font-size: 14px; ">More details</h4>
<p>For more details on installing Hg on Windows, refer to the&nbsp;<a class="external" href="http://mercurial.selenic.com/downloads/" title="http://mercurial.selenic.com/downloads/">instructions on Mercurial's Download page</a>.</p>
<p>&nbsp;</p>
<h3 id="Install_Mercurial_on_Mac">Mercurial on Mac OSX</h3>
<p>Installing Hg on Mac OSX is super easy. You can install Mercurial via <a class="external" href="http://www.macports.org/" title="http://www.macports.org/">MacPorts</a>&nbsp;through the Terminal,&nbsp;like so:</p>
<p><code>$ sudo port install mercurial</code></p>
<p>You can also install it by downloading the dmg package from the <a href="http://mercurial.selenic.com/wiki/Download#Mac_OS_X" title="http://mercurial.selenic.com/wiki/Download#Mac_OS_X">Hg download page</a>. It has an install dialog that will walk you through the process.</p>
<p>If you prefer a graphical interface, you can <a href="http://javaforge.com/project/HGE" title="http://javaforge.com/project/HGE">download and install MercurialEclipse here</a>.</p>
<h4>Did it work?</h4>
<p>Open a Terminal window and type <code>hg --version</code>. If you see a message about the version of Mercurial (e.g. <code>Mercurial Distributed SCM (version 1.3.1)</code>), you have installed Mercurial successfully!</p>
<p>&nbsp;</p>
<h4 style="font-size: 14px; ">More details</h4>
<p>For more details on installing Hg on Mac OSX, refer to the&nbsp;<a class="external" href="http://mercurial.selenic.com/downloads/" title="http://mercurial.selenic.com/downloads/">instructions on Mercurial's Download page</a>.</p>
<p>&nbsp;</p>
<h2 id="Configuring_Mercurial">Configuring Mercurial</h2>
<p>Once you've installed Mercurial, you'll need to configure it before you can use it successfully.</p>
<p>Your Mercurial configuration is contained within a config file&nbsp;which you must create yourself.&nbsp;Your config file is called either<code style="font-size: 14px; color: rgb(51, 51, 51); ">.hgrc</code>&nbsp;(UNIX systems) or <code style="font-size: 14px; color: rgb(51, 51, 51); ">Mercurial.ini</code>&nbsp;(Windows), depending on your operating system.</p>
<p>Your config file&nbsp;should have the following settings:</p>
<pre class="eval">
[ui]
username = Your Real Name &lt;<a class="link-mailto" href="mailto:user@example.com" rel="external" target="_blank" title="mailto:user@example.com">user@example.com</a>&gt;
merge = internal:merge

[defaults]
commit = -v

[diff]
git = 1
showfunc = 1
unified = 8</pre>
<p>To configure Hg, follow these steps:</p>
<ol>
  <li>Create a new file in your favorite text editor.</li>
  <li>Copy the settings above and paste them into your new file.</li>
  <li>Save the file as either <code>.hgrc</code>&nbsp;(UNIX systems) or <code>Mercurial.ini</code>&nbsp;(Windows) and save it in either&nbsp;<code>$HOME/</code> or <code>C:\mozilla-build\hg\</code> or <code>C:\Program Files\Mercurial\</code>.</li>
</ol>
<h3 id="Tools">Tools</h3>
<p>There are a few tools to interface with Mercurial. Starting of course with the command line client, but for those of you that prefer GUI tools, there’d be <a class="external" href="http://tortoisehg.sourceforge.net/" title="http://tortoisehg.sourceforge.net/">TortoiseHg</a> for Windows, and there’s <a class="external" href="http://trac-hg.assembla.com/mercurialeclipse" title="http://trac-hg.assembla.com/mercurialeclipse">Mercurial Eclipse</a> for the fans of that cross platform environment.</p>
<h3 id="Repositories">Repositories</h3>
<p>There are several repostiories that contain en-US files that most locales will want to deal with.</p>
<ul>
  <li><a class="external" href="http://hg.mozilla.org/releases/mozilla-aurora/" title="http://hg.mozilla.org/releases/mozilla-aurora/">mozilla-aurora</a> contains the files for Firefox.next (currently Firefox 4.0).</li>
  <li><a class="external" href="http://hg.mozilla.org/releases/comm-aurora/" title="http://hg.mozilla.org/releases/comm-aurora">comm-aurora</a> contains the files for SeaMonkey and Thunderbird which are not already part of Firefox.</li>
</ul>
<p>{{ Note("When you get the comm-aurora repository, this will include the mozilla-aurora repository as well. You can therefore use the one set up for developing Firefox, SeaMonkey and Thunderbird without having to pull mozilla-aurora a second time.") }}</p>
<p>Some locales may want to localise mozilla-central and comm-central which may change strings at any time. Speak to the L10n drivers if you want to do this.</p>
<h3 id="Pulling_en-US" name="Pulling_en-US">Pulling en-US for the first time</h3>
<p>To get the en-US files, you’ll have to pull mozilla-aurora (or -aurora) or comm-aurora.</p>
<h4 id="Firefox_only">Firefox only</h4>
<p>If you are only working on Firefox use:</p>
<pre class="eval">
hg clone <a class="external" href="http://hg.mozilla.org/releases/mozilla-aurora/" rel="freelink">http://hg.mozilla.org/releases/mozilla-aurora/</a>
</pre>
<p>This will create a clone of the mozilla-aurora repository in the directory mozilla-aurora.</p>
<h4 id="Any_combination_of_Firefox.2C_SeaMonkey.2C_Thunderbird">Any combination of Firefox, SeaMonkey, Thunderbird</h4>
<p>If you are working on any combination of Firefox, SeaMonkey, Thunderbird use:</p>
<pre>
hg clone http://hg.mozilla.org/releases/comm-aurora/
cd comm-aurora
python client.py checkout
</pre>
<p>The first command will create a clone of the comm-central repository in the directory comm-aurora. The second command will move you into that directory.</p>
<p>The third command will do a clone of mozilla-aurora, and pull some other hg repositories. The other directories are required for SeaMonkey and Thunderbird.</p>
<h3 id="Updating_en-US">Updating en-US</h3>
<p>To update your mozilla-aurora working copy, go to your mozilla-aurora dir and</p>
<pre class="eval">
hg pull
hg update -c
</pre>
<p>This will both get new changesets from mozilla-aurora and apply those changes in your working copy.</p>
<p>To update your comm-aurora working copy, go to your comm-aurora dir and</p>
<pre>
python client.py checkout</pre>
<p>This will both get new changesets from comm-aurora, mozilla-aurora and the other appropriate locations and apply those changes in your working copy.</p>
<h3 id="Pull_your_locale" name="Pull_your_locale">Pull your locale</h3>
<p>All locales are in one mxr, . The repositories are separate, though, you get a list of the repos at . To clone your localization, please use (replacing ab-CD with your locale code)</p>
<pre class="eval">
hg clone <a class="external" href="http://hg.mozilla.org/releases/l10n/mozilla-aurora/" rel="freelink">http://hg.mozilla.org/releases/l10n/mozilla-aurora/</a><a class="moz-txt-link-freetext external" href="http://hg.mozilla.org/releases/l10n-mozilla-1.9.2/ab-CD/">ab-CD/</a></pre>
<p>or update with</p>
<pre>
hg pull -u
</pre>
<h3 id="Sending_your_changes_to_mozilla">Sending your changes to mozilla</h3>
<p>Before committing any changes, add these lines to your <code>~/.hgrc</code> file:</p>
<pre class="eval">
[ui]
username = Your Name &lt;<a class="link-mailto" href="mailto:your.email@example.com" rel="freelink">your.email@example.com</a>&gt;
</pre>
<p>With mercurial you work in your own repository. Before committing your work you should ensure that there are no changes made to the remote repository, to do this, pull your locale, as per the section above.</p>
<p>After finishing a change or set of changes and checking you have updated to the latest, you should commit:</p>
<pre class="eval">
hg commit -m "message identifying the change (bug 555)"
</pre>
<p>Unlike CVS this won’t send your changes to Mozilla’s repository. First you need to push the changes. To push to <a class="external" href="http://hg.mozilla.org/releases/l10n/mozilla-aurora/" title="http://hg.mozilla.org/releases/l10n/mozilla-aurora/">l10n-aurora</a> and other mozilla-hosted repositories you have to have committer access, and you must edit the file <code><em>(your-local-hg-root AKA&nbsp;the directory you pulled your locale into)</em>/.hg/hgrc</code> (note, this is <strong>NOT</strong> your <code>~/.hgrc</code>) to add this lines (replacing ab-CD with your locale code):</p>
<pre class="eval">
[paths]
default = <a class="external" href="http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD/" rel="freelink">http://hg.mozilla.org/releases/l10n/...-aurora/ab-CD/</a>
default-push = <a class="external" href="ssh://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD/" rel="freelink">ssh://hg.mozilla.org/releases/l10n/m...-aurora/ab-CD/</a>
</pre>
<p>You’ll need to tell ssh which account to use for your pushes, too, by editing <code>~/.ssh/config</code> and adding the lines</p>
<pre>
Host hg.mozilla.org
User user@host.domain
</pre>
<p><code>user@domain</code> is your account, with a real @ instead of the % that you used for CVS. Afterwards you can push your work to the repository (and check the result on the dashboard)</p>
<pre class="eval">
hg push</pre>
<h3 id="A_.mozconfig" name="A_.mozconfig">A .mozconfig</h3>
<h4 id="Firefox_via_mozilla-central">Firefox via mozilla-central</h4>
<p>If you followed the steps above to get just mozilla-aurora, your directory layout would look like</p>
<pre class="eval">
mozilla-aurora
+ browser
de
+ browser
</pre>
<p>and a .mozconfig would look like</p>
<pre>
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../fx-de
ac_add_options --with-l10n-base=..
ac_add_options --disable-compile-environment
ac_add_options --enable-application=browser</pre>
<p>You would put this file in the directory mozilla-aurora.</p>
<div class="note">
  <strong>Note:</strong> the --with-l10n-base is relative to the objdir, not the srcdir.</div>
<p>If you want to build a localized version directly, you add the line</p>
<pre>
ac_add_options --enable-ui-locale=&lt;language code&gt;
</pre>
<p>Another option is to build without this and create and use a language pack, as described below.</p>
<h4 id="Firefox_via_comm-central">Firefox via comm-central</h4>
<p>If you followed the steps above to get comm-central, your directory layout would look like</p>
<pre>
comm-central
+ mozilla
  + browser
de
+ browser
</pre>
<p>and a .mozconfig would look like</p>
<pre>
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../../fx-de
ac_add_options --with-l10n-base=..
ac_add_options --disable-compile-environment
ac_add_options --enable-application=browser</pre>
<p>{{ Note("The <code>make -f client.mk configure</code> command must be run from the comm-aurora/mozilla directory.") }}</p>
<p>The <code>--with-l10n-base</code> line is correct with just “<code>..</code>”. This is due to the way the environment works within comm-aurora.</p>
<p>This file should be placed in comm-aurora/mozilla.</p>
<p>The same remark applies about building a localized version directly.</p>
<h4 id="Thunderbird_and_SeaMonkey">Thunderbird and SeaMonkey</h4>
<p>If you followed the steps above to get comm-central, your directory layout would look like</p>
<pre>
comm-aurora
+ mail
+ suite
de
+ mail
+ suite
</pre>
<p>and a .mozconfig for Thunderbird would look like</p>
<pre>
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../tb-de
ac_add_options --with-l10n-base=..
ac_add_options --disable-compile-environment
ac_add_options --enable-application=mail</pre>
<p>Replace <code>tb-de</code> with <code>sm-de</code> and <code>mail</code> with <code>suite</code> for a SeaMonkey .mozconfig.</p>
<p>This file should be placed in the directory comm-aurora.</p>
<p>The same remark applies about building a localized version directly.</p>
<p>Run <code class="eval">make -f client.mk build</code> from the comm-aurora directory.</p>
<h3 id="Compare-locales" name="Compare-locales">Compare-locales</h3>
<p><a href="/en/Compare-locales" title="en/Compare-locales">Compare-locales</a> works like it did, for Firefox:</p>
<pre class="eval">
compare-locales mozilla-aurora/browser/locales/l10n.ini . de
</pre>
<p>or for Thunderbird:</p>
<pre>
compare-locales comm-aurora/mail/locales/l10n.ini . de</pre>
<p>Replace <code>mail</code> with <code>suite</code> if you want to check SeaMonkey.</p>
<h3 id="Building_langpacks_etc" name="Building_langpacks_etc">Building langpacks etc</h3>
<p>There’s a small change here, you have to add <code>--with-l10n-base</code> as a configure argument, pointing to the base dir of your l10n repo. Follow <a href="/en/Creating_a_Language_Pack" title="en/Creating_a_Language_Pack">Creating a Language Pack</a>, adjust the paths as needed.</p>
<p>&nbsp;</p>
<h2 id="Getting_your_Mercurial_account_priviledges">Getting your Mercurial account priviledges</h2>
<p>To get write access to the l10n hg repositories on the Mozilla server,<a class="external" href="http://www.mozilla.org/hacking/commit-access-policy/" title="http://www.mozilla.org/hacking/commit-access-policy/">&nbsp;there's a bit of paper work to be done</a>. The localization team owner needs to&nbsp;<a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=mozilla.org&amp;component=Repository%20Account%20Requests&amp;rep_platform=All&amp;op_sys=All&amp;cc=l10n%40mozilla.com&amp;short_desc=l10n%20hg%20account%20for%20John%20Doe%20(ab-CD)" title="https://bugzilla.mozilla.org/enter_bug.cgi?product=mozilla.org&amp;component=Repository%20Account%20Requests&amp;rep_platform=All&amp;op_sys=All&amp;cc=l10n%40mozilla.com&amp;short_desc=l10n%20hg%20account%20for%20John%20Doe%20(ab-CD)">file a bug requesting an hg account</a>. You need to follow the instructions regarding the&nbsp;<a class="external" href="http://www.mozilla.org/hacking/committer/" title="http://www.mozilla.org/hacking/committer/">contributor form</a>. Write access to the hg repositories requires a ''voucher'', which, for the owner, will be done based on the review by Mozilla. For peers of a localization, the owner can vouch (once she or he is registered).</p>
<p>&nbsp;</p>
<p>{{ languages( { "es": "es/L10n_en_Mercurial", "fr": "fr/Localisation_avec_Mercurial" ,"nl": "/Nl/L10n_met_Mercurial"} ) }}</p>
Revert to this revision