Next Previous Contents

7. Using Language Support

7.1 Overview

phpGroupWare is built using a multi-language support scheme. This means the pages can be translated to other languages very easily. It is done thru a series of lang files, which can be translated and selected by the user.

7.2 How to use lang support

Some instructions on using the lang files.
Under inc/lang there needs to be a sub-directory for each langague. Inside the directory there are a number of files for each application. There is one common file which contains a list of words that all applications use. ie, add, delete, edit, etc...
Words that are specific to a application should be stored with that applications include file.


  function lang_todo($message, $m1 = "", $m2 = "", $m3 = "", $m4 = "")
  {
    $message = strtolower($message);
    switch($message)
    {
       case "urgency": $s = "Urgency"; break;
       case "completed": $s = "completed"; break;
       [ snip ]
       default: $s = "<b>*</b> " . $message;
    }
    return $s;
  }
  

The list of words in the left column should always be written in english. The second column is used to return those words in that includes language. $m1, $m2, $m3, and $m4 are used to pass extra data to be place in the middle of a sentence.
For example:
You have 29 new messages!
The default should return a bold faced * and the word that wasn't found. This allows users to notice that something is missing in the files and make changes if necessary.
Next Previous Contents