language detection and URL aliases/paths

Events happening in the community are now at Drupal community events on www.drupal.org.
thatpatguy's picture

Hey everyone,

I'm trying to figure out a way to resolve an issue on a site for a client and maybe one of you guys have had a similar issue and can offer some insight. I'm actually a bit surprised that there is little discussion about this (or at least little that I can find on google).

So it breaks down like this. I have a multilingual D7 site, with language detection set up to use the URL path prefix.

I have created two pages, one in English, let's call it Jobs, and say it's node:2 and another page, in French, called Emplois, say it's node:3 and that the two are linked as a translation of each other.

What I want to have happen is if the user goes to domain.com/jobs it takes them to node:2 in English and if the user goes to domain.com/emplois it takes them to node:3 in French.

From what I can figure out is that the way D7 wants to work is that if I don't include the path prefix it defaults to the default language set for the site (in this case English).

It seems to me that the functionality I'm looking for shouldn't be that unique, but I've only found one other page through my google search that has someone talking about it. Unfortunately he doesn't seem to provide a working solution, just a theoretical one, and didn't provide a way to contact him. The page I found is this one: http://darrelopry.com/story/using-url-aliasespaths-language-detection-dr...

So, any thoughts, suggestions, ideas would be most welcome

Comments

this works for me

dcolburn's picture

I've a bilingual D7 site set up to recognize the URL path and display the correct language result. I've used [menupath-raw] in the URL alias. I don't remember it being a headache at all.

Feel free to contact me directly if you think I can help. There's not enough info about the differences in our two projects at hand so it's difficult to narrow down a solution.

D

tricky

liquidcms's picture

hey Pat,

if you go here: admin/config/regional/language/configure

you will see the various mechanisms to detect language. my guess would be you are looking for something like "content language" (which isn't there).

in other words you want the site to flip languages based on the language of the content you are looking at. correct? since you have an EN node and a FR node. this isn't provided as an option since it would rarely be that useful since this wouldn't work for all the non-node pages - panels, views, module created pages, etc. for example what if you have a listing page which intentionally lists both FR and EN teasers?

the other concept that might be getting overlooked here is that content and interface are different. in other words it is not ridiculous to assume that someone (an admin, for example) might want to look at a FR node with the EN interface. difficult to do with what you are suggesting.

Ottawa

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: