Howto: set multilingual Taxonomy Terms as Blocks in Drupal 6

I wanted to have two different Taxonomy Vocabularies Displayed as Blocks and each of them to appear translated in the specific language that a user selects. I didn't want to create separate Taxonomy Vocabularies for each language, but instead wanted to have the same Vocabulary translated and the appropriate language shown.

This is how I did it.

You need to enable the following Drupal 6 internal modules (/admin/build/modules):

  • Locale
  • Content Translation

You will need to install the following modules (and enable all sub-modules associated with them):

Don't forget to associate the appropriate permissions (/admin/user/permissions).

Also, in the Content Types, don't forget to set the Multilingual Support to more languages.. For example, to have the Story content Type in two languages, go to /admin/content/node-type/story, expand the Workflow setting and in the Multilingual Support, select 'Enabled, with translation'

TAXONOMY

Step 1: Create two Taxonomy Vocabularies (/admin/content/taxonomy/add/vocabulary). You can add later more if you need. Make sure you follow the details below.

  • In Multilingual Options, select the 'Localize terms. Terms are common for all languages...' option (IMPORTANT!)
  • leave the Language field blank (i.e. no specific language selected) (IMPORTANT!)
  • Set the English name of the vocabulary (or whatever default language there is)
  • select the content types and edit the other usual settings

Step 2: Add a Term to the vocabulary in its default language

Step 3: Translate the Term in the other language (/admin/build/translate/search). Do the same with the other Vocabulary.

TAXONOMY BLOCKS

Step 4: Go to Taxonomy Blocks Settings (/admin/settings/taxonomyblocks) and click Add New Taxonomy Block (/admin/settings/taxonomyblocks/add). Set the title in the default language and click Create New Block

Step 5: In the Configuration Options, click your Taxonomy Vocabulary (in its default language) and make sure Enable is selected. If you have other vocabularies, disable them. Edit the other settings and finally click Save Configuration

Step 6: Add New Taxonomy Block and do exactly the same as in Steps 4 and 5, except of the name of the block: this time, set the block in the second language (the same for the second Vocabulary)

BLOCK SETTINGS

Step 7: Go to the Block section (/admin/build/block), locate and enable your newly created Taxonomy Blocks. Make sure you place them in the same Block Area (left sidebar, right sidebar etc)

Step 8: Go to your (default language) block and click configure. There, select your default language as the only language (instead of the All Languages setting)

Step 9: Do the same with the second language block, this time selecting the second language as the only language for this block.

CONTENT

Step 10: Create a node (story), set the default language for it and select the appropriate Taxonomy Term.

Step 11: Once saved, click the Translate link and add the translated content. The Taxonomy Term should now appear in the second language, thus nothing to do here. Save it and go to your homepage.

Now you should have the node you just created in a block in your default language. Switching the language, will completely switch everything: the content and the Taxonomy Terms shown in the blocks.

I hope this is clear. If not, please feel free to ask.

No votes yet

hello, I have a problem with

hello, I have a problem with this , I followed the details and can not work . the catagories are the same english strings without translate. I want to visit the /cn and display the chinese catagory names.