We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Dual Language site

Dave September 24, 2014 by Dave

A similar question has been asked before over here

It seems this is a reasonable method but I don't like the idea of having separate folders/content for each translation so was wondering if this would work...

On each page I could have a field for each language. For example; title_en title_esp (this could possibly be in a grid for tidiness)

Then, (this is the part I can't figure out) with .htaccess rewrite the urls including the language code so they go to the right page, for example;

http://www.websites.com/en/about loads-> http://www.websites.com/about but keeps /en/ in the first segment.

So then in my template I can use {{ title_{{segment_1}} }} and it will pull the correct translation.

Not asking for someone to fix this for me just wondering if it's technically possible before I spend more time trying to figure it out?

Here's the rule I'm trying to use with no avail:

RewriteRule ^/en/?(.*)$ /$2 [L,QSA] RewriteRule ^/esp/?(.*)$ /$2 [L,QSA]


Answered by Dave!
>>>>>>> Answered <<<<<<<
9 Replies