Hi,

I am new to Drupal. Great product but a little hard to begin! I am building a multilingual site and have successfully installed multilingual modules (i18n, l10n,potx), enabled languages etc and figured out how to build the menus so that they switch language content when I change the site's interface language using the Language Switcher block. However I have been unable to figure out how to present language selections (presented in the language switcher block) as a drop down list, prefereably as a series of parent-child items that I could then add as a level 1 item to my main site menu. Any suggestions please?
PS - I have reviewed the content at http://drupal.org/node/188269 "Add a language switcher link to $primary_links" but I do not understand how or what to do with such code snippets in order to see if they can deliver the functionality I require.
Any help very gratefully appreciated.

Comments

kaicong’s picture

Status: Fixed » Active

I've come up with something similar to the language switch box except this shows a drop-down box selection (text only).

Ok I assume that you have installed all the languages correctly and have them working etc
(check other posts on how to install languages first)

We can then move on to creating the drop down box block.

1. Create yourself a block in administer > blocks > add block
(I just named my block title 'Language' for the users to see.)

2. Click on configure for the new block.

3. Change the block 'input format' to FULL HTML (I'm not sure if filtered html will work but you try later)

Paste this example code into the new block

<form name="jump">
<select name="menu" onChange="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;" value="GO">
<option value="#">----- Select -----</option>
<option value="http://www.yoursite.com/?q=lang">Deutch</option>
<option value="http://www.yoursite.com/?q=lang">Francias</option>
<option value="http://www.yoursite.com/?q=lang">German</option
<option value="http://www.yoursite.com/?q=lang">Chinese</option>
<option value="http://www.yoursite.com/">English</option>
</select>
</form>

* Each option value has a an example link so just change "http://www.yoursite.com/" to your site domain
* The "/?lang" part is the prefix that will be changed or differ too whatever language it's linked to.

To do this:
You can copy the language links from the current 'switch language box' by right clicking on each language and copy the link location.

4. Paste it in between the " " marks of the option value code.

* Note - If you are already logged in the website, the pasted url will need to be modified and will look like this

http://www.yoursite.com/(username)/?q=(whatever language-code)

Just remove the (username) out of the link before you save it

*Add on more languages options if you like.

4. Finally SAVE the block and move your new block to wherever you like on the template.

Done.

*This is just a work around until something solid comes out but it works!!
If your a PHP wiz maybe you can try write up a patch that automatically constructs the whole line properly by inserting each value.

As a multillingial site... I wish the whole site could be translated like google.

jose reyero’s picture

Status: Active » Fixed

Looks like there's a solution here

Status: Active » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

najibx’s picture

Status: Closed (fixed) » Active

While it does translate the site, but it force user to go to frontpage, instead of translation happen at that particular page. I was trying to do listing with "|" instead

idea

jose reyero’s picture

Status: Active » Closed (fixed)

@najibx, then you need to do some custom block or theming

We won't be adding anything like that into this module, which is already complex and big enough.

doublejosh’s picture

Here is a snippet for this which seems to be the "official" solution. http://drupal.org/node/313814