This is the code documentation for the Pelzini project

file /viewer/i18n.php

Namespace: viewer

View source

This is a set of functions for internationalisation.

The main functions are:
  loadLanguage for loading a language file
  str for returning a language string
  setParam for manually setting a replacement parameter
  clearParams for clearing all replacement parameters




Clears all named parameters that are used by the str function


Returns the original string from the string table, without any parameter replacement


Loads a language file

If you are using a language which may not be complete, it is advisable
to load another language which you know is complete first (e.g. English)
This will prevent empty strings being returned.


Replaces params in strings

Replacements can be in the following forms:
  Does a replacement with a named parameter, PARAM, specified in any case

  Does a replacement with SINGLE if PARAM (any case) is 1, and with MULTIPLE if PARAM is anything else

  Adds a new line to the output

  Returns the specified parameter, urlencode()ed.

  Returns the specified parameter, htmlspecialchars()ed.


Does the actual legwork for param_replace


Sets a named param for use by the str function


Outputs a string, and sets arguments

This function also allows additional functions after the string constant, printf style.
Because the language system uses named arguments, arguments should be specified in pairs
The first argument should be the param name, the second argument should be the param