diff options
Diffstat (limited to 'gengo-to-polylang.php')
-rw-r--r-- | gengo-to-polylang.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gengo-to-polylang.php b/gengo-to-polylang.php index 5c6f3be..a7794f7 100644 --- a/gengo-to-polylang.php +++ b/gengo-to-polylang.php @@ -349,21 +349,36 @@ class Gengo_To_Polylang { // order them in a convenient way foreach ($results as $st) - $string_translations[$st->language][] = array($st->string, $st->translation); + { + switch ($st->string) { + case "blogtitle": + $string=get_option('blogname'); + break; + case "blogtagline": + $string=get_option('blogdescription'); + break; + default: + $string=$st->string; + } + $string_translations[$st->language][] = array($string, $st->translation); + } + + foreach($this->model->get_languages_list() as $lang) + $languages[$lang->slug] = $lang; // save Polylang string translations if (isset($string_translations)) { - foreach ($string_translations as $lang=>$strings) { + foreach ($string_translations as $slug=>$strings) { $mo = new PLL_MO(); foreach ($strings as $msg) if(!empty($msg[1])) { $mo->add_entry($mo->make_entry($msg[0], $msg[1])); } - $mo->export_to_db($lang); + $mo->export_to_db($languages[$slug]); } } /* works but used synblock should be created by theme/plugin using pll_register_string or - * the translation will be loste afer editing pll strings. */ + * the translation will be lost after editing pll strings. */ } /* |