* setConfiguration( * array( 'location' => 'usr/share/translations', * 'format' => 'translation-[LOCALE].xml' ) * ); * $r->initReader( 'nl_NL' ); * while ( $r->haveMore() ) * { * $ctxt = $r->getContext(); * } * $r->deinitReader(); * ?> * * * @package Translation */ interface ezcTranslationContextRead { /** * Initializes the reader * * Before starting to request context through the reader, you should call * this method to initialize it. * * @param string $locale The locale to read from. * @throws TranslationException when the $tsLocationPath and * $tsFilenameFormat are not set before this * method is called. */ public function initReader( $locale ); /** * Deinitializes the reader * * This method should be called after the haveMore() method returns false * to cleanup resources. * * @throws TranslationException when the reader is not initialized with * initReader(). */ public function deinitReader(); /** * Returns whether there are more contexts available. * * This method reads the next context and stores that internally in the * $currentContext property. If no more contexts are available it returns * false, if it read a context from the file the method returns true. * * @throws TranslationException when the reader is not initialized with * initReader(). * @return boolean */ public function haveMore(); /** * Returns the current context * * This method returns the latest read context, that the haveMore() method * put into the $currentContext property. * * @return array The current context's translation map * @throws TranslationException when the reader is not initialized with * initReader(). */ public function readContext(); } ?>