我想建立一个有两个版本的网站。 英语,印度语(卡纳达语)。该网站应在整个网站上具有相同的设计,创意,结构和数据。
此站点内容繁重,需要一个cms和一个相关的语言编辑器。我是一名PHP编码人员,并且对任何免费的cms(wordpress,drupal,joomla)都表示满意。我听说在我的共享服务器上安装字体以支持Kannada语言。我猜这些字体应该支持所有平台(Windows,Mac,Linux和移动网站。)
任何人都可以在这方面帮助我。是否有任何免费的窗口小部件和插件可以安装在我的共享服务器上,并可以用预期的语言显示我的网站。
Joomla具有joomfish插件。很好而且广泛。值得研究。
您应该为您的语言设置正确的字符集,我认为utf-8将对您有用
header("Content-Type: text/html; charset=utf-8");
在脚本顶部
您可以将typeface.js用于英语,印度语(卡纳达语)简单又好用! get your typeface.js
很久以前,我已经用php完成了kannada网站,我在网站中使用了菜单和非动态内容的定义,并且将要插入DB的数据都将它们转换为“实体”
您可以使用此功能
function ascii_to_entities($str)
{
$count = 1;
$out = '';
$temp = array();
for ($i = 0, $s = strlen($str); $i < $s; $i++)
{
$ordinal = ord($str[$i]);
if ($ordinal < 128)
{
/*
If the $temp array has a value but we have moved on, then it seems only
fair that we output that entity and restart $temp before continuing. -Paul
*/
if (count($temp) == 1)
{
$out .= '&#'.array_shift($temp).';';
$count = 1;
}
$out .= $str[$i];
}
else
{
if (count($temp) == 0)
{
$count = ($ordinal < 224) ? 2 : 3;
}
$temp[] = $ordinal;
if (count($temp) == $count)
{
$number = ($count == 3) ? (($temp['0'] % 16) * 4096) + (($temp['1'] % 64) * 64) + ($temp['2'] % 64) : (($temp['0'] % 32) * 64) + ($temp['1'] % 64);
$out .= '&#'.$number.';';
$count = 1;
$temp = array();
}
}
}
return $out;
}
或定义方法
define('lang','ಕನ್ನಡ');