Hi there,
I have a multilanguage setup with i18n, and am having the same problems outlined in this thread http://drupal.org/node/256415

that being, All glossary terms in all languages are appearing as links on every translated pages throughout the site. Ie on a Spanish page, i get English terms and Spanish terms, and on a English page i get the same.

I am using the dev version of glossary as it seems to have some i18n functions included. Am also using the hovertips module.

I have setup my vocabs as per this Aaron's suggestion here http://drupal.org/node/258843#comment-847015

Any help is much appreciated!!
thanks

Comments

nikitas’s picture

have u tried this one>? http://drupal.org/project/l10n_client instead of i18n.
i know that's not what you r asking for but it might works for you.
Check the screencasts for better understanding.

I had the same problems with other langs and worked just fine.

milos1234’s picture

have u tried this one>? http://drupal.org/project/l10n_client instead of i18n.

Hi Nikitas
I am also using that module to translate interface strings throughout the site, but it doesnt seem to help with the glossary issue at all. How were you suggesting to use it?

thanks

nikitas’s picture

correct me if i m wrong but what'r u saying is that " . . . altgough i've translated my terms . . . i still get nothing or i have two versions ( each language) on each page ?
When you say glossary you mean basic Drupal "code-words" as views,taxonomy etc. ? Cause i think if so it's more configuration issue and not a bug or something/

P.S Did u try various combination of the options inside site configuration->languages ?
do u have enabled path prefix only ( or with fallback ) at the configure tab ?
have u watched this screencast ? http://blip.tv/file/611791 it mights help . :D
. . .
check here for example www.plasisgroup.com left column languages block ( Ελληνικά English ) you want to do something similar ? when pressing english -> all site translated into english and vise versa.

jvieille’s picture

I seem to have the same problem.
I defined a single term in 3 languages. it is an acronym, so it is the same term, but with different description in the 3 languages.
However, Glossary always displays the first term it finds whatever is the node language.
It seems that Glossary is totally ignorant of language.

Not sure my issue is related to this one.
I opened a new thread
http://drupal.org/node/401348

milos1234’s picture

ok, i have played around with every possible language setting, and think I have a solution!
BUT, for it to work, the cache needs to be flushed when changing language.
is there a way to disable caching on the Glossary plugin?

thanks

guillaumeduveau’s picture

Disabling the cache on the glossary seems risky for the performance !

milos1234’s picture

@guix:
yes, but it seems essential for the glossary to work with i18n and hovertips. i'm open to ideas?

jvieille’s picture

"..think I have a solution!"
What is the solution?
Do you mean that simply going to "admin/settings/glossary/clearcache" can makes it work?
- that a the same term defined in different languages will pop up correctly according to the language page?
- that the glossary cache must be cleared each time the page language changes?

milos1234’s picture

@jvielle

Do you mean that simply going to "admin/settings/glossary/clearcache" can makes it work?
no, its needs to be a full cache flush. the glossary flush cache, or even turning off all caching in the admin area wont cut it.

that a the same term defined in different languages will pop up correctly according to the language page?
yes, this is what i had a solution to. for Glossary to work with i18n and hovertips the language settings needs to be as below. (and i tried them ALL)

Set language negotiation: "Current language and language neutral."
Create a new Vocabulary: mine is called "Glossary Terms"
For the vocab choose: "Per language terms. Different terms will be allowed for each language and they can be translated."
When making the vocabulary, do not set a language from the drop box. Leave it as empty.
Create a new term and description: Set the language for that term.
then your terms will appear as hovertips on the right nodes depending on which language you are viewing in. however, this only happens when you: (a)Switch Language (b)then flush the cache entirely.
i am yet to work out exaclty which part of the cache needs flushing to affect he glossary terms, so only a full flush will work.

that the glossary cache must be cleared each time the page language changes?
as above. just flushing the glossary cache doesn't seem to fix the problem.
please see this comment to how to flush cache entirely at all times. http://drupal.org/node/241673#comment-1344308

jvieille’s picture

Title: i18n and glossary not working? » Glossary does not work effectively with i18n
Category: support » bug

Thank you, this is crystal clear.
I changed the status to bug, as we know now that the feature almost works, and the supporting phase is over...

Something is missing in Glossary code. Hoping a better solution will come up soon!

harrrrrrr’s picture

if you use different terms/language in taxonomy, you can change this function in glossary.module & it will work:

function _glossary_get_terms($format) {
  static $terms = FALSE;
  $show_all = variable_get('glossary_allow_no_description', FALSE);
  $taxonomy_image_enabled = module_exists('taxonomy_image');

  if ($terms === FALSE) {
    $terms = $synonyms = array();
    $vids = variable_get("glossary_vids_$format", 0);

    foreach ($vids as $vid) {
      $synonyms = _glossary_get_synonyms($vid);

      // 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, 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, i18n_get_lang());
      while ($term = db_fetch_object($result)) {
        if ($term->nodes) {
          // If there were any nodes attached, we need to see if they were unpublished.
          $unpubs = db_result(db_query(db_rewrite_sql("SELECT COUNT(n.nid) FROM {term_node} tn JOIN {node} n USING (nid) WHERE tn.tid=%d AND n.status=0"), $term->tid));
          $term->nodes -= $unpubs;
        }
        if ($term->description || $show_all) {
          $term->synonyms = $synonyms[$term->tid];
          $term->synonyms[] = filter_xss($term->name);
          $term->vid = $vid;
		  if($term->language == i18n_get_lang()) {
			$terms[] = $term;
		  }
        }
        if ($taxonomy_image_enabled) {
          $term->image = taxonomy_image_display($term->tid);
        }
        else {
          $term->image = NULL;
        }
      }
    }
  }
	

  return $terms;
}
dademurphy’s picture

Slight Variation to handle large sets of terms more effectivley.
Similar to the solution above but only loads the language you currently have selected as opposed to all terms for all languages.

function _glossary_get_terms($format) {
static $terms = FALSE;
global $language;
$show_all = variable_get('glossary_allow_no_description', FALSE);
$taxonomy_image_enabled = module_exists('taxonomy_image');

if ($terms === FALSE) {
$terms = $synonyms = array();
$vids = variable_get("glossary_vids_$format", 0);

foreach ($vids as $vid) {
$synonyms = _glossary_get_synonyms($vid);

// 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 and t.language = '%s' GROUP BY t.tid, t.name, t.description ORDER BY LENGTH(t.name) DESC", 't', 'tid'), array($vid,$language->language));
while ($term = db_fetch_object($result)) {
if ($term->nodes) {
// If there were any nodes attached, we need to see if they were unpublished.
$unpubs = db_result(db_query(db_rewrite_sql("SELECT COUNT(n.nid) FROM {term_node} tn JOIN {node} n USING (nid) WHERE tn.tid=%d AND n.status=0"), $term->tid));
$term->nodes -= $unpubs;
}
if ($term->description || $show_all) {
$term->synonyms = $synonyms[$term->tid];
$term->synonyms[] = filter_xss($term->name);
$term->vid = $vid;
$terms[] = $term;
}
if ($taxonomy_image_enabled) {
$term->image = taxonomy_image_display($term->tid);
}
else {
$term->image = NULL;
}
}
}
}

return $terms;
}

dkoukoul’s picture

I 've tried the above solutions but don't seem to work...
I have one vocabulary "Glossary" which is set to "Per language terms. Different terms will be allowed for each language and they can be translated."
then I have taxonomy terms each defined as an English term and another one defined as a Greek term and set their translation in taxonomy.
In the English glossary page I see only the english terms but in the greek page (/el/glossary) I see both the english and the greek terms with their description!
Any advise on how to debug or any other work around?
Thanks in advance

Sorry... solution found...
http://drupal.org/node/401348#comment-3616308

nancydru’s picture

Issue summary: View changes
Status: Active » Closed (outdated)