-
Notifications
You must be signed in to change notification settings - Fork 5
/
localization.html
142 lines (142 loc) · 10 KB
/
localization.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Localization Guide - ChatZilla!</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="icon" type="image/png" href="favicon.png"/>
<link rel="stylesheet" type="text/css" href="common/style/core.css"/>
<link rel="stylesheet" type="text/css" href="common/style/site.css"/>
<script type="text/javascript" src="common/script/site.js"></script>
</head>
<body>
<div id="header">
<script type="text/javascript">writeHeader();</script>
</div>
<div id="content">
<h1>Localizing ChatZilla</h1>
<p>
This page explains the process for localizing ChatZilla but does not go into depth on more general issues, such as <a href="https://developer.mozilla.org/en/mercurial">using Mercurial</a> or <a href="https://wiki.mozilla.org/SeaMonkey:Localization">localizing SeaMonkey</a>. You will need <strong>basic command-line skills</strong>. If you have any questions or issues localizing ChatZilla, or just want to chat with fellow users and developers, feel free to drop by in <a href="irc://irc.mozilla.org/chatzilla">#chatzilla on moznet</a>.
</p>
<h2>Definitions</h2>
<dl>
<dt><var>ab-CD</var></dt><dd>This text is used to refer to the locale code for your localization. You should replace every occurance with your localization's correct code. For example, French would likely use '<samp>fr-FR</samp>'.</dd>
</dl>
<h2>Requirements</h2>
<ul>
<li><a href="http://www.python.org/">Python</a> is required for all localizations.</li>
<li><a href="http://mercurial.selenic.com/">Mercurial</a> may be used to easily keep up-to-date with new changes in ChatZilla, but is not required.</li>
<li>Optionally update the Mozilla <a href="https://wiki.mozilla.org/L10n:Teams">Localization Teams</a> so people know who's working on what.</li>
</ul>
<h2>1. Get the source code</h2>
<h3>With Mercurial</h3>
<ol>
<li>Open a terminal or Command Prompt.</li>
<li>Navigate to the folder you want to store the code using the <kbd>cd</kbd> command.</li>
<li>Run the command "<kbd>hg clone http://hg.mozilla.org/chatzilla</kbd>" - this will take a short while.</li>
</ol>
<h3>Without Mercurial</h3>
<ol>
<li>Download the <a href="http://hg.mozilla.org/chatzilla/archive/tip.zip">ZIP archive</a>.</li>
<li>Extract the files into the folder you want to store the code.</li>
</ol>
<h2>2. Make locale directory</h2>
<p>
To get started on your localization, copy the <samp>locales/en-US</samp> directory to <samp>locales/<var>ab-CD</var></samp>. Remember that <var>ab-CD</var> should be named after the language code of the locale you're writing a localization for.
</p>
<h2>3. Localize files</h2>
<p>
You need to localize the following files:
</p>
<ul>
<li><samp>locales/<var>ab-CD</var>/chrome/chatzilla.properties</samp></li>
<li><samp>locales/<var>ab-CD</var>/chrome/*.dtd</samp></li>
<li><samp>locales/<var>ab-CD</var>/defines.inc</samp></li>
</ul>
<p>
While you are localizing these files, please remember:
</p>
<ul>
<li><strong>Do</strong> open and save all files as UTF-8 without BOM.</li>
<li><strong>Do</strong> localize entries of the form <samp>cmd.<em>something</em>.help</samp> as these are the command descriptions shown to the user.</li>
<li><strong>Do not</strong> localize entries of the form <samp>cmd.<em>something</em>.params</samp> as these are the parameters for commands, which need to match up to the code.</li>
<li><strong>Do not</strong> change <samp>locale.version</samp> as this is necessary to detect mismatched language packs. There are further details of this requirement in comments at the begginning of <samp>chatzilla.properties</samp>.</li>
<li><strong>Do</strong> keep up with new versions of ChatZilla, if you can. The <a href="https://james-ross.co.uk/mozilla/chatzilla/nightly/">ChatZilla nightly builds</a> page may be helpful, as it lists which files have changed - search for "<kbd>locales/en-US</kbd>" to find all potentially relevant changes. You are welcome to linger in <a href="irc://irc.mozilla.org/chatzilla">#chatzilla</a> as well.</li>
<li><strong>Do</strong> keep archives/copies of localization releases you have made, in case you need to refer back to them.</li>
</ul>
<h2>4. Make locale package</h2>
<p>
You can create a locale package at any time to check how things are coming along, or when you're done. Please note that this will <strong>overwrite</strong> a locale package of the same language and version.
</p>
<ol>
<li>Open a terminal or Command Prompt.</li>
<li>Navigate to the <samp>xpi</samp> folder inside the ChatZilla code using the <kbd>cd</kbd> command.</li>
<li>Run the command "<kbd>python makexpi.py <var>ab-CD</var></kbd>".</li>
</ol>
<p>
If all goes well, a <samp>xpi/chatzilla-<var>ab-CD</var>-<var>version</var>.xpi</samp> file will be created. This file installs <strong>only</strong> your localization - that means users will have to install ChatZilla separately. It can also be used by SeaMonkey users to localize their preinstalled ChatZilla.
</p>
<h2>5. Test your localization</h2>
<ol>
<li>In the host application (Firefox, SeaMonkey, etc.), open the <samp>xpi/chatzilla-<var>ab-CD</var>-<var>version</var>.xpi</samp> file, e.g. from the menu "<kbd>File > Open File...</kbd>".</li>
<li>Restart the host application and open ChatZilla.</li>
<li>Check that all strings fit in the space that they are given.</li>
<li>Check that all <samp>%S</samp> replacements are working correctly.</li>
<li>Check that each accesskey is used only once in each menu.</li>
<li>...and all the usual localization checks.</li>
</ol>
<h2>6. Distributing your localization</h2>
<p>
When you think you have fixed all possible bugs in your localization, you might want to consider releasing it to the public.
</p>
<ul>
<li>You could ask an admin of a local Mozilla community site to upload your language pack to their server.</li>
<li>You could upload it to the official <a href="https://addons.mozilla.org/">Mozilla Add-ons site</a>.</li>
<li>You can ask in <a href="irc://irc.mozilla.org/chatzilla">#chatzilla</a> to have a link added to the official homepage. You can also do this by <a href="https://github.com/twpol/cz-homepage/blob/master/index.html">creating a pull request for the homepage in GitHub</a>.</li>
</ul>
<h2>Appendix: Bundling your localization with SeaMonkey</h2>
<p>
It is possible to ship your ChatZilla localization with <a href="http://www.seamonkey-project.org/">SeaMonkey</a> for an even more complete Internet experience. Just follow these steps.
</p>
<h3>1. Get a copy of the l10n repository for your locale</h3>
<p>
Installing Mercurial was optional in the previous section, but here it's mandatory. After installing it, open a terminal, navigate to a directory where you want to save the l10n repository, and execute the following command:<br>
<br>
<kbd>hg clone http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD</kbd><br>
<br>
Note that some locales might not have the -CD part here.
</p>
<h3>2. Make a Mercurial patch containing your localization work</h3>
<p>
Copy the <tt>ab-CD</tt> subdirectory from the <tt>locales</tt> directory in the <tt>chatzilla</tt> repository to the <tt>extensions</tt> directory in the l10n repository (you'll need to create the <tt>extensions</tt> directory if it doesn't exist) and rename the new copy from 'ab-CD' to 'irc'. After doing so, open a terminal, navigate to the l10n repository and execute the following command:<br>
<br>
<kbd>hg diff > /%S/chatzilla-locale.patch</kbd><br>
<br>
where %S is the path to your desktop. This will create a file that, in Mercurial terminology, is called a "patch".
</p>
<h3>3. Create a bug to get the patch into Mercurial</h3>
<p>
Create yourself an account on <a target="_blank" href="https://bugzilla.mozilla.org/">Mozilla's Bugzilla</a>, then <a target="_blank" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Mozilla%20Localizations">file a bug</a>.
<ul>
<li>Choose your locale from the 'Component' menu.
<li>In the 'Description' field, ask someone who has Mercurial access to upload the patch to Mercurial.
<li>Attach the patch file by pressing the 'Add an attachment' button.
</ul>
Finally, press the 'Submit Bug' button. You will receive an email notification when someone has uploaded the patch.
</p>
<h3>4. Create a bug to get your locale built</h3>
<p>
Wait for someone to upload the patch to Mercurial, then <a target="_blank" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=SeaMonkey&component=Build%20Config&version=Trunk">file another bug</a>.
<ul>
<li>In the 'Summary' field, type "Add ab-CD to ChatZilla all-locales".
<li>This time you can leave the 'Description' field empty.
</ul>
</p>
<h3>5. Download SeaMonkey with ChatZilla</h3>
<p>
Once your locale has been added to all-locales, you could either try a nightly build, or wait for an official release.
</p>
</div>
<div id="footer">
<script type="text/javascript">writeFooter();</script>
</div>
</body>