language == 'en') { $changed = TRUE; $languages = language_list(); $cached_language = $language; unset($languages['en']); if (!empty($languages)) { $language = current($languages); } } t($string); if (isset($cached_language)) { $language = $cached_language; } return TRUE; } /** * Delete a string. * * Deletion is not supported. * * @param $source * Full data for the string to be translated. */ function delete($source) { return FALSE; } /** * Collect strings to be exported to code. * * String identifiers are not supported so strings are anonymously in an array. * * @param $source * Full data for the string to be translated. */ function export($source) { if (!empty($source['value'])) { $this->export_strings[] = $source['value']; } } /** * Render any collected exported strings to code. * * @param $indent * An optional indentation for prettifying nested code. */ function export_render($indent = ' ') { $output = ''; if (!empty($this->export_strings)) { $this->export_strings = array_unique($this->export_strings); $output = $indent . '$translatables[\'' . $this->view->name . '\'] = array(' . "\n"; foreach ($this->export_strings as $string) { $output .= $indent . " t('" . str_replace("'", "\'", $string) . "'),\n"; } $output .= $indent . ");\n"; } return $output; } }