Moregroupware lang-file

The Moregroupware language file conists of 2 parts, the key and the text. The parts are seperated by an equal (=) sign. Below is a simple example of an english and a german language file:

english lang-file from calendar module (calendar.en.lang)

collisionwith = collision with
      date = Date
      dateconflict = dateconflict
      desc = Description
      dobook = book
    

german lang-file from calendar module (calendar.de.lang)

collisionwith = kollidiert mit
      date = Datum
      dateconflict = Terminkonflikt
      desc = Beschreibung
      description = Beschreibung
      dobook = buchen
    

As you can see only the right side of the "=" sign will be modified. So if you want to create a new language file for a module or for all modules, you must copy an existent lang file you understand (i assume english) to a new file named calendar.it.lang, if you want to translate to italien, or to calendar.ru.lang if you want to translate to russian. Then modify the file and edit the text on the right of the "=" sign on each line.

Using newslines for long text

As you can see, this is not very comfortable for long texts, because you may have to scroll to the right if you have two or more sentences. Because of this you can insert newline and continue your text on the next line, the following example demonstrates this:

collisionwith = collision with
        another appointment, and this is not all. There was also a collision with my
        car the morning before, but this is only important to mention because
        i want to insert a really long text for the keyword collisionwith
        date = Date
      

You can see that the key "collisionwith" has a very long text and in fact it doesnt matter, moregroupware will handle this situation without any problems.

Variables inside lang files

The moregroupware framework is capable of having variables inside text. This is very important because when moregroupware wants to display something like: "User Thomas Smith found 10 Contacts from 122", the text consists of normal text which must be translated and of variable parts like username (Thomas Smith) and records found (10 and 122). In order to handle this, the lang file can look like the following example:

myheader = User <$1> found <$2> Contacts from <$3>

or the german one:

myheader = Benutzer <$1> hat <$2> Kontakte von <$3> gefunden

Here you can see that moregroupware has no problems with different sentence structures, because you can place the variables wherever you want.