Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
fubhy CreditAttribution: fubhy commentedThe 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).
Comment #2
gghh2 CreditAttribution: gghh2 commentedok, 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...) ?
Comment #3
fubhy CreditAttribution: fubhy commentedYou 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.
Comment #4
candelas CreditAttribution: candelas commentedi 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
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 :)
Comment #5
candelas CreditAttribution: candelas commentedif you have to localize the description
taxonomy-term.tpl.php