Home ›
Multi-lingual Page Redirect In Drupal
Running websites in Drupal with more than one language, sometimes you send out the wrong link. A quick fix for this, as a 301 redirect will not really change the language, is to do this:
First find out what you have your language code set to. You should be able to look this up in your admin. For example, lets say it was ja for Japanese.
You can then enter this in the node that you want to switch the language on.
<?php
global $language;
if( $language->language == 'ja' ) {
drupal_goto('http://example.com/example');
}
?>
Category
- Alethia (1)
- CCK (0)
- Command Line (2)
- Conditional Field (0)
- Drupal (7)
- Drush (2)
- E-Commerce (7)
- Hacks (1)
- Japan (4)
- MediaFront (0)
- Mercury (0)
- Online Media (1)
- Open Source (1)
- Pantheon (0)
- SSL (1)
- Screen-cast (1)
- Tutorial (3)
- Ubercart (2)
- Ubuntu (3)
- VPS.net (0)
- Yen (1)
- Zen-Cart (4)
- cPanel (1)
- i18n (1)
- iPhone (1)
- Free College (0)
twitter/srw2d
- @nicwn It was good this year too http://t.co/69RYMcA9 — 12 weeks 6 days ago
- Being in ubuntu + terminal to Cat Rats by Skrillex just feels so right. — 13 weeks 2 days ago
- Drupal Meetup in Tokyo Tomorrow Night! http://t.co/M6ctJt8A #drupal #japan #allyoucaneatdrink — 13 weeks 2 days ago
- Just got my Drupal T-Shirt, did you get yours? http://t.co/4PpfETpA — 14 weeks 1 day ago
- Drupal Social Event in Tokyo hope to see everyone out there that can come. http://t.co/z83asRRg — 14 weeks 6 days ago
- 1 of 53
- ››
Recent
- 1 of 2
- ››




Comments
Post new comment