Hi,

I have a site where I put a taxonomy Vocabulary "Content Type" with the terms "Recycling", among others. Also, I have both English and French languages on my site.

I create a new story "Recycling project in Haiti" with the Content Type "Recycling", and set the language to "English".

I then translate said story using the "Translate" tab. In the translation, I have to again select "Recycling", then translate the story to French with the title "Projet de recyclage en Haiti".

I would expect the term "Recycling" (taxonomy/term/1) to display all articles in the current language. That is, taxonomy/term/1 would, I expect, show only "Recycling project in Haiti" because my site is in English by default. When clicking "French" on the language selector, I would expect only "Projet de recyclage en Haiti" to show up.

The fact is, in both cases, both the french "Projet de recyclage en Haiti" and the English "Recycling project in Haiti" show up (only peripheral stuff change, like the date posted, "comments" becomes "commentaires", etc).

I am relatively new to Drupal, so I am probably missing something here. What is the correct method to get what I want (that is, I never want both english and french versions of an article to appear in the same taxonomy/term/x list.)?

Thanks in advance for your help,

Albert.

Comments

Anonymous’s picture

You are missing a step:

The computer has no way of knowing that it is not supposed to show both. It is basically doing what you tell it to do: namely show this post when this term shows up.

You will have to find a way to differentiate between the two.

-Anti-’s picture

Just to say...

I've got a similar problem which might be related to yours.
After writing an english blog 'node', I can then 'translate' it to spanish in v6.x using the locale module.
However, when I go to www.mydomain.com/blog, ALL the blog nodes are listed.
I see the spanish version in the list, and right underneath is the english version of the same blog entry.

That's silly - if my language in the profile or language selector is english, then I should only see english
nodes listed (the nodes which have a spanish version should have a link to it). Listing several different
linguistic versions of the same content is daft.

I'm completely new to Drupal, but if I were to guess I would suggest that these default 'views' (which
seem to be 'hard wired' into the core modules Eg. /blog and taxonomy/term/1) do not take any
account of language selection. I think probably the solution is to use the 'views' module add-on and
create custom lists which do consider language.

I hope someone can elaborate on the issue.

timoratd’s picture

subscribe...

alberto56’s picture

Hi again,

thanks for your comments. I think this problem touches on an important issue in multilingual website development. In this case, it seems that the taxonomy was developed as fundamentally language-independent, which makes sense because concepts (which is what the taxonomy is, really) are not dependent on language.

However, the taxonomy system forces us to identify concepts with strings, which must be in a given language. For example, I could call my Recycling concept "recycling (recyclage)", but what if I have twenty different languages?

However, how to assign language-dependent strings to language-independent concepts. (For example, having the concept "recycling-concept", the string "recycling" related to this concept for English-speaking authors and the string "Recyclage" related to this concept for French speaking authors). Both Recyclage and Recycling could have "recycling-concept" as a parent. Only "recycling-concept" would display all nodes of all languages (which in the real world nobody would ever do, I think). This makes things clunky for the authors of articles, I think. Again, in an environment with fifteen or twenty languages, I did not find any way of allowing only "French" concepts to apply to French-language posts (all taxonomy terms can apply to all posts).

Another problem with the foregoing approach: Recyclage cannot be described as the french equivalent of Recycling, which messes up automatic menu translation, which is a cool feature in Drupal.

The basic shortcoming, it seems to me (again, I am a Drupal novice so I might be missing something), is that Taxonomy was not designed as multilingual from the get go.

Anyway, I find that the default behavior has some internal logic but to me is counter-intuitive. For the novice that I am, the simplest way to deal with this is to give my concepts (taxonomy terms) english names (and hope my international authors understand english), and then to tweak the taxonomy module as follows (Anti could probably tweak the blog module in the same manner):

in modules/taxonomy/taxonomy.module,


function taxonomy_select_nodes($tids = array(), $operator = 'or', $depth = 0, $pager = TRUE, $order = 'n.sticky DESC, n.created DESC') {

/* begin modification -- this modification added to allow the taxonomy module to display only posts in the current language or posts which are language-independent. Posts in a language other than the current language will not be displayed. Note that for this to work, you must add the variable $theLangDepWheres after all WHERE commands in the SELECT clauses within this function, for example ...WHERE tn.tid... should become ...WHERE'.$theLangDepWheres.'tn.tid IN...   */

	$theSelectOnlyCurrentLangFlag = true; 
	// set to false to keep the original (6.x) behaviour. Setting this to true will eliminate, in a list generated by /taxonomy/term/x, posts which are explicitely in a language different from the current language

	global $language; // the global language object
	$theLocale = $language->language; // the locale will now hold the current language as a two-letter abbreviation, for example en or fr

	if($theSelectOnlyCurrentLangFlag) {
	
		$theLangDepWheres = " (n.language = '$theLocale' OR n.language = '') AND "; 
		// add this variable after WHERE in the following SELECT clauses.
	
	}

/* end modification */


Thanks again for your replies,

Albert.

-Anti-’s picture

> In this case, it seems that the taxonomy was developed as fundamentally language-independent, which makes sense because concepts (which is what the taxonomy is, really) are not dependent on language.

Could this problem be solved if the taxonomy 'vocabulary' setting (/admin/content/taxonomy) had an option to be attached to a language?

So, a 'school' vocab with the terms class1, class2, class3, etc could be designated as 'english' tags and a different 'colegio' vocab with the terms clase1, clase2, clase3, etc could be designated as 'spanish' tags. Then, when a user is creating a node with 'spanish' chosen in the selector (or is using the 'translate' feature), only the spanish vocab and terms are displayed rather than the english ones.

It's maybe something to suggest to the drupal developers?

For the seperate issue of displaying nodes of only one language, although it would be nice to have the default 'views' made language aware, I really hope that the 'views' module can create queries which will filter by language! One reason I'm trying to switch to Drupal was the claim that multilanguage was supported; but it seems like the implementation still has a long way to go.

seutje’s picture

I tried to solve this by making a category for each language

called "Keywords" for english and "Sleutelwoorden" for dutch

this work fairly decent, when I make a node in english, it only shows the box for Keywords and when I translate that node, it'll show the box for Sleutelwoorden

but...

when I go to the view for a certain term (I actually tried one that's the same in every language), and I then switch to the dutch view, I end up in a totally different terms view

example:

I made a couple pieces of content and free-tagged them, like I made a newspost and tagged it with "Drupal, i18n, language, translation", I then translated that node to dutch and tagged it with "Drupal, i18n, talen, vertaling", in the same order as in the english version
now when I go to http://www.example.com/en/category/keywords/drupal, I only see the english nodes that were tagged with "Drupal"
if I then switch to the dutch view using the content translate block, I end up in http://www.example.com/nl/category/sleutelwoorden/talen, which would be the dutch for "Languages" and not for "Drupal" as this is the same in both languages

but if I then switch back to english, it bring me to http://www.example.com/en/category/keywords/languages, which is the correct result
later I noticed that if I switch from english to dutch on any category-page, I will end up on the "Talen" page
and if I switch from dutch to english on any category-page, I will end up on the "Languages" page

in both languages these are neither the first, neither the last term in the list

so it doesn't rly make sense as to why it would go to that page and not just give a "page not found"

but maybe this can be explained by the fact that I'm running global redirect and stuff

ergunk’s picture

It seems there is a confusion(If you are using "Content Type" vocabulary to create content types).

But if you want to have a vocabulary named "Content Type" to categorize your content for both languages:

You should first set up a multilingual vocabulary:
Then add terms for each language. And then translate terms. See how to: http://drupal.org/node/335205#comment-1202352

Assuming you have read/followed instructions stated on given link:
- You will have a multilingual vocabulary named "Content Type".
- You will add "Recycling" term and set English as its language
- You will add "Recyclage" term and set French as its language.
- You will create a translation for Recycling-Recyclage terms.

After these are done, Recycling term will shop up only when you switch UI language to English as you create a pages. If you switch site language to French, only Recyclage term will shop up on "Content Type" drop-down.

To show content by languages:
On Site configuration > Multilingual system > Internationalization page, choose "Only current language" option under "Content selection mode"

So when you switch to French you will see "Projet de recyclage en Haiti" page and when you switch to English you will see "Recycling project in Haiti" page.

Logic is the same for multilingual Primary links etc...

Hope these help...


Mediasaur | http://www.mediasaur.com/en | http://twitter.com/mediasaur


Before asking for help, please read this http://slash7.com/2006/12/22/vampires/ and don't be a "Help Vampire". :)