forked from twpol/cz-homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocalization.html
141 lines (141 loc) · 10.8 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
<!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>
So, you want to try and localize ChatZilla? Good on you! This page is here to try and give you an idea how to go about things. If you have questions, or just trouble getting things to work at all, feel free to drop by on <a href="irc://irc.mozilla.org/chatzilla">#chatzilla on moznet</a> and ask.
</p>
<h2>What this page is</h2>
<p>
This page aims to give you an idea of the easiest way to make a language pack for ChatZilla. It doesn't require much setting up on any major platform.
</p>
<h2>What this page is not</h2>
<p>
This page does NOT provide all-out guides to Python, Mercurial, or language problems (wording choices etc.) If you need help with Mercurial, <a href="https://developer.mozilla.org/en/mercurial">check out this</a>. It also doesn't apply to localizing SeaMonkey - if you want help with that, the <a href="https://wiki.mozilla.org/SeaMonkey:Localization">Mozilla Wiki</a> is the right site for you.
</p>
<h2>Definitions</h2>
<p>
Throughout this guide, 'ab-CD' means the locale code for your localization. That means that, if you were to localize ChatZilla into French or German, you would replace it with 'fr-FR' or 'de-DE', respectively.
</p>
<h2>Requirements for the method described below</h2>
<p>
On Windows, Linux, or OS X, the only required software package is <a href="http://www.python.org/">Python</a>. It is also recommended to install <a href="http://mercurial.selenic.com/">Mercurial</a> for keeping in line with development. After installing them, you will probably want to add yourself in the <a href="https://wiki.mozilla.org/L10n:Teams">Localization Teams</a> section of the Mozilla Wiki so that the l10n leads know whom to assign bugs when something is not as it should be.
</p>
<h3>1. Get the source code</h3>
<h4>With Mercurial</h4>
<p>
First things first: make sure you have Mercurial and Python installed, and open a terminal:
</p>
<h5>On Windows:</h5>
<p>Start > Run > Type '<kbd>cmd</kbd>' in the box and press Enter</p>
<h5>On Mac:</h5>
<p>Applications > Utilities > Terminal</p>
<h5>On Linux/Unix:</h5>
<p>Linux and Unix users should be so familiar with terminals that I need not explain it here.</p>
<p>
Once you have opened a terminal, navigate to a folder where you want to store your localization work using the '<kbd>cd</kbd>' command. Then execute the following command:<br>
<br>
<kbd>hg clone http://hg.mozilla.org/chatzilla</kbd><br>
<br>
This will get you the ChatZilla source. You'll see a few messages, and after a (hopefully short) while it will be done.
</p>
<h4>Without Mercurial</h4>
<p>
If you do not wish to use Mercurial for getting the source code and maintaining your localization, you can just download the ChatZilla source code <a href="http://hg.mozilla.org/chatzilla/archive/tip.zip">as a .zip archive</a>.
</p>
<h3>2. Make a locale directory</h3>
<p>
To get started on your localization, you'll want to copy the <tt>en-US</tt> directory in the <tt>locales</tt> directory into a new subdirectory there. The new subdirectory should be named after the language code of the locale you're writing a localization for.
</p>
<h3>3. Localize all the files in your new directory</h3>
<p>
The single <tt>chatzilla.properties</tt> file and all the <tt>.dtd</tt> files will need to be localized in order for your localization to be complete. The <tt>chatzilla.properties</tt> will probably take the longest time to localize because it's so big. To get things right, there are a couple of things you need to keep in mind:
</p>
<ul>
<li><strong>NEVER</strong> localize the cmd.<var>something</var>.params strings. These are for internal use, translating them will prevent the use of those commands! You can, however, translate the cmd.<var>something</var>.help strings. These will be useful to users when they are unsure of what a certain command does. </li>
<li>Do <strong>NOT</strong> change the locale.version string. This too is for internal use. For more information, please refer to the comment at the top of the <tt>chatzilla.properties</tt> file. </li>
<li>Keep up with changes in ChatZilla. There should be new releases every now and then. Lingering in #chatzilla on moznet when on IRC is probably the best way of getting an idea when these are going to happen. We will release from the code in Mercurial (you know, where you got your source code from) every now and then. It would be wise to archive releases you have made yourself, and keep up with development on Mercurial. Silver (James Ross) has made a <a href="http://twpol.dyndns.org/mozilla/chatzilla/nightly">nifty page</a> which will list any locale changes made to the ChatZilla code. </li>
</ul>
<h3>4. Make a locale package</h3>
<p>
When you're done localizing, or just want to try if things work, you can make a language pack for ChatZilla by opening a terminal in the <tt>xpi</tt> directory in the source code, and using the following command:<br>
<br>
<kbd>python makexpi.py ab-CD</kbd><br>
<br>
If all goes well, you will see a few messages appear in your terminal (but no errors), and a chatzilla-<var>locale</var>-<var>version</var>.xpi file will be created in the <tt>xpi</tt> directory.<br>
<br>
This xpi file installs <strong>only</strong> your localization - that means that users will have to have installed the ChatZilla code from the website. It can also be used by SeaMonkey users to localize their preinstalled ChatZilla.
</p>
<h3>5. Test out your localization</h3>
<p>
Open the language pack in the host application (the program you use ChatZilla in). For Firefox and SeaMonkey, the directions are the same: select 'Open File' from the 'File' menu, choose your language pack file, and restart the application.<br><br>
Then, open ChatZilla and check out some things:
<ul>
<li>that all strings fit in the space that they are given,</li>
<li>that all %S replacements work correctly,</li>
<li>that each accesskey is used only once in each menu, etc.; all the usual localization checks.</li>
</ul>
</p>
<h3>6. Start distributing your language pack</h3>
<p>
When you think you have fixed all possible bugs in your localization, you might want to consider releasing it to the public. You could ask an admin of a local Mozilla community site to upload your language pack to their server. Alternatively, you might upload it to the official <a href="https://addons.mozilla.org/">Mozilla Add-ons site</a>. Finally, you can ask the ChatZilla web admin to add a link to the site your language pack has been published on.
</p>
<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>