Documenation

Language

/_plugins/language.php

Plugin to handle translations. This plugin hooks into to the translate hook and can be called with $model->t().

Language files are placed in the /lang/ directory. Each language has its own directory named after the language with as many files as needed.

Example

Language file:

1
2
3
4
5
<?php
$translation 
= array(
    
'Text to translate' => 'translation'
    
);
?>

View file:

1
2
3
<?php
<p><?php echo $model->t('Text to translate'?></p>
?>

Class

$model->lang

Public functions

  • $model->lang->check_languages ( )
    Scans the /lang/ directory for installed languages.
  • $model->lang->load ( )
    Loads a language file.
  • $model->lang->translate ( string $v )
    Translates a string (this function should not be called directly, use $model->t() instead.

Public variables

  • $model->lang->language
    The current user's language.
  • $model->lang->languages
    List of installed languages.