updating oE lang_load


include locale.e 
namespace locale 
public function lang_load(sequence filename) 

loads a language file.

  1. filename : a sequence, the name of the file to load. If no file extension is supplied, then ".lng" is used.

A language map, if successful. This is to be used when calling translate.

If the load fails it returns a zero.


The language file must be made of lines which are either comments, empty lines or translations. Note that leading whitespace is ignored on all lines except continuation lines.

  • Comments are lines that begin with a # character and extend to the end of the line.
  • Empty Lines are ignored.
  • Translations have two forms.

keyword translation_text 
In which the 'keyword' is a word that must not have any spaces in it.
keyphrase = translation_text 
In which the 'keyphrase' is anything up to the first '=' symbol.

It is possible to have the translation text span multiple lines. You do this by having '&' as the last character of the line. These are placed by newline characters when loading.

Example 1:

# Example translation file 
hello Hola 
world Mundo 
greeting %s, %s! 
help text = & 
This is an example of some & 
translation text that spans & 
multiple lines. 
# End of example PO #2 

See Also:


Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu