Views internationalization : translation of views title

zmove - August 28, 2008 - 10:13
Project:Internationalization
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi,

I'm happy to see a view module for internationalization. For most site, lot of contents are generated by views, and it was a pain to translate. I hope this module will make our life more easy.

However there is a problem with the views title, especially the one generated with arguments like taxonomy_term view.

I translated my taxonomy via the locale system. When I go into a node, I can see the right translation of my term, but when I browse my node listing with taxonomy_term views, all the titles are in english (the default language), so they are not translated.

It could be very usefull to get the correct language for the title when a term is translated...

thanks

zmove

#1

zmove - August 28, 2008 - 10:19

I finally found the solution :

in argument.handler.inc

Replace

<?php
 
function get_title() {
    if (isset(
$this->validated_title)) {
      return
$this->validated_title;
    }
    else {
      return
$this->title();
    }
  }
?>

By:

<?php
 
function get_title() {
    if (isset(
$this->validated_title)) {
      return
t($this->validated_title);
    }
    else {
      return
t($this->title());
    }
  }
?>

And then, your title will become translatable viia the locale system.

#2

David Lesieur - September 8, 2008 - 07:16

#3

GiorgosK - October 16, 2009 - 11:59
Component:Module i18nviews» Code
Status:duplicate» active

View titles are indeed translated but still taxonomy views titles (taxonomy_term) are not

I am testing with the dev of i18n and the 2.x dev of CCK and 2.x dev of views

anybody else experiencing the same ?

#4

GiorgosK - October 16, 2009 - 12:00
Category:support request» bug report

can we consider this a bug

#5

GiorgosK - October 18, 2009 - 08:57

temp solution until this is sorted

include in the header of your taxonomy_term view

<?php
drupal_set_title
(t(drupal_get_title()));
?>

input format: php

#6

vnb - October 29, 2009 - 02:32

subscribe

#7

tomsm - November 10, 2009 - 14:07

The header modification of #5 works great.

But does anyone have a solution to translate the breadcrumbs, and the taxonomy term that appears under each teaser or full node?

#8

mattiasj - November 24, 2009 - 10:10

Thanks for solution #5!

#9

Jose Reyero - November 24, 2009 - 14:14

#10

System Message - December 8, 2009 - 14:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.