Pls also move this group to something like OG: subgroups, because it's hard to find it in the selector with its current title.

I have modified the following functions to make them use a t() call and allow localization, I don't have access to CVS, so I hope someone will commit the fix for me and close the bug.

function og_subgroups_menu() {
  $items = array();
      
  if (!$may_cache) {
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if (og_is_group_type($node->type)) {
        $items[] = array('path' => 'node/'.arg(1).'/view/nodes', 
		                 'title' => t('Overview'),
						 'access' => node_access('view', $node),
						 'type' => MENU_DEFAULT_LOCAL_TASK, 
						 'weight' => 0);
        $items[] = array('path' => 'node/'.arg(1).'/view/tree', 
		                 'title' => t('Tree'),
						 'callback' => 'og_subgroups_page', 
						 'callback arguments' => arg(1),
						 'access' => node_access('view', $node),
						 'type' => MENU_LOCAL_TASK, 
						 'weight' => 5);
        $items[] = array('path' => 'node/'.arg(1).'/view/members', 
		                 'title' => t('Members'),
						 'callback' => 'og_subgroups_members_page', 
						 'callback arguments' => arg(1),
						 'access' => node_access('view', $node),
						 'type' => MENU_LOCAL_TASK, 
						 'weight' => 7);
        $items[] = array('path' => 'node/'.arg(1).'/edit/group', 
		                 'title' => t('Group'),
						 'access' => node_access('update', $node),
						 'type' => MENU_DEFAULT_LOCAL_TASK);
        $items[] = array('path' => 'node/'.arg(1).'/edit/children', 
		                 'title' => t('SubGroups'),
						 'callback' => 'drupal_get_form', 
						 'callback arguments' => array('og_subgroups_edit_children_page', arg(1)),
						 'access' => node_access('update', $node),
						 'type' => MENU_LOCAL_TASK, 
						 'weight'=>3);
        $items[] = array('path' => 'node/'.arg(1).'/edit/members', 
		                 'title' => t('Members'),
						 'callback' => 'drupal_get_form',
						 'callback arguments' => array('og_subgroups_edit_members_page', arg(1)),
						 'access' => node_access('update', $node),
						 'type' => MENU_LOCAL_TASK, 
						 'weight'=>5);
      }
    }
  }

  return $items;
}
function og_subgroups_tree($children,$depth=0) {
  if ($depth==0) {
    drupal_add_js(drupal_get_path('module', 'og_subgroups') .'/og_subgroups.js');
    $togo = "<ul class=collapsible>";
  }
  else {
    $togo = "<ul>";
  }

  foreach ($children as $cid => $cname) {
    if ($depth==0) {
      $link = '<span><a href="#">'.$cname.'</a></span>';
	  $loctit = t('list all members');
      $link .= " ".l("[".$loctit."]","node/".$cid."/view/members");
      $togo .= '<li>'.$link;
      $togo .= og_subgroups_tree(og_subgroups_get_children($cid),$depth+1);
      $togo .= og_subgroups_make_list(og_subgroups_get_users('links',$cid,0));
      $togo .= '</li>';
    } else {
      $link = '<span><a href="#">'.$cname.'</a></span>';
	  $loctit = t('view this group');	  
      $link .= " ".l("[".$loctit."]","node/".$cid);
      $togo .= '<li>'.$link;
      $togo .= og_subgroups_tree(og_subgroups_get_children($cid),$depth+1);
      $togo .= og_subgroups_make_list(og_subgroups_get_users('links',$cid,0),$depth);
      $togo .= '</li>';
    }
  }
  $togo .= "</ul>";
  return $togo;
}

Comments

ezra-g’s picture

Assigned: Bèrto ëd Sèra » ezra-g

Could you please report which functions are currently missing a call to t()? I'll patch and commit these changes.

Thank you for pointing this out!

ezra-g’s picture

Status: Active » Fixed

The above functions have been modified to conform to Localization standards. Thanks, Bèrto ëd Sèra !

Anonymous’s picture

Status: Fixed » Closed (fixed)