private function add($data, $language) {
        $parts = explode('-', $language); // To manage language with region (fr-CI, en-US, etc.)
        foreach($data as $key => $translation) {
            if (count($parts) == 1) {
                $this->translations[$language][$key] = $translation;
            } elseif (count($parts) == 2) {
                $this->translations[$parts[0]][$parts[1]][$key] = $translation;
            } else {
                throw new TranslationException('Invalid language');
            }
        }
    }
private function add($data, $language) {
        $parts = explode('-', $language); // To manage language with region (fr-CI, en-US, etc.)
        foreach($data as $key => $translation) {
            if (count($parts) == 1) {
                $this->translations[$language][$key] = $translation;
            } elseif (count($parts) == 2) {
                $this->translations[$parts[0]][$parts[1]][$key] = $translation;
            } else {
                throw new TranslationException('Invalid language');
            }
        }
    }
private function add ( $ data , $ language ) { $ parts = explode ( '-' , $ language ) ; // To manage language with region (fr-CI, en-US, etc.) foreach ( $ data as $ key => $ translation ) { if ( count ( $ parts ) == 1 ) { $ this -> translations [ $ language ] [ $ key ] = $ translation ; } elseif ( count ( $ parts ) == 2 ) { $ this -> translations [ $ parts [ 0 ] ] [ $ parts [ 1 ] ] [ $ key ] = $ translation ; } else { throw new TranslationException ( 'Invalid language' ) ; } } }
Add translation data for a language

@param array $data
@param string $language

@return void
Add translation data for a language