Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hi,

I wonder if it would be possible to create a multi-language site with Couch. I was thinking about using the first segment as a language switch. I could use PHP to read that segment and write a conditional to show the right fields. (I haven't yet figured out how to deal with the different templates (en.php, nl.php and de.php) but I think that wouldn't be to hard).

Would this approach be the best way to deal with it? Or are there other (better) ways to (for instance) retrieve the names of the segments?

Code: Select all
<?php 
$_SERVER['REQUEST_URI_PATH'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$segments = explode('/', $_SERVER['REQUEST_URI_PATH']);
if ($segments[1] == "en")
  { ?>
  <cms:show text_en />
<?php   }
else if ($segments[1] == "nl")
  { ?>
  <cms:show text_nl />
<?php  }
else if ($segments[1] == "de")
  { ?>
  <cms:show text_de />
<?php  } ?>
Hi,

Please take a look at the following thread where we discuss the various ways to implement multi-lingual sites (my personal favorite is the last method discussed there) -
viewtopic.php?f=8&t=74

Hope this helps.
Great. Thanks, I'll dive right in to it.
3 posts Page 1 of 1
cron