private function contentMessages()
    {
        $savedTranslations = $this->readSavedTranslations();
        // An exception occurred when reading the file
        if ($savedTranslations === null) {
            return '';
        }

        $this->gatherTranslatableStrings();

        // Find already translated strings
        $newTranslations = [];
        foreach (array_keys($this->translatables) as $key) {
            $newTranslations[$key] = isset($savedTranslations[$key]) ? $savedTranslations[$key] : '';
        }
        ksort($newTranslations);

        try {
            return $this->buildNewContent($newTranslations, $savedTranslations);
        } catch (InvalidResourceException $e) {
            // last resort fallback, edit the file
            return file_get_contents($this->absPath);
        }
    }
private function contentMessages()
    {
        $savedTranslations = $this->readSavedTranslations();
        // An exception occurred when reading the file
        if ($savedTranslations === null) {
            return '';
        }

        $this->gatherTranslatableStrings();

        // Find already translated strings
        $newTranslations = [];
        foreach (array_keys($this->translatables) as $key) {
            $newTranslations[$key] = isset($savedTranslations[$key]) ? $savedTranslations[$key] : '';
        }
        ksort($newTranslations);

        try {
            return $this->buildNewContent($newTranslations, $savedTranslations);
        } catch (InvalidResourceException $e) {
            // last resort fallback, edit the file
            return file_get_contents($this->absPath);
        }
    }
private function contentMessages ( ) { $ savedTranslations = $ this -> readSavedTranslations ( ) ; // An exception occurred when reading the file if ( $ savedTranslations === null ) { return '' ; } $ this -> gatherTranslatableStrings ( ) ; // Find already translated strings $ newTranslations = [ ] ; foreach ( array_keys ( $ this -> translatables ) as $ key ) { $ newTranslations [ $ key ] = isset ( $ savedTranslations [ $ key ] ) ? $ savedTranslations [ $ key ] : '' ; } ksort ( $ newTranslations ) ; try { return $ this -> buildNewContent ( $ newTranslations , $ savedTranslations ) ; } catch ( InvalidResourceException $ e ) { // last resort fallback, edit the file return file_get_contents ( $ this -> absPath ) ; } }
Gets all translatable strings and returns a translationsfile for messages or contenttypes.

@return string
Gets all translatable strings and returns a translationsfile for messages or contenttypes .