I haven't had the chance yet to take a look at the code, but I'm pretty sure you could do this without hacking core.

Have you tried using any of the following modules/techniques?:

- purl (http://drupal.org/project/purl)
- url_alter (http://drupal.org/project/url_alter)
- custom_url_rewrite_outbound (http://api.drupal.org/api/function/custom_url_rewrite_outbound/6)

Comments

jax’s picture

I know of these modules but I would be surprised if it was possible to implement this without hacking core. It certainly won't be pretty. The problem is that if you set the language in hook_boot it will be reset by the language initialisation. Then you need to make sure to set the language back in hook_init() and make sure it runs before any other module.

I'll look in more detail at the modules and see what I can come up with.

danny_joris’s picture

Hello Olivier,

What is the status on this? Not sure if this is possible, but I agree on a solution without core hack. The last patch is for D-6.15 while 6.17 is out now. Though this might still work, the patches will be outdated fast.

Maybe a backport in core from D7 is more likely?

jax’s picture

D7 supports custom language negotiation so it should be possible to implement this in D7 without patch. I'll update the module with a patch for D6.17.

jax’s picture

The patch has been updated in HEAD. Since it the one in beta still applies I'm not creating a new release.