Quantcast
Channel: Recent posts across whole site
Viewing all articles
Browse latest Browse all 49215

$title is not translated anymore if I use views

$
0
0

Ok, this hard to explain.

I build up a new site with a whole bunch of modules. The site is multilingual, german is default and the second language is english. I use a taxonomy vocabulary and all is working fine so far. E.g, content, taxonomy terms, menus and so on, are all shown in the right actual language (after translating them via the translate interface).

But, as soon as I enable the taxonomy_term default view, the taxonomy terms don't get translated anymore. All taxonomy terms are shown in the default language, which is german, even if the actual language is switched to english.

The content and the menus are still shown correct in the actual language. For some time I thought, that this could only be a problem of views and i18. And I found some issues. But nothing helped.

Now its getting curious: The taxonomy term seems not to be show up from views. It is shown through the $title variable inside the page.tpl.php. I figured that out because the taxonomy term is rendered without any views css styles. The content beneath the taxonomy term has all the views css styles and is rendered by views. But the taxonomy term at top of the page is not.

So, why does the taxonomy term does simply not get translated if I enable the taxonomy_term view even if views do not set the taxonomy term?

As soon as I disable the taxonomy_term view, the taxonomy term is shown correct in the actual language again.

I made some tests: In the page.tpl.php is the following code:

<?php if ($title): ?>
  <h1 class="title"><?php print $title; ?></h1>
<?php endif; ?>

If I change the code to:

<?php if ($title): ?>
  <h1 class="title"><?php print t($title); ?></h1>
<?php endif; ?>

nothing changes. But I read in the t-function documentation, that if in the settings.php are customized strings, they will be taken instead a database lookup via the locale-function. So I tried some customized strings inside the settings.php. And it worked:
Code inside settings.php:
$conf['locale_custom_strings_en'] = array(
   'Neueste Nachrichten' => 'Latest News',
);

And now in the english language the taxonomy term is correct "Latest News".
That proofs, that views seems not to be the source of the taxonomy term.
So, again here is my question:
Why does the taxonomy term does simply not get translated if I enable the taxonomy_term view even if views do not set the taxonomy term?
Maybe I get something wrong and missed something, so help is very much appreciated.


Viewing all articles
Browse latest Browse all 49215

Trending Articles