Your browser must have JavaScript enabled in order to view this page.
 >  >
 
Welcome Guest#3511 Login/register    Go to Bottom
Go to Top
 > Action System   DutchPIPE Issues >
Translations

Translations

HOW TO USE I18N AND L10N SUPPORT

 > Introduction
 > Enabling Non-English Modes
 > New Translations
 > Speed
 > To do

Introduction

DutchPIPE now has some basic internationalization (I18N) and localization (L10N) support.

Currently, it is only possible to run a DutchPIPE site either in one language or the other: it is not yet possible for one user to see a page in one language and another user on the same page another language.

All texts in PHP objects which use the dp_text() function are translated, as well as text files such as .html page content. The dp_text() function is a layer over the PHP gettext() (or _() shortcut) function. DutchPIPE uses GNU gettext for I18N/L10N.

Enabling Non-English Modes

You must enable I18N/L10N in config/dpserver-ini.php.

Currently, there are two languages/regions:

  1. English (the default)

  2. Dutch/The Netherlands

New Translations

To make a new translation, make a directory in locale/ equal to the locale/en/ subdirectory tree, using the right language/region code in the same format as the nl_NL directory.

This isn't a manual to gettext, start at:

http://www.php.net/gettext

for PHP gettext documentation, pointers to GNU gettext documentation and links to language/region codes.

Then edit the translation table located at:

locale/<your dir>/LC_MESSAGES/messages.po

To complete, run:

msgfmt messages.po

in that directory, and a new messages.mo is created.

Then translate text files such as HTML files for pages and place them in locale/<your dir>/ using the same directory structure as under dpuniverse/ where the original English versions can be found. For example, the Dutch translation for:

dpuniverse/page/index.html

can be found in:

locale/nl_NL/page/index.html.

Make sure you've edited the gettext section in config/dpserver-ini.php so the server knows which language it should use.

All translations are optional, if you don't provide a line in messages.po or a text file, the English version is used, or whatever language you use when adding new stuff.

You don't need to add to messages.po or put files such as index.html in locale/ if you don't plan to contribute code to DutchPIPE and don't plan to provide more language options on your site in the future. In that case, just code your new objects and pages in the new language. Bits in English from the core system will be translated, and new stuff already in your language won't be touched.

If you have a new translation, please contribute it!

Speed

Although gettext is fast, it has of course a speed penalty and it is turned off by default in config/dpserver-ini.php. You won't notice under normal circumstances, but if you have a very busy server you'll hit your capacity ceiling sooner.

To do

Split messages.po into core translation and one or more other files.

A system to add stuff easily (better than msgmerge in one big file).

Multiple-languages within one site.

Provide static translations plus tools, for speed optimalization.


 > Action System   DutchPIPE Issues >

Documentation generated on Mon, 03 Sep 2007 22:18:08 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#3511
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.