method setLanguage()

This method may be called by the template to change the current output language.

Its arguments are a list of possible languages (use func_get_args() to get the argument array). The first known language should be used by your service.

<?php
require_once 'PHPTAL/TranslationService.php';

class MyTranslator implements PHPTAL_TranslationService {

    public function setLanguage(){
        $langs = func_get_args();
        foreach($langs as $lang){
            // if $lang known use it and stop the loop
            $this->_currentLang = $lang;
            return;
        }
    }
    
    private $_currentLang;
}
?>