It's not possible to translate the title in "region-content.tpl.php" because the t() function is missing.

<h1 class="title" id="page-title"><?php print $title; ?></h1>

||
v

<h1 class="title" id="page-title"><?php print t($title); ?></h1>

Comments

fubhy’s picture

Status: Active » Closed (works as designed)

The title should be translated wherever it's coming from. Using a t() function on a variable in a template is certainly not the right approach for that. So, no, the t() function is not missing there because it does not belong there. That's not how multilingual Drupal works (not everything should be translated as a plain string).

gghh2’s picture

Status: Closed (works as designed) » Active

ok, so i can't translate my title ?
Perhap's we have to add the t() function where the "$title" variable is created at the origin (preprocess, process...) ?

fubhy’s picture

Status: Active » Closed (works as designed)

You have to translate the title wherever it comes from. If the title comes from an entity, use entity translation and translate the content properly. Omega is a theme, it doesn't have ANYTHING to do with multilingual features. What I can tell you though is that using t() around random $variables is _definitely_ not the right solution to make a site multilingual.

candelas’s picture

Category: bug » support

i got this problem too :)

i tried several ways of resolving it and at the end i put here the easiest way i was able to make.
the $tilte is set in the template.tpl.php in function omega_alpha_process_region(&$vars) and doesnt checks for language . i could make a hook but it would be much longer than this solution.

copy the region-content.tpl.php to your theme template folder.
in line 7 you will see that the title is printed

<h1 class="title" id="page-title"><?php print $title; ?></h1>

replace

<h1 class="title" id="page-title"><?php 

    if(arg(1) == "term"){ //check if it is a taxonomy page
      $tid = arg(2);
      $term = taxonomy_term_load($tid); //load the term
      $term = i18n_taxonomy_localize_terms($term); //ask for the translation
      $title = $term->name; //assign the translated name to the title 
    }

   print  $title; ?></h1>

i write it here just in case someone gets this problem.
it would be sad that someone didnt use this excellent theme because this problem...
thanks a lot for the theme :)

candelas’s picture

if you have to localize the description

taxonomy-term.tpl.php

<div class="content">
    <?php 

       $term = i18n_taxonomy_localize_terms($term);
       $content['description']['#markup']= $term->description ;
       print render($content); ?>