I'd like to thank the creators and maintainers of the "Internationalization" module. What a great effort. Thank you.

We are currently finishing up a multi-language deployment and are very impressed with this module. We did however run into a situation that could potentially effect others: language weighting.

The site we're creating is being translated into ten different languages, four of which are simple dialects (client's request). We use print theme('i18n_flags'); in one of our theme files to add our flags to the global header. It's quite slick. Regardless, our client has asked to have the languages appear in a specific order.

As we found out, that list is generated based on the name of the language, sorted alphabetically, ascending. Now, there are a number of things we could do to force ordering, and that's fine with us, but I think this feature could be implemented pretty easily and others may benefit as well.

Ideally it would be nice to simply assign a weight (-10 to 10) to each language, thus effecting the sort/order criteria.

Currently we've just modified each language title by prefixing them with a number.

  • 01 Swedish
  • 02 German
  • 03 French
  • etc.

This only works for us because we don't show the various languages/flags within the terms/links portion of each node. These titles are only seen when actually editing translations. It's not elegant but it works.

With a few more hours in the day, and a better understanding of the Drupal development standards, I'd be willing to take a stab at this feature enhancement. But, in the meantime, maybe someone familiar with the Internationalization module can put together a solution sooner.

Sincerely,
andrew

Comments

jose reyero’s picture

The languages are defined in the 'locale' module so this feature would need some patching for that module and I really dont think it will be much use for many users as to be worth the headache which is the follow up of a patch for a different module..

However, you can try these two solutions, they may work..

- Define your languages in the settings file instead of with the locale module. You can define i18n_languages and set the module to use it's own list. Here you can define them in whatever order you like. This feature is docummented.

- Create your own block using i18n's as a model.

If this work please, let us now.

kingofsevens’s picture

Well, think about this you are living in Spain and you have a 3 language site in English, German and Spanish. While somebody is displaying your English site, you may not want the order of the flags appear in alphabetical. German flag and Spanish flag. You would prefer first the Spanish flag and then German flag. (no harm meant =) ) Or your company has a newer Chinese site but you do not want the Chinese option just to be the first one in the order. Etc, etc...

I think this can be done just by adding a weighting option in the language adding page. It will be a nice option to have.

BTW, thanks for the great module. I'll try to contribute from now on..

jose reyero’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev

Just changed version.

About this, I think alphabetical is the best solution. Whatever order you chose someone's going to get angry.
Also from usability POV alphabetical is the best.

Ayway I'm for providing options, so if someone sends a good patch...

jose reyero’s picture

Status: Active » Closed (won't fix)

This has been addressed in newer versions (6.x) and Drupal 4.7 is not supported anymore. Please, consider upgrading