Say you have found a problem with an existing localization. More specifically, it's a problem with an already released localization. What do you do now? Well, you have come to the right place! This page will walk through creating a patch for an existing localization. The steps below are fairly generic; for the most part they apply to creating l10n patches for Firefox, Thunderbird, SeaMonkey, or Calendar.
I'll use Firefox in the example below to help you understand the general steps to creating a l10n patch.
If you are to the point that you are patching existing localizations, we assume that you have the basic set of tools listed on the L10n Prerequisites wiki page. If you do not have these tools, take a few steps back, grab a cookie (because, let's face it, you deserve it for all of your work), and visit the L10n Prerequisites page. There you'll learn what tools you need, where to find them, and how to install them.
Get the source
First, you need to get the source for the localization in question using its two character ISO language code. For our example, I'll use
Next thing you need to know is which localization version you want to patch, let's take Firefox 3.6 as an example. The branch name for this version is '
releases/l10n-mozilla-1.9.2'. For more information about branches see L10n:Branches.
Now let's get concrete, start bash and:
Create a clean directory to do your work. For example, create a directory like
localization-workdir(in this example it is located in your home directory):
- Go to this directory:
- Clone the localization repository for your locale and for the version you want to patch:
Add your changes
Now you can edit the DTD and properties files to make the changes you intend to do.
Creating a patch
You create a patch with the following steps:
- Go to your localization directory
- Create the patch
This will list the differences in a unified patch to stdout. You can visually inspect if this is what you intended to do, as a good patch only contains those changes that you intend. If it contains more, you'll likely regress something else.
- Alternatively, you can only show differences in selected files by doing:
hg diff browser/chrome/browser/browser.dtd
- Attach the patch for reference or review in an existing bug or create a new one.
hg diff > path/to/patchfile