FreeCAD-Doc/localwiki/Localisation.html
2018-07-08 12:11:49 -05:00

126 lines
14 KiB
HTML

<html><head><title>Localisation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type='text/css' href='wiki.css' rel='stylesheet'></head><body><h1>Localisation</h1></div>
<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><p><b>Localisation</b> is in general the process of providing a Software with a multiple language user interface. In FreeCAD you can set the language of the user interface under <i>Edit→Preferences→Application</i>. FreeCAD uses <a href="http://en.wikipedia.org/wiki/Qt_(toolkit)" class="extiw" title="wikipedia:Qt (toolkit)">Qt</a> to enable multiple language support. On Unix/Linux systems, FreeCAD uses the current locale settings of your system by default.
</p>
<div id="toc" class="toc"><div class="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#Helping_to_translate_FreeCAD"><span class="tocnumber">1</span> <span class="toctext">Helping to translate FreeCAD</span></a>
<ul>
<li class="toclevel-2 tocsection-2"><a href="#How_to_Translate"><span class="tocnumber">1.1</span> <span class="toctext">How to Translate</span></a></li>
</ul>
</li>
<li class="toclevel-1 tocsection-3"><a href="#Preparing_your_FreeCAD.2Fmaster_modules_for_translation"><span class="tocnumber">2</span> <span class="toctext">Preparing your FreeCAD/master modules for translation</span></a></li>
<li class="toclevel-1 tocsection-4"><a href="#Preparing_your_3rd_party_module_or_macro_for_translation"><span class="tocnumber">3</span> <span class="toctext">Preparing your 3rd party module or macro for translation</span></a></li>
<li class="toclevel-1 tocsection-5"><a href="#Older_module_translation_techniques"><span class="tocnumber">4</span> <span class="toctext">Older module translation techniques</span></a></li>
<li class="toclevel-1 tocsection-6"><a href="#Translating_the_wiki"><span class="tocnumber">5</span> <span class="toctext">Translating the wiki</span></a>
<ul>
<li class="toclevel-2 tocsection-7"><a href="#Translation_plugin"><span class="tocnumber">5.1</span> <span class="toctext">Translation plugin</span></a></li>
<li class="toclevel-2 tocsection-8"><a href="#Old_translation_instructions"><span class="tocnumber">5.2</span> <span class="toctext">Old translation instructions</span></a></li>
</ul>
</li>
</ul>
</div>
<h2><span class="mw-headline" id="Helping_to_translate_FreeCAD">Helping to translate FreeCAD</span></h2>
<p>One of the very important things you can do for FreeCAD if you are not a programmer, is to help to translate the program in your language. To do so is now easier than ever, with the use of the <a rel="nofollow" class="external text" href="http://crowdin.net">Crowdin</a> collaborative on-line translation system.
</p>
<h3><span class="mw-headline" id="How_to_Translate">How to Translate</span></h3>
<ul><li> Go to the <a rel="nofollow" class="external text" href="http://crowdin.net/project/freecad">FreeCAD translation project page on Crowdin</a>;</li>
<li> Login by creating a new profile, or using a third-party account like your GMail address;</li>
<li> Click on the language you wish to work on;</li>
<li> Start translating by clicking on the Translate button next to one of the files. For example, <i>FreeCAD.ts</i> contains the text strings for the FreeCAD main GUI.</li>
<li> You can vote for existing translations, or you can create your own.</li></ul>
<pre><b>Note</b>: If you are actively taking part in translating FreeCAD and want to be
informed before next release is ready to be launched,
so there is time to review your translation, please subscribe
to this issue: <a rel="nofollow" class="external free" href="http://www.freecadweb.org/tracker/view.php?id=137">http://www.freecadweb.org/tracker/view.php?id=137</a>
</pre>
<h2><span class="mw-headline" id="Preparing_your_FreeCAD.2Fmaster_modules_for_translation">Preparing your FreeCAD/master modules for translation</span></h2>
<p>These are the parts to the FreeCAD translation process:
</p>
<ul><li> extract text strings from source code into *.ts files</li>
<li> load *.ts files into <a rel="nofollow" class="external text" href="http://crowdin.net/project/freecad">FreeCAD Crowdin</a>.</li>
<li> translation of strings within Crowdin</li>
<li> extract modified/new *.ts files from Crowdin</li>
<li> convert *.ts files into *.qm files and update each module's *.qrc file</li>
<li> update FreeCAD master</li></ul>
<p>All of the above steps are performed by the "translation scripts" which are run by an administrator periodically.
</p><p>Preparing your module for translation is quite easy. First, you need to ensure that you have a "translations" directory in myModule/Gui/Resources. Then open a terminal window (or Windows/OSX equivalent) in your "translations" directory and enter the following command:
</p>
<pre>lupdate -ts myModule.ts </pre>
<p>This creates an empty translation file. Once this is done, you need to ensure that the translation scripts are updated as in this <a rel="nofollow" class="external text" href="https://github.com/FreeCAD/FreeCAD/pull/810">pull request</a>.
</p><p>Everything after this is automatic as far as a developer is concerned. The administrator will extract the text strings, the translators will translate them, then the administrator will extract the translations and update FreeCAD/master.
</p>
<h2><span class="mw-headline" id="Preparing_your_3rd_party_module_or_macro_for_translation">Preparing your 3rd party module or macro for translation</span></h2>
<p>3rd party modules or macros are translated in much the same fashion, except that you must do some of the work yourself.
This <a rel="nofollow" class="external text" href="https://www.forum.freecadweb.org/viewtopic.php?f=3&amp;t=25180">forum discussion</a> describes the details .
</p>
<h2><span class="mw-headline" id="Older_module_translation_techniques">Older module translation techniques</span></h2>
<p><a href="Localization_Older_Methods.html" title="Localization Older Methods">Localization Older Methods</a> describes the use of translation tools such as Qt Linguist, lupdate, lrelease, pylupdate4, etc in detail. Most of this is no longer required for FreeCAD/master modules, but may be helpful preparing and updating 3rd party modules.
</p>
<h2><span class="mw-headline" id="Translating_the_wiki">Translating the wiki</span></h2>
<p>This wiki is hosting a lot of contents, the majority of which build up the manual. You can browse the documentation starting from the <a href="https://www.freecadweb.org/wiki/index.php?title=Main_Page" title="Main Page">Main Page</a>, or have a look at the User's manual <a href="Online_Help_Toc.html" title="Online Help Toc">Online Help Toc</a>.
</p>
<h3><span class="mw-headline" id="Translation_plugin">Translation plugin</span></h3>
<p>When the Wiki moved away from SourceForge, <a href="https://www.freecadweb.org/wiki/index.php?title=User:Yorik" title="User:Yorik">Yorik</a> installed a <a class="external text" href="http://www.mediawiki.org/wiki/Help:Extension:Translate">Translation plugin</a> which allows to ease translations between pages. For example, the page title can now be translated. Other advantages of the Translation plugin are that it keeps track of translations, notifies if the original page has been updated, and maintains translations in sync with the original English page.
</p><p>The tool is documented in <a class="external text" href="http://www.mediawiki.org/wiki/Help:Extension:Translate">Extension:Translate</a>, and is part of a <a class="external text" href="http://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle">Language Extension Bundle</a>.
</p><p>To quickly get started on preparing a page for translation and activating the plugin, please read the <a class="external text" href="http://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example">Page translation example</a>.
</p><p>To see an example of how the Translation tool works once the translation plugin is activated on a page, you can visit the <a href="https://www.freecadweb.org/wiki/index.php?title=Main_Page" title="Main Page">Main Page</a>. You will see a new language menu bar at the bottom. It is automatically generated. Click for instance on the German link, it will get you to <a href="https://www.freecadweb.org/wiki/index.php?title=Main_Page/de" title="Main Page/de">Main Page/de</a>. Right under the title, you can read "This page is a <b>translated version</b> of a page Main Page and the translation is xx% complete." (xx being the actual percentage of translation). Click on the "translated version" link to start translation, or to update or correct the existing translation.
</p><p>You will notice that you cannot directly edit a page anymore once it's been marked as a translation. You have to go through the translation utility.
</p><p>When adding new content, the English page should be created first, then translated into another language. If someone wants to change/add content in a page, he should do the English one first.
</p><p>It is recommended to have basic knowledge of wiki style formatting and general guidelines of the FreeCAD wiki, because you will have to deal with some tags while translating. You can find this information on <a href="WikiPages.html" title="WikiPages">WikiPages</a>.
</p><p>The sidebar (navigation menu on the left) is also translatable. Please follow dedicated instructions on <a href="Localisation_Sidebar.html" title="Localisation Sidebar">Localisation Sidebar</a> page.
</p><p><b>REMARK: The first time you switch a page to the new translation system, it looses all its old 'manual' translations. To recover the translation, you need to open an earlier version from the history, and copy/paste manually the paragraphs to the new translation system.</b>
</p><p>Remark: to be able to translate in the wiki, you must of course <a href="/wiki/FAQ#How_can_I_get_edit_permission_on_the_wiki.3F" title="FAQ">gain wiki edit permission</a>.
</p><p><br />
If you are unsure how to proceed, don't hesitate to ask for help in the <a rel="nofollow" class="external text" href="http://forum.freecadweb.org">forum</a>.
</p>
<h3><span class="mw-headline" id="Old_translation_instructions">Old translation instructions</span></h3>
<table class="mw-collapsible mw-collapsed wikitable">
<tr>
<td>These instructions are for historical background only, while the pages are being passed to the new translation plugin.
</td></tr>
<tr>
<td>
<p>So the first step is to <b>check if the manual translation has already been started for your language</b> (look in the left sidebar, under "manual").<br />
If not, head to the <a rel="nofollow" class="external text" href="http://forum.freecadweb.org/">forum</a> and say that you want to start a new translation, we'll create the basic setup for the language you want to work on.<br />
You must then <a href="/wiki/FAQ#How_can_I_get_edit_permission_on_the_wiki.3F" title="FAQ">gain wiki edit permission</a>.<br />
If your language is already listed, see what pages are still missing a translation (they will be listed in red). The technique is simple: <b>go into a red page, and copy/paste the contents of the corresponding English page, and start translating</b>.<br />
Do not forget to include all the tags and templates from the original English page. Some of those templates will have an equivalent in your language (for example, there is a French Docnav template called Docnav/fr). You should use <b>a slash and your language code</b> in almost all the links. Look at other already translated pages to see how they did it.<br />
Add a slash and your language code in the categories, like [[Category:Developer Documentation/fr]] <br />
And if you are unsure, head to the forums and ask people to check what you did and tell you if it's right or not.<br />
Four templates are commonly used in manual pages. These 4 templates have localized versions (Template:Docnav/fr, Template:fr, etc...)
</p>
<ul><li> <a href="https://www.freecadweb.org/wiki/index.php?title=Template:GuiCommand" title="Template:GuiCommand">Template:GuiCommand</a>&#160;: is the Gui Command information block in upper-right of command documentation.</li>
<li> <a href="https://www.freecadweb.org/wiki/index.php?title=Template:Docnav" title="Template:Docnav">Template:Docnav</a>&#160;: it is the navigation bar at the bottom of the pages, showing previous and next pages.</li></ul>
<p><b> Page Naming Convention </b><br />
Please take note that, due to limitations in the Sourceforge implementation of the MediaWiki engine, we require that your pages all keep their original English counterpart's name, appending a slash and your language code. For example, the translated page for About FreeCAD should be About Freecad/es for Spanish, About FreeCAD/pl for polish, etc. The reason is simple: so that if translators go away, the wiki's administrators, who do not speak all languages, will know what these pages are for. This will facilitate maintenance and avoid lost pages.<br />
If you want the Docnav template to show linked pages in your language, you can use <b>redirect pages</b>. They are basically shortcut links to the actual page. Here is an example with the French page for About FreeCAD.<br />
</p>
<ul><li> The page About FreeCAD/fr is the page with content</li>
<li> The page À propos de FreeCAD contains this code:</li></ul>
<pre>#REDIRECT [[About FreeCAD/fr]]
</pre>
<ul><li> In the About FreeCAD/fr page, the Docnav code will look like this:</li></ul>
<pre>{{docnav/fr|Bienvenue sur l'aide en ligne|Fonctionnalités}}
</pre>
<p>The page "Bienvenue sur l'aide en ligne" redirects to Online Help Startpage/fr, and the page "Fonctionnalités" redirects to Feature list/fr.
</p>
</td></tr></table>
<div style="clear:both"></div>
</div>
</div>
</div><div class="printfooter">
Online version: "<a dir="ltr" href="https://www.freecadweb.org/wiki/index.php?title=Localisation&amp;oldid=242538">http://www.freecadweb.org/wiki/index.php?title=Localisation&amp;oldid=242538</a>"</div>
<div id="catlinks" class="catlinks" data-mw="interface"></div><div class="visualClear"></div>
</div>
</div>
<div id="mw-navigation">
<h2>Navigation menu</h2>
</body></html>