I want to show the block title (generated by views) by language. I.e. if the language is 'en' then show "Blog 123". if the language is other language, then show other text.

So, I installed i18n views module. I found there is a new field "Internationalization: Language" and 3 new filters. I guess I cannot use them to get my requirement, is it correct?

Comments

cdemetriadis’s picture

Had the same issue. I found the solution here...

http://drupal.org/node/204888

Simply put, open block.tpl.php and wrap the Subject variable with the t() function.

<div id="block-<?php print $block->module .'-'. $block->delta; ?>" class="clear-block block block-<?php print $block->module ?>">

<?php if ($block->subject): ?>
  <h2><?php print t($block->subject) ?></h2>
<?php endif;?>

  <div class="content"><?php print $block->content ?></div>
</div>

Then goto the localization section in your admin (admin/settings/locale/string/search), and search for the strings you want to translate. voila!

dennys’s picture

Hi, thanks for your solution, but is there a same function for views?

dennys’s picture

I tried to add t(), but I still cannot find the string in admin/settings/locale/string/search, should I do anything else ?

jose reyero’s picture

Component: Module i18nviews » Code
Status: Active » Closed (won't fix)

You'll have to wait for some 6.x views patches (nothing to be done for 5.x)