Go to the documentation of this file.00001 <?php
00002
00013 class views_plugin_localization_core extends views_plugin_localization {
00014
00026 function translate_string($string, $keys = array(), $format = '') {
00027 return t($string);
00028 }
00029
00041 function save_string($string, $keys = array(), $format = '') {
00042 global $language;
00043
00044
00045
00046
00047 if ($language->language == 'en') {
00048 $changed = TRUE;
00049 $languages = language_list();
00050 $cached_language = $language;
00051 unset($languages['en']);
00052 if (!empty($languages)) {
00053 $language = current($languages);
00054 }
00055 }
00056
00057 t($string);
00058
00059 if (isset($cached_language)) {
00060 $language = $cached_language;
00061 }
00062 return TRUE;
00063 }
00064
00073 function delete($source) {
00074 return FALSE;
00075 }
00076
00085 function export($source) {
00086 if (!empty($source['value'])) {
00087 $this->export_strings[] = $source['value'];
00088 }
00089 }
00090
00097 function export_render($indent = ' ') {
00098 $output = '';
00099 if (!empty($this->export_strings)) {
00100 $this->export_strings = array_unique($this->export_strings);
00101 $output = $indent . '$translatables[\'' . $this->view->name . '\'] = array(' . "\n";
00102 foreach ($this->export_strings as $string) {
00103 $output .= $indent . " t('" . str_replace("'", "\'", $string) . "'),\n";
00104 }
00105 $output .= $indent . ");\n";
00106 }
00107 return $output;
00108 }
00109 }