public function initLocaleNamespace($locale, array $namespaces)
    {
        // get checksum for translation-table + namespaces(s)
        $checksum = hash('md4', $locale.serialize($namespaces));

        // Assume cached content does not exist
        $translationTable = false;

        // If we want to initialize the translation table we need at least support for it ...
        if (true === $this->hasTranslationTableSupport($this)) {

            // We only run the generating code if either: a) never generated before or b) if caching is disabled
            if (false === isset(self::$translationTables[$checksum]) || false === $this->getCacheEnabled()) {

                // If caching enabled => try to get table from cache
                if (true === $this->getCacheEnabled()) {
                    try {
                        $translationTable = self::$cache->read($checksum);
                    } catch (Doozr_Cache_Service_Exception $e) {
                        // Intentionally left empty
                    }
                }

                // If we did not receive a valid result from cache or if cache is disabled => parse file(s) for table(s)
                if (false === $translationTable) {
                    // Build translationtable
                    $translationTable = $this->buildTranslationtable($locale, $namespaces);
                }

                // Store in cache if caching enabled
                if (true === $this->getCacheEnabled()) {
                    // cache translationtable
                    self::$cache->create($checksum, $translationTable, $this->getCacheLifetime());
                }

                // Put into local translationtable (runtime cache!)
                self::$translationTables[$checksum] = $translationTable;
            }
        }

        // In all cases return the crc (key/identifier)
        return $checksum;
    }
public function initLocaleNamespace($locale, array $namespaces)
    {
        // get checksum for translation-table + namespaces(s)
        $checksum = hash('md4', $locale.serialize($namespaces));

        // Assume cached content does not exist
        $translationTable = false;

        // If we want to initialize the translation table we need at least support for it ...
        if (true === $this->hasTranslationTableSupport($this)) {

            // We only run the generating code if either: a) never generated before or b) if caching is disabled
            if (false === isset(self::$translationTables[$checksum]) || false === $this->getCacheEnabled()) {

                // If caching enabled => try to get table from cache
                if (true === $this->getCacheEnabled()) {
                    try {
                        $translationTable = self::$cache->read($checksum);
                    } catch (Doozr_Cache_Service_Exception $e) {
                        // Intentionally left empty
                    }
                }

                // If we did not receive a valid result from cache or if cache is disabled => parse file(s) for table(s)
                if (false === $translationTable) {
                    // Build translationtable
                    $translationTable = $this->buildTranslationtable($locale, $namespaces);
                }

                // Store in cache if caching enabled
                if (true === $this->getCacheEnabled()) {
                    // cache translationtable
                    self::$cache->create($checksum, $translationTable, $this->getCacheLifetime());
                }

                // Put into local translationtable (runtime cache!)
                self::$translationTables[$checksum] = $translationTable;
            }
        }

        // In all cases return the crc (key/identifier)
        return $checksum;
    }
public function initLocaleNamespace ( $ locale , array $ namespaces ) { // get checksum for translation-table + namespaces(s) $ checksum = hash ( 'md4' , $ locale . serialize ( $ namespaces ) ) ; // Assume cached content does not exist $ translationTable = false ; // If we want to initialize the translation table we need at least support for it ... if ( true === $ this -> hasTranslationTableSupport ( $ this ) ) { // We only run the generating code if either: a) never generated before or b) if caching is disabled if ( false === isset ( self :: $ translationTables [ $ checksum ] ) || false === $ this -> getCacheEnabled ( ) ) { // If caching enabled => try to get table from cache if ( true === $ this -> getCacheEnabled ( ) ) { try { $ translationTable = self :: $ cache -> read ( $ checksum ) ; } catch ( Doozr_Cache_Service_Exception $ e ) { // Intentionally left empty } } // If we did not receive a valid result from cache or if cache is disabled => parse file(s) for table(s) if ( false === $ translationTable ) { // Build translationtable $ translationTable = $ this -> buildTranslationtable ( $ locale , $ namespaces ) ; } // Store in cache if caching enabled if ( true === $ this -> getCacheEnabled ( ) ) { // cache translationtable self :: $ cache -> create ( $ checksum , $ translationTable , $ this -> getCacheLifetime ( ) ) ; } // Put into local translationtable (runtime cache!) self :: $ translationTables [ $ checksum ] = $ translationTable ; } } // In all cases return the crc (key/identifier) return $ checksum ; }
Starts the initializing of given locale and namespace.

This method is intend to start the initializing of given locale and namespace and return the corresponding key.

@param string $locale     Locale to init
@param array  $namespaces Namespaces to init

@author Benjamin Carl <opensource@clickalicious.de>

@return string The key (identifier) for the created translationtable
Starts the initializing of given locale and namespace .