%META:TOPICINFO{author="AdamHyde" date="1207346483" format="1.1" version="1.2"}%
---+!! !LocalizeContrib

This contrib enables the editing of .po files for translating the TWiki interface. Conceivably this package could also be used for translating any type of .po file.

It supports UTF-8. Version with right-to-left character support is coming.

Using this contrib you can also create new language translations, and edit skin CSS and Images directly. The later is in recognition that some images have text in them that need translating, and some language implementations will need changes to the CSS for layout.

The inline CSS editor and image management can be used to change the Skin look and feel live. In the set-up we have currently you do this for the english (default lang) by choosing the 'en.po' file and going to the "IMAGES & CSS" section. 

%TOC%

---++ Overview
<strong>Localize</strong> is a simple mechanism for translating the interface of TWiki. This enables the creation of different language versions. 
<p><img title="localize" alt="localize" src="http://en.flossmanuals.net/publish/FLOSSManuals/rsrc/FLOSSManuals/localize/localize.png" height="314" width="600">
</p>
<p>The above is the 'front page' of our localize tools. These tools help you translate the interface of TWiki into other languages. Please note, this is not the same as translating the content of Topics - the developers (FLOSS Manuals) have another plugin called 'XchangeTranslate' for this purpose.
</p>
<p><strong>Localize</strong> uses Mochikit for the dymanic loading of language variables into memory. This means that you can fast forward through the strings to be translated without the need to reload and save content as you go. Hence the interface is very fluid and fast, and feels more like a desktop application than a webpage. Pre-loading of the variables is done in stages so the browser does not time-out over slow connections.

---++ Detailed Documentation
<!-- use %$POD% when using with Build module to automatically extract documentation -->
Below is the documentation about Localize which was written for its implementation in the developers site. It gives a good idea of how the contrib works from a users point of view.
<br><br>
<div id="flossembed" style="border:1px solid #ff7f00;width:834px;height:750px;"/>
<script>
var FLOSSConfig = {'style': {"frame":"position:relative;left:2px;top:0px;margin-left:0px;width:680px;padding:0px;frame-border:0px;border-width:0px;height:750px;","embed":"font-size: 10px;font-family: Arial,verdana, sans-serif; font-weight: bold; line-height:14px;height:750px;width:845px;"}, 'config': {"width":"835px","indexwidth":"160px","height":"750px"}, 'pages': [["FLOSSManuals", "LocalizeIntro", "INTRODUCTION", 1], ["FLOSSManuals", "LocalizeStart", "GETTING STARTED", 1], ["FLOSSManuals", "LocalizePO", "TRANSLATION", 1], ["FLOSSManuals", "LocalizeImages", "IMAGES & CSS", 1]], 'title': 'LOCALIZE'};
</script>
<script type="text/javascript" src="http://en.flossmanuals.net/floss/pub/TWiki/MochiKit/MochiKit.js"/>
<script type="text/javascript" src="http://en.flossmanuals.net/js/embed.js"/>
</div>



---++ Future Developments
We have thought of several ways to extend this which we would like to work on - if you are a developer then perhaps you may also wish to consider these:
   * enable the translation of any .po files for any software project (you can do this now by manually uploading to the locale dir)
   * enable form based upload of .po files
   * ability to add fields (strings) for translation
   * version control and roll backs
   * file locking to avoid editing conflicts
   * easy permissions control
   * marking a status on translated items (for proofing, editing, and checking purposes)
   * admin ability to update TWiki .po files with new MAKETEXT variables from the browser
   
Additionally, it would be useful to work out a nice way for TWiki to be able to change Skin directories depending on the viewing language loaded. Currently we add the 2 letter language suffix to a skin directory (eg <nop>ClassicSkinhr</nop>, <nop>PatternSkinde</nop> etc). It would be good if TWiki changed Skin directories to the appropriate directory when a new viewing language was chosen. Ideally, if that directory did not exist TWiki could default to the non-suffixed Skin directory name.

---++ Thumbs Up
Thumbs up to Pootle and its developer Dwayne Bailey. We had a good look at Pootle before building this plugin. Pootle gave us a lot of insights into how to go about the structure. We would have, infact, used Pootle ourselves except we wanted a solution that was integrated with TWiki and could deal with inline editing of Skins.

See Pootle here:
   * http://pootle.locamotion.org/


---++ Settings

Add the following to your <nop>LocalSite.cfg</nop> :
<verbatim>
# Put the full path to your twiki installation directory
$TWiki::cfg{InstallDirectory} = '/var/www/twiki';
$TWiki::cfg{DefaultLanguage}  = "en";
$TWiki::cfg{UserInterfaceInternationalisation} = 0;
</verbatim>

You will also need to create a preference in Main WebPreferences to state who can access Localize. eg.
<verbatim>
      * set ALLOWLOCALIZE = AdamHyde,  AleksandarErkalovic
</verbatim>

---++ Installation Instructions

__Note:__ You do not need to install anything on the browser to use this contrib package. The following instructions are for the administrator who installs the package on the server where TWiki is running.

   * Download the ZIP file from the Plugin web (see below)
   * Unzip ==%TOPIC%.zip== in your twiki installation directory. Content:
     | *File:* | *Description:* |
     | ==data/TWiki/%TOPIC%.txt== | Contrib topic |
     | ==data/TWiki/%TOPIC%.txt,v== | Contrib topic repository |
     | ==lib/TWiki/Contrib/%TOPIC%.pm== | Contrib Perl module |
     | ==bin/localize== | binary |
     | ==templates/localize.tmpl== | template file |
     | ==pub/TWiki/MochiKit/== | Mochikit js lib |
     | ==pub/TWiki/LocalizeContrib/translate.gif== | skin |
     | ==pub/TWiki/LocalizeContrib/typography_cover.css== | skin |
<!-- replace table body above, keeping the header, with %$MANIFEST% when using with Build module to automatically extract MANIFEST -->


---++ Contrib Info

|  Author: | TWiki:Main/AleksandarErkalovic |
|  Copyright &copy;: | <!-- e.g. "2004, SlobSoft Gmbh, All Rights Reserved" --> |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Dependencies: | none <!-- use %$DEPENDENCIES% with the Build Module to auotmatically extract dependencies --> |
|  Version: | <!-- use %$VERSION% with the Build module to auto-extract from the .pm --> |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  02 Apr 2008: | Initial version |
|  Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |
|  Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal |

__Related Topics:__ %TWIKIWEB%.TWikiPreferences

-- TWiki:Main/AdamHyde - 02 Apr 2008
<!-- replace 02 Apr 2008 with %$DATE% for Build module, to get build date -->
%META:FILEATTACHMENT{name="translate.gif" attr="" comment="image for template" date="1078005104" path="translate.gif" size="1233" version="1.1"}%
%META:FILEATTACHMENT{name="typography_cover.css" attr="" comment="image for template" date="1078005104" path="typography_cover.css" size="3032" version="1.1"}%

