mirror of
https://github.com/LibreOffice/loeclipse.git
synced 2025-07-25 15:02:58 +00:00
158 lines
5.4 KiB
HTML
158 lines
5.4 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
<title>Plugin Developer Documentation</title>
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
|
|
<meta name="description"
|
|
content="This document explains how to add a new implementation support and how to internationalize the plugin. This is a part of the plugin developer's documentation.">
|
|
<link href="../../styles.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084"
|
|
alink="#0000FF">
|
|
<div class="article" lang="en-GB">
|
|
<div class="titlepage">
|
|
<div>
|
|
<div>
|
|
<h1 class="title"><a name="id2472795"></a>Plugin Developer
|
|
Documentation</h1>
|
|
</div>
|
|
<div>
|
|
<h3 class="subtitle"><i>Extending the LibreOffice
|
|
integration plugin</i></h3>
|
|
</div>
|
|
<div>
|
|
<div class="abstract">
|
|
<p class="title"><b>Abstract</b></p>
|
|
<p>This document explains how to add a new implementation support
|
|
and how to internationalize the plugin. This is a part of the plugin
|
|
developer's documentation.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
</div>
|
|
<div class="section" lang="en-GB">
|
|
<div class="titlepage">
|
|
<div>
|
|
<div>
|
|
<h2 class="title" style="clear: both"><a name="id2494492"></a>Internationalizing</h2>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p>To bring the plugin to other languages, there are a few things to
|
|
do. Even if you have no knowledge of Java, internationalizing the plugin
|
|
will be easy, because there is no code to write or read. Here is a short
|
|
list of what to translate or change:</p>
|
|
<div class="itemizedlist">
|
|
<ul type="disc">
|
|
<li>
|
|
<p>the messages strings</p>
|
|
</li>
|
|
<li>
|
|
<p>the on-line help</p>
|
|
</li>
|
|
<li>
|
|
<p>some images</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section" lang="en-GB">
|
|
<div class="titlepage">
|
|
<div>
|
|
<div>
|
|
<h3 class="title"><a name="id2516693"></a>Language files</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p>First create a new plugin fragment using the <span class="strong"><strong>File
|
|
> New > Fragment project</strong></span> menu. In this tutorial, the project name
|
|
will be <code class="literal">org.libreoffice.ide.eclipse.core.nl</code>,
|
|
and the host plugin has to be <code class="literal">org.libreoffice.ide.eclipse.core</code>.
|
|
Then you will create the following structure:</p>
|
|
<p>We can distinguish three parts in this tree:</p>
|
|
<div class="mediaobject">
|
|
<table border="0" summary="manufactured viewport for HTML img"
|
|
cellspacing="0" cellpadding="0" width="246">
|
|
<tr style="height: 339px">
|
|
<td><img src="img/img001.png" width="246"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<p></p>
|
|
<div class="itemizedlist">
|
|
<ul type="disc">
|
|
<li>
|
|
<p>the <code class="literal">nl/fr</code> directory: contains all
|
|
the directories at the plugin root, i.e. <code class="literal">doc</code>.
|
|
This will reproduce each plugin directory and file with the translated
|
|
version. Note that the German translation would be located in the <code
|
|
class="literal">nl/de</code> directory and the fr_BE translation would
|
|
be in <code class="literal">nl/fr/BE</code> directory.</p>
|
|
</li>
|
|
<li>
|
|
<p>the <code class="literal">org</code> directory: reproduces all
|
|
the source tree. Then for each .property file containing strings to
|
|
translate, there will be a <code class="literal">_lang_REGION.properties</code>
|
|
file, e.g.: <code class="literal">messages_fr.properties</code>. To add
|
|
a German translation, simply add a <code class="literal">messages_de.properties</code>
|
|
file beneath the <code class="literal">messages_fr.properties</code>
|
|
file.</p>
|
|
</li>
|
|
<li>
|
|
<p>the <code class="literal">plugin_fr.properties</code> and <code
|
|
class="literal">about_fr.properties</code> files: contains all the
|
|
translated strings from the <code class="literal">plugin.properties</code>
|
|
and <code class="literal">about.properties</code> file of the host
|
|
plugin.</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<p>Note that the Plugin dependencies and JRE library could be remove
|
|
from the project class path as well as the initially created <code
|
|
class="literal">src</code> directory.</p>
|
|
</div>
|
|
<div class="section" lang="en-GB">
|
|
<div class="titlepage">
|
|
<div>
|
|
<div>
|
|
<h3 class="title"><a name="id2472908"></a>Packaging the language
|
|
data</h3>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p>Now that you have translated everything, you will have to package
|
|
you plugin fragment. For this, double click on the <code class="literal">META-INF/MANIFEST.MF</code>
|
|
file contained in the fragment and add the following items to the binary
|
|
build in the “<span class="strong"><strong>build</strong></span>”
|
|
tab:</p>
|
|
<div class="itemizedlist">
|
|
<ul type="disc">
|
|
<li>
|
|
<p><code class="literal">nl</code></p>
|
|
</li>
|
|
<li>
|
|
<p><code class="literal">org</code></p>
|
|
</li>
|
|
<li>
|
|
<p>all the translated <code class="literal">plugin.properties</code>
|
|
and <code class="literal">about.properties</code> files (i.e.: <code
|
|
class="literal">plugin_fr.properties</code> and so on)</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<p>Then you will have to build the plugin fragment. In the same
|
|
editor, select the “<span class="strong"><strong>Overview</strong></span>”
|
|
tab and click on the “<span class="strong"><strong>Export
|
|
Wizard</strong></span>” link. Just select the fragment and the destination file
|
|
before to click on “<span class="strong"><strong>Finish</strong></span>”:
|
|
you fragment is generated.</p>
|
|
<p>For the moment, there is no structure on the CVS to automate the
|
|
language fragments build: this will come later. But all the language
|
|
fragments will certainly be put together in one fragment as other
|
|
Eclipse plugins do.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|