ทำปุ่มสลับภาษา แบบไม่ต้องใช้ Block
template.php ใส่
function phptemplate_locale_block() {
$languages = language_list('enabled');
$links = array();
foreach ($languages[1] as $language) {
$links[$language->language] = array(
'href' => $_GET['q'],
'title' => $language->native,
'language' => $language,
'attributes' => array('class' => 'language-link'),
);
}
// Allow modules to provide translations for specific links.
// A translation link may need to point to a different path or use
// a translated link text before going through l(), which will just
// handle the path aliases.
drupal_alter('translation_link', $links, $_GET['q']);
$block = theme('links', $links, array());
return $block;
}
page.tpl.php ใส่
<?php print (phptemplate_locale_block());?>
กะลังหาอยู่พอดีเลย
http://drupal.in.th/node/396



