# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- C:\Dev\UniServer56b\www\qahn\sites\all\modules\glossary\glossary.module.ori
+++ C:\Dev\UniServer56b\www\qahn\sites\all\modules\glossary\glossary.module
@@ -1,4 +1,4 @@
-s<?php
+<?php
 // $Id: glossary.module,v 1.100.2.20.2.55 2008/09/03 18:40:32 nancyw Exp $
 
 /**
@@ -811,6 +811,12 @@
   $output .= '<div class="glossary-list"><dl>'."\n";
   if ($tree) {
     foreach ($tree as $term) {
+      global $language;
+
+      // See if this term is in current language
+      if ($term->language != '' && $term->language != $language->language) {
+        continue;
+      }    
       $term->synonyms = $synonyms[$term->tid];
       // See if it's a new section.
       // If we're looking for a single letter, see if this is it.
@@ -1078,6 +1084,7 @@
 }
 
 function _glossary_get_terms($format) {
+  global $language;
   static $terms = FALSE;
   $show_all = variable_get('glossary_allow_no_description', FALSE);
   $taxonomy_image_enabled = module_exists('taxonomy_image');
@@ -1091,7 +1098,7 @@
 
       // Get all glossary terms and attach synonyms.
       // Omit terms without a description. those are usually container terms.
-      $result = db_query(db_rewrite_sql("SELECT t.tid, t.name, t.description, COUNT(tn.nid) as nodes FROM {term_data} t LEFT JOIN {term_node} tn USING(tid) WHERE t.vid=%d GROUP BY t.tid, t.name, t.description ORDER BY LENGTH(t.name) DESC", 't', 'tid'), $vid);
+      $result = db_query(db_rewrite_sql("SELECT t.tid, t.name, t.description, t.language, COUNT(tn.nid) as nodes FROM {term_data} t LEFT JOIN {term_node} tn USING(tid) WHERE t.vid=%d GROUP BY t.tid, t.name, t.description ORDER BY LENGTH(t.name) DESC", 't', 'tid'), $vid);
       while ($term = db_fetch_object($result)) {
         if ($term->nodes) {
           // If there were any nodes attached, we need to see if they were unpublished.
@@ -1102,8 +1109,11 @@
           $term->synonyms = $synonyms[$term->tid];
           $term->synonyms[] = filter_xss($term->name);
           $term->vid = $vid;
+          // If no language is set, or the term language matches the current language, add it to the array.
+          if (!$term->language || $term->language == $language->language) {
           $terms[] = $term;
         }
+        }
\ No newline at end of file
         if ($taxonomy_image_enabled) {
           $term->image = taxonomy_image_display($term->tid);
         }
