<?php
/**
 * patI18n Module
 *
 * $Id: Module.php 5 2007-06-17 20:15:53Z gerd $
 *
 * Modular translation interface
 *
 * @version     0.1.0
 * @package     patI18n
 * @author      gERD Schaufelberger <gerd@php-tools.net>
 * @license     LGPL
 * @link        http://www.php-tools.net
 */
 
/**
 * patI18n Module
 *
 * The base class for all patI18n modules
 *
 * @version     0.1.0
 * @package     patI18n
 * @author      gERD Schaufelberger <gerd@php-tools.net>
 * @license     LGPL
 * @link        http://www.php-tools.net
 */
abstract class patI18n_Module 
{
   /**
    * current config
    * Initialize this array with default values
    * @var array
    */
    protected $_conf    =   array();

   /**
    * configure myselfs
    * 
    * @param array $settings list of configuation options
    * @return bool true on success
    * @todo add class loader
    */
    public function configure( $settings )
    {
        $this->_conf    =   array_merge( $this->_conf, $settings );
        return true;
    }

   /**
    * Switch to language
    * 
    * @param string $string
    * @return booll true on success
    */
    public function setLocale( $locale )
    {
        return true;
    }

   /**
    * Gettext interface
    * 
    * Translate string or skip it if not possible.
    * 
    * @param string $string
    * @param string $domain
    * @return bool false to continue, true if translation is done
    */
    public function gettext( &$string, $domain = null )
    {
        return false;
    }
    
   /**
    * Gettext plural version interface
    * 
    * Translate string or skip it if not possible
    * The plural version of {@link gettext()}. Some languages have more than one form 
    * for plural messages dependent on the count.
    * 
    * @param string $string
    * @param string $stringPlural
    * @param int $count 
    * @param string $domain
    * @return bool false to continue, true if translation is done
    * @see gettext()
    */
    public function ngettext( &$string, $stringPlural, $count, $domain = null )
    {
        return false;
    }
}
?>