summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Viard de Galbert <julien@vdg.blogsite.org>2014-02-04 00:06:25 +0100
committerJulien Viard de Galbert <julien@vdg.blogsite.org>2014-02-04 00:06:25 +0100
commit59df2e65074ef1662ec3a8e8042765f2f111e468 (patch)
tree5d09e5aa7ae15135afe404077c3f20f1347ab5c2
parentbeb52ab8bc136ba7893ab85ab10e9922efa47efe (diff)
Fix string import, mainly title & taglineHEADmaster
-rw-r--r--gengo-to-polylang.php23
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. */
}
/*