gecko-dev/l10n/tools/mozexptool/index.htm

216 строки
9.9 KiB
HTML

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="Jordi Mas">
<meta name="GENERATOR" content="Mozilla/4.6 [ca]C- Softcatala (Win95; I) [Netscape]">
<title>MozExpTool</title>
</head>
<body>
<a href="http://www.softcatala.org"><img SRC="softcatala.jpg" height=48 width=117></a>
<p><b>MozExpTool 0.91 - A Localisation tool for the Mozilla 5.0 project</b>
<p><b>1. Introduction</b>
<p>MozExpTool is the tool that we are using at <a href="http://www.softcatala.org">SoftCatal&agrave;
</a>to
produce the Catalan version of Mozilla. This tool
<br>has been written for our internal use and we are releasing the code
because we think that it may be
<br>useful for other people creating localised versions of <a href="http://www.mozilla.org">Mozilla</a>.
<p>MozExpTool allows you to create text files (we call them glossaries)&nbsp;
from dtd/xul files which you can them give
<br>to translators then they rather than have them working with dtd/xul
files. When the translators have finished their
<br>translations you can reimport them into the dtd/xul files.
<p>In addition to simplifying the translator's work, MozExpTool allows
to leverage (recover previous
<br>translations). You can easily create a glossary file from the old version,
and then reimport it to the set of
<br>dtd/xul files. When leveraging, we take in account the context of the
translation, that is, the file that it is coming
<br>from and the name of the entity.
<p>If you want to download MozExpTool, here you have the files:
<p><a href="mozexptool091src.zip">mozexptool091src.zip</a> - The complete
Visual C++6 project
<br><a href="mozexptool091.zip">mozexptool091.zip</a>&nbsp; -&nbsp; The
binary file for win32 platform
<p><b>2. Functionality</b>
<p><b>2.1. Exporting the localisable text</b>
<p>This function generates a plain text file with all the localisable text
contained in the Mozilla resource files.
<br>This is useful if you need to spell check the text once the translations
have finished or if you want to generate a
<br>list of all the English terms to enable the creation of a glossary.
Because this options indicates the word counting
<br>for every file, it can also be used to identify the files that contain
localisable text during the localisation
<br>analysis process.
<p>For example, to export the localisable text of all the *.dtd files located
in d:\testing\mozilla into
<br>a file called export.txt you should type:
<p>mozexptool -wd:\testing\mozilla\*.dtd -oexport.txt
<p>If you want to export the localisable text in the file downloadprogress.xul
into the file down.txt,
<br>you should type:
<p>mozexptool -xdownloadprogress.dtd -odown.txt
<p><b>2.2.Simulate translation</b>
<p>This option changes all the given files and simulating that the program
has been localised. The
<br>function SimLocStr implements the string localisation routine, right
now it just adds some text
<br>to allow the identificaction of&nbsp; the hardcoded text. You can change
this routine to implement a more
<br>accurate simulation of your language.
<p>mozexptool -s:d:\testing\mozilla\*.dtd
<br>mozexptool -s:d:\testing\mozilla\*.xul
<p>That's what my current build looks like:
<p><img SRC="simulated.gif" height=380 width=584>
<p>Note: since we do not yet support property files yet some of the strings
that appear as not
<br>localised may come from those files.
<p><b>2.3 Leveraging from an Ascii delimited glossary</b>
<p>If you have localised Netscape 4.x you can use this option to recover
your previous translation. Use your
<br>favourite localisation tool to generate an ascii delimited glossary
following this format:
<p>"source term", "target term", "other stuff"
<p>This file should contain a term per line, the first term is the source
term and the second the
<br>localised one. The rest of the fields after the second one are ignored.
Quoted comma (")
<br>is assumed to be the text delimited when needed it.
<p>You can modify the source code to add support to your variation of the
standard delimited
<br>glossary format. See the function LoadDelimitedForLeverage.
<p>For example, if you have your Netscape 4.x translations in a delimited
ascii glossary and
<br>you want to leverage then over your copy of mozilla located at d:\testing\mozilla
you
<br>should type:
<p>mozexptool.exe -kglos46.txt -ld:\testing\mozilla\*.dtd
<p>We recommend to remove the hotkeys when generating the glossary.
<p><b>2.4 Creating a glossary</b>
<p>In order to deliver files to translators we need a format that is more
suitable that editing DTD or XUL
<br>files. We created a text file from a single or a group of xul/dtd files.
This file can be easily translated and
<br>then they can be imported back to the XUL files.
<p>The glossary file has the following format:
<p>1,"browserCmd.label","bin\chrome\navigator\locale\en-US\viewSource.dtd"
<br>"New Browser Window"
<br><b>"New Browser Window"</b>
<p>The first line contains the context information that MozExpTool uses
to reimport the translations.
<br>The number at the beginning of the line is simply a sequential number
to give the translators an easy way
<br>to identify each translation unit contained in the glossary. This number
is there only for reference proposes
<br>only, it's not use as part of the context.
<p>The second line contains the source term, usually English. It is always
included to give the translator and
<br>proof-readers the source term. The source term is also use as reference
during the leverage.
<p>The third line (the line in bold) contains the translated term, by default
is equal to the source one. The translator
<br>should just replace it by the proper translation.
<p>This is what this translation unit will look like when it's translated:
<p>1,"browserCmd.label","bin\chrome\navigator\locale\en-US\viewSource.dtd"
<br>"New Browser Window"
<br>"Nova finestra del navegador"
<p>The translator can use all the characters that are required to represent
his/her language and they can
<br>be later converted to the proper entities when we leverage from the
translated glossary. See
<br>entities.h for a complete list of supported entities.
<p>It is very important that the translators does not delete the context
information, the source term
<br>or any other part of the translation unit, the translator should just
translated the last line and
<br>preserve the original format of the file.
<p>Let's look at a real word example. If we want to create a glossary for
a translator taking a source group of
<br>files the dtd files located at d:\mozilla\bin and to store the glossary
in a file called translator.txt, and our
<br>original set of English mozilla files is in d:\testing\mozilla.org\
we should type:
<p>mozexptool.exe -ud:\testing\mozilla.org\*.dtd -xd:\mozilla\bin\*.dtd
-otranslator.txt
<p>It is very important the you always keep a copy of the original Mozilla
resource files
<br>to be able to use the as the source reference during the glossary generation.
As soon you install
<br>the build that you want to localise make a copy of all the xul/dtd
files in another directory
<br>in the same directory level and with the same directory structure.
<p><b>2.5 Leveraging from exported glossaries</b>
<p>Once the translator has finished the translation you can reimported
easily. For example,
<br>to import a file called translator.txt into the Mozilla files again,
just type:
<p>mozexptool -ld:\testing\mozilla\*.dtd -ltrans.txt
<p>Assuming that d:\testing\mozilla is the place where you have the files.
<p>When doing the leverage MozExpTool uses the entity name and the filename
to give
<br>a context to every translation. If you wish you can use the parameter
-z and the filename
<br>will not be use as part of the context, then just the entity name will
be use.
<p><b>2.6 Leveraging from one build to other</b>
<p>Imagine that you have a complete or partially translated build and you
want to recover
<br>the translations into a new build. You should follow these steps:
<p>1. Make sure that both builds are in directories at the same levels
with identical
<br>directory structures. Use the parameter -z if for any reason the name
of the files
<br>have changed or your directory structure does not match.
<p>2. Generate a glossary from the old build following the steps described
in section
<br>2.4
<p>3. Now, leverage the glossary that you just have created from the old
build into
<br>the new build following the steps described in section 2.5.
<p>Do not forget to repeat this process for xul and dtd files if your build
contains
<br>localisable data in both. You can use the -a if you want to leverage
your localised
<br>map keyboard settings.
<p><b>3. Notes</b>
<ul>
<li>
By default MozExpTool ignores all the entities that contain in their names
the string '.accesskey'</li>
<br>because those settings are usually adjust by the engineer and not by
the translation. If you use
<br>the parameter -a those entities will be included in all operations.
<br>&nbsp;
<li>
Use full paths within the parameters x and u when creating a glossary.
Both paths</li>
<br>have to be at the same level, that is, d:\mozilla and d:\mozilla.org.
We use the filenames
<br>as part of the context in the leverage process.</ul>
<p><br><b>4. Enhancements, bug fixes, new versions</b>
<p>Known issues:
<p>- MozExpTool has only been tested in ISO-8859-1
<br>&nbsp;- It only compiles in Win32, but with minor changes you should
be able to compiled under
<br>other platforms, because I kept away from specific win32 functionality.
MozExpTools
<br>- It has only been tested with Mozilla build 1999071417 and M9.
<br>- There is no support for property files yet
<br>- To specify more than once file the paths should end with a *.extension,
that is,
<br>d:\test\*.xul, d:\test\*.ppr, etc. You should use the form *.xxx.
<br>&nbsp;
<p>We will continue to develop MozExpTool to cover our needs regarding
the localisation into
<br>Catalan of Mozilla 5.0. We will always endeavour to fix any reported
bug.
<p>Jordi Mas
<br><a href="mailto:jmas@softcatala.org">jmas@softcatala.org</a>
</body>
</html>