Localized Name & Description

Created on 27 June 2022, over 2 years ago
Updated 2 March 2023, over 1 year ago

Localized taxonomy 'forums' tags' values are not returned in an i18n manner

Forum table SUPERHEADERS (container with the class "forum-table-superheader") doesn't handle localized name & description of forums either containers, except of the main forum page (aka forum list path).

Steps to reproduce

The file styles/naked/advanced-forum.naked.forum-list.tpl.php

    <div class="forum-table-superheader">
      <div class="forum-table-name">
        <?php if (empty($table_info->link)): ?>
          <?php print $table_info->name; ?>
        <?php else: ?>
          <a href="<?php print $table_info->link; ?>"><?php print $table_info->name; ?></a>
        <?php endif; ?>
      </div>
      <?php if ($collapsible): ?>
        <span id="forum-collapsible-<?php print $table_info->tid; ?>" class="forum-collapsible" >&nbsp;</span>
      <?php endif; ?>
      <div class="forum-table-description"><?php print $table_info->description; ?></div>

    </div>

... might be modified to support localized values.





Proposed resolution

from:
<del><?php $table_info = $table['table_info']; ?></del>

to:

<?php $table_info = $table['table_info']; 
   //PATCH - TO GET LOCALIZED TAXONOMY ITEMS FOR TRANSLATED FORUMS 
  	  $parent_tid = $table_info->tid;
	  $term = taxonomy_term_load($parent_tid);
	  $term = i18n_taxonomy_localize_terms($term);
	  
	   $forum_page = 'forum';
           $path = drupal_strtolower(drupal_get_path_alias($_GET['q']));
           $path_forum = strstr($path, '/', true);

           $args = explode('/', current_path());
             if ($args[1] == '') {
              $page_match = strcmp($path_forum, $forum_page);
              }  
  ?>


Division class="forum-table-superheader" changes

<div class="forum-table-superheader">
      <div class="forum-table-name">
        <?php if (empty($table_info->link)): ?>
          <?php print $table_info->name; ?>
        <?php else: ?>
          <a href="<?php print $table_info->link; ?>">
		   <?php if (!$page_match) {
                print $term->name;  
				}
             else  {  
               print $table_info->name;   
			   }
           ?>	  
		  </a>
        <?php endif; ?>
      </div>
      <?php if ($collapsible): ?>
        <span id="forum-collapsible-<?php print $table_info->tid; ?>" class="forum-collapsible" >&nbsp;</span>
      <?php endif; ?>
      <div class="forum-table-description">
	   <?php if (!$page_match) {
                print $term->description;  
				}
             else  {  
               print $table_info->description;  
			   }
       ?>
      </div>

    </div>
Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇷🇺Russia allexim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024