I read the several issues related to this problem, but still cannot say if I experience a bug, a missing features or lack of understanding.
I created a vocabulary named "glossary".
I set its translation mode to "Per language term"
The site has 3 languages: French, English and Greek
I created terms in English (default) and French.
Some terms are identical in both languages, there description being in the corresponding language
Other terms are different for the same meaning.
1) The glossary page behave this odd way
- Current language = English : display only English terms
- Current language = French : display all terms
- Current language = Greek : display only English terms
2) Whatever is the language's term, Glossary seems to pick the first it encounters to describe the term within content. Not any kind of relationship between the term language and the content language.
For example, I defined 3 terms
Automation (en) + english description
Automation (fr) + French description (2 versions of the same term)
Automatisation (fr) + French description (another translation of the same term)
I wrote these 2 words in 2 pages, one English and one French
Glossary displays the same descriptions in both cases
- the English one for Automation (2 versions, take the first)
- the French one for Automatisation (only a French term, take it anyway)
Is it the expected behaviour: no translation capabilities, terms must be defined only ones, no language, with the description field filled with all translations together
Do I miss something?
Is it a Bug?
Thank you
Comment | File | Size | Author |
---|---|---|---|
#13 | 401348_glossary-i18n-fix.patch | 6.79 KB | justingeeslin |
#11 | 401348_glossary-i18n-fix.patch | 681 bytes | mkalkbrenner |
#10 | glossary-i18n-fix.patch | 2.62 KB | davemybes |
Comments
Comment #1
harrrrrrr CreditAttribution: harrrrrrr commentedsame problem here
Comment #2
Aleksic CreditAttribution: Aleksic commentedI have same problem. Do you plan to do something about capability for translation? It would be great for multilingual site.
Thanks
Comment #3
harrrrrrr CreditAttribution: harrrrrrr commentedif you use different terms/language in taxonomy, you can change this function in glossary.module & it will work:
Comment #4
dademurphy CreditAttribution: dademurphy commented//added access to the global $language
//made the sql query that loads the terms use the language in the where clause.
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;
}
Comment #5
AaronCollier CreditAttribution: AaronCollier commentedNeeds a patch to test.
Comment #6
Mortel CreditAttribution: Mortel commentedFirst of all, sorry for my english...
I had a problem with the language switcher. I explain :
I have 2 languages (french and english) and I created 2 terms:
- Ordinateur (fr) (tid = 88)
- Computer (en) (tid = 89)
I went to "Ordinateur" page (http//site/glossary/term/88) and when I clicked English to translate that term, its link was "http://site/en/glossary/term/88" (it was supposed to be http://site/en/glossary/term/89), I had an empty page (I mean no term and no definition).
To fix my problem, I added this code at the end of glossary.module :
Anyway, it works for me, my problem is solved :)
Comment #7
walwyn CreditAttribution: walwyn commentedsubscribing
Comment #8
walwyn CreditAttribution: walwyn commented1) The glossary page behave this odd way
- Current language = English : display only English terms
- Current language = French : display all terms
- Current language = Greek : display only English terms
This issue can be fixed by inserting:
after the following lines in glossary_overview (glossary.module L854:)
The problem is that the call to taxonomy_get_tree($vid) is getting all of the terms for the vocabulary when the user's current language isn't the default one, so you have filter out the ones you don't want.
Comment #9
toastywaffles CreditAttribution: toastywaffles commentedThank you Mortel! Was having the exact same problem, where switching the language of the site did not find the appropriate node id for glossary terms. This fixed it.
Comment #10
davemybes CreditAttribution: davemybes commentedThanks Mortel, that worked nicely for the glossary page. I had to add some more code to allow for cases where the French and English term name was the same, but the description was translated. By default, the module seems to just grab the first one, which happens to be the English one in my case. This results in the tooltip being in English on French pages. So I added the language field to the term db_query, and then check against the language before adding the term to the list to be used for the tooltip. See the attached patch, which includes Mortel's above.
Comment #11
mkalkbrennerPatch from #10 is obsolete and doesn't apply against dev version anymore. They solved the same problem differently. But the issue form #8 still exists. But the fix needs a small adjustment to not create warnings when i18ntaxonomy isn't installed. Here's an adjusted patch.
Comment #12
justingeeslin CreditAttribution: justingeeslin commentedI'm looking to make the Glossary work with multiple languages as well. I'll test this patch in the future and see how it goes.
Comment #13
justingeeslin CreditAttribution: justingeeslin commentedHello,
I've noticed that the latest 6.x dev is still not ready for Glossaries translated into other languages.
Attached is a patch for the latest 6.x dev.
In this patch, I added a lot of t() functions and I had to sort terms by their translated equivalent word
The input filter/word filter is also working correctly.
I am not sure if I'm tackling all the issues of the above patches.
This seems to get the job done for me.
Comment #14
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedPost #6 made my day !
Terms were translated but switching language from a term page was not leading to the translated term. Now it works ! Thanks Mortel
Comment #15
NancyDru