• I’m using qTranslate on a property site, translating into 3 languages.

    the site

    Although the theme developer said the theme didn’t support multilingual, with just a few tweaks I got qTranslate working.

    Unfortunately, now in the Search Form (right sidebar), under the Property Category menu, the English categories is being displayed for all 3 languages. Although 3 they’re available in all languages.

    I’m guessing something is missing from the script that calls the category from the database, to tell it to get them in the 3 languages?

    Here’s the php for the field:

    <select name="category" id="category_<?php echo $counter;?>" class="textfield" >
                <option value="0"><?php _e("<!--:en-->Select Category<!--:--><!--:es-->Elige Categoría<!--:--><!--:ru-->Select Category<!--:-->");?></option>
    
    			<?php
    			global $wpdb;
    			$catsql = "select * from $wpdb->terms c,$wpdb->term_taxonomy tt  where tt.term_id=c.term_id and tt.taxonomy='".CUSTOM_CATEGORY_TYPE1."' and tt.parent=0  and c.name != 'Uncategorized' and c.name != 'Blog'  $substr order by c.name";
    			   $catinfo = $wpdb->get_results($catsql);
    			   foreach($catinfo as $catinfo_obj)
    			   {
    				   	$counter++;
    				   	$termid = $catinfo_obj->term_taxonomy_id;
    		            $term_tax_id = $catinfo_obj->term_id;
    					$name = $catinfo_obj->name;
    
    					if($_REQUEST['category'] !=""){
    				$cat_term = explode(',',$_REQUEST['category']); }else{
    				$cat_term = explode(',',$_SESSION['property_info']['category']);
    				}
    
    				?>
    					<option <?php  if($_REQUEST['category'] == $name){ echo 'selected="selected"'; } ?>  value="<?php echo $name; ?>" > <?php echo $name; ?></option>
    			<?php
    			 $child = get_term_children( $term_tax_id ,CUSTOM_CATEGORY_TYPE1);
    			  $args = array(
    				'type'                     => 'property',
    				'child_of'                 => $term_tax_id,
    				'hide_empty'               => 1,
    				'taxonomy'                 => CUSTOM_CATEGORY_TYPE1
    				);
    				 $categories = get_categories( $args );
    				 foreach($categories as $child_of)
    				 {
    				 	$child_of = $child_of->term_id;
    					$term = get_term_by( 'id', $child_of, CUSTOM_CATEGORY_TYPE1);
    					$p="";
    					$termid = $term->term_taxonomy_id;
    					$term_tax_id = $term->term_id;
    					$name = $term->name;
    					$catprice = $wpdb->get_row("select * from $wpdb->term_taxonomy tt ,$wpdb->terms t where tt.term_taxonomy_id='".$term->term_taxonomy_id ."' and t.term_id = tt.term_id");
    					$cp = $catprice->term_price;
    					if($child_of)
    					{
    						$catprice = $wpdb->get_row("select * from $wpdb->term_taxonomy tt ,$wpdb->terms t where t.term_id='".$child_of."' and t.term_id = tt.term_id AND tt.taxonomy ='".CUSTOM_CATEGORY_TYPE1."'");
    						for($i=0;$i<count($catprice);$i++)
    						{
    							if($catprice->parent)
    							{
    								$p .= " - ";
    								$catprice1 = $wpdb->get_row("select * from $wpdb->term_taxonomy tt ,$wpdb->terms t where t.term_id='".$catprice->parent."' and t.term_id = tt.term_id AND tt.taxonomy ='".CUSTOM_CATEGORY_TYPE1."'");
    								if($catprice1->parent)
    								{
    									$i--;
    									$catprice = $catprice1;
    									continue;
    								}
    							}
    						}
    					}
    				//	$p = $p*15;
    				 ?>

    Hope someone has some insight into this, thanks a bunch!

    Regards

    http://wordpress.org/plugins/qtranslate/

  • The topic ‘qTranslate – Some of site search form not appearing translated’ is closed to new replies.