01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Edit Render.pm<br />

Adapt Twiki.cfg<br />

248<br />

��<br />

��<br />

��<br />

Now you have to edit <strong>the</strong> file Render.pm in <strong>the</strong> directory lib/TWiki.<br />

From line 40 on, add <strong>the</strong> following (bold) commands:<br />

1 use TWiki qw(:renderflags ↵<br />

2 %regex $TranslationToken);<br />

3<br />

4 # ===========================<br />

5 # Read <strong>the</strong> configuration file at compile<br />

6 # time in order to set locale<br />

7 BEGIN {<br />

8 do "Twiki.cfg";<br />

9 # Do dynamic 'use locale' for this module<br />

10 if( $TWiki::useLocale ) {<br />

11 require locale;<br />

12 import locale ();<br />

13 }<br />

14 }<br />

15<br />

16 # Globals used in rendering<br />

17 use vars qw(<br />

This enables local information from Twiki.cfg to be read. Of course,<br />

it has to be indicated <strong>the</strong>re. To do so, you only have to change <strong>the</strong><br />

content of two variables. For instance, for <strong>the</strong> German language version,<br />

set <strong>the</strong> following:<br />

$useLocale = 1;<br />

$siteLocale = "de_DE.ISO-8859-1";<br />

The country code must, of course, be adjusted with regard to language.<br />

If you enter <strong>the</strong> links described above, it should be displayed<br />

correctly.<br />

16.2.2<br />

Translations<br />

There is currently no official published translation of TWikis in<br />

o<strong>the</strong>r languages. However, you have <strong>the</strong> possibility of creating your<br />

own skins that also include text in o<strong>the</strong>r languages (see <strong>the</strong> example<br />

for German above). Admittedly, this is very laborious. On <strong>the</strong> page<br />

http://twiki.org/cgi-bin/view/Codev/TranslationSupport, you will<br />

find fur<strong>the</strong>r tips on translations.<br />

16 Designing a TWiki

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!