My multilingual site contains 3 languages: English, Spanish and Portuguese.

Steps to reproduce:
1. Create a node in, for example, Portuguese. The list of languages in the language switching block is generated correctly:

<ul>
  <li class="en first">
    <a class="language-link" href="/en/translation_not_found">English</a>
  </li>
  <li class="es">
    <a class="language-link" href="/es/translation_not_found">Español</a>
  </li>
  <li class="pt-pt last active">
    <a class="language-link active" href="/pt/my-pt-node">Português</a>
  </li>
</ul>

2. Create a translation of the node, for example the Spanish one. Then the language switching block is the following:

<ul>
  <li class="es first active">
    <a class="language-link active" href="/es/my-es-node">Español</a>
  </li>
  <li class="pt-pt">
    <a class="language-link" href="/pt/my-pt-node">Português</a>
  </li>
  <li class="en last">
    <a href="/es/translation_not_found"/>
  </li>
</ul>

Problems:

  • the link in the last item should always point to /en/translation_not_found. Instead, it points to /es/translation_not_found when viewing the Spanish translation or to /pt/translation_not_found when viewing the Portuguese translation of the node
  • the a tag in the last item is standalone (language name and closing tag are missing)
  • the order of languages is wrong - Spanish should be on the 2nd place, Portuguese on the 3rd and the last item (displaying English and pointing to the correct URL) should be at the top

Comments

gavri’s picture

Thanks for the input - Ill try to fix it in the weekend - In the release of stable version

gavri’s picture

Status: Active » Postponed (maintainer needs more info)

I have a question for you - if you disable the 404 module - and do the same process as you describe what links do you get on the switcher?

gavri’s picture

Version: 6.x-1.x-dev » 6.x-1.0
Status: Postponed (maintainer needs more info) » Fixed

don't mind the last comment i manged to fix this issue tell me if you experience this problem again.
The problem was that by default Drupal don't show untranslated link if there are more than two languages - I didn't know that till I examined your issue.

This issue is now fixed in the new stable version i released (6.x-1.0)

thanks :)

petrd’s picture

I see 2 problems in the stable version:

There is a typo in node.translation404.inc on line 13, it says
$return = arraya();
but should say
$return = array();

Once this typo is fixed, the module works well except one thing: the order of languages is not respected in the language switching block. On my site the languages are sorted in the following way:
English
Spanish
Portuguese

But when a node is translated only into Spanish and Portuguese, the links in the language switching block are sorted differently:
Spanish
Portuguese
English

The other issues I reported are fixed.

Please let me know if you need any additional info.

Thanks for working on this!

petrd’s picture

Status: Fixed » Active

reopening...

gavri’s picture

Version: 6.x-1.0 » 6.x-1.2
Status: Active » Needs work

OK i fixed the array bug - but i had trouble to fix the order problem.
I will try to fix it soon but I couldn't find out why this is happening - my hook implementation function (translation404_translation_link_alter) returns the array in the default language order.
in the meantime I suggest you can fix this issue by writing your own theme function for the theme_links function the locale language switcher is using - I hope I will find out soon what is wrong here and give you a better answer.

milos1234’s picture

hi there, have you had any chance yet to fix this problem?

this plugin is very important to a multi-language drupal installation, but it seems like there are still a few problems with it

many thanks

milos1234’s picture

"you can fix this issue by writing your own theme function for the theme_links function the locale language switcher is using"

sorry, can you please explain how to do this.

thanks

milos1234’s picture

Gavri, have you had a chance to sort out the re-ordering of the language links yet? am about to launch a site, but cannot until it is fixed. thanks!