The code I posted before also reports home-pages as untranslated … here’s a better approach:
Index: wp-content/plugins/zanto/classes/class.zwt-lang-switcher.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-content/plugins/zanto/classes/class.zwt-lang-switcher.php (revision )
+++ wp-content/plugins/zanto/classes/class.zwt-lang-switcher.php (revision )
@@ -187,13 +187,19 @@
if(isset($ls_exclude_list[$trans_blog['blog_id']])){
continue;
}
- if (isset($translated_urls[$trans_blog['blog_id']])){
+
+ $translation_exists = isset($translated_urls[$trans_blog['blog_id']]);
+
+ if ($translation_exists){
$url = $translated_urls[$trans_blog['blog_id']];
if(zwt_get_global_urls_info('lang_url_format', $trans_blog['blog_id'])==2){
$url = $trans_network->add_url_lang($url, $trans_blog['blog_id'], 2);
}
}
else {
+ if (is_front_page())
+ $translation_exists = true;
+
if ((0==$this->ls_settings['skip_missing_trans'] && 0==$args['skip_missing']) || is_front_page()){ //link to home page
$url = zwt_get_global_urls_info('site_url', $trans_blog['blog_id']);
$lang_url_format = zwt_get_global_urls_info('lang_url_format', $trans_blog['blog_id']);
@@ -217,7 +223,7 @@
$country_flag_url = zwt_get_site_flags($trans_blog['lang_code']);
$zwt_ls_array[$trans_blog['lang_code']] = array('id' => $id, 'active' => $active, 'encode_url' => 0, 'native_name' => $native_name,
- 'language_code' => $language_code, 'translated_name' => $translated_name, 'url' => $url, 'country_flag_url' => $country_flag_url);
+ 'language_code' => $language_code, 'translated_name' => $translated_name, 'url' => $url, 'translation_exists' => $translation_exists, 'country_flag_url' => $country_flag_url);
$id++;
}
unset($id);
\ No newline at end of file