简体   繁体   中英

How to create website in Indian language - Kannada

I wanted to build a website which would have two versions. English, Indian Language (Kannada) . The website should have same design, creatives, structure and data across the whole site.

This site is content heavy and needs a cms and a relevant language editor . I am a php coder and I am okay with any of the free cms present - wordpress, drupal, joomla. I have heard of installing fonts onto my shared server to support Kannada language. These fonts I guess should support all platforms (windows,mac,linux and mobile website.)

Can anyone please help me on this. Are there any free widgets, plugins which could be installed on my shared server and help display my website in intended languages.

Hi long back i have done kannada website in php, i used define for menu and non-dynamic stuffs in website, and what ever data is going to inserted in to DB convert them to "entities"

you can use this function

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;
}

or define method

define('lang','ಕನ್ನಡ');

link - http://www.jayashomeshop.com/?language=kn

Joomla has the joomfish plugin. It's good and extensive. It's worth looking into.

You should set correct charset for your language and I think utf-8 will work for you

header("Content-Type: text/html; charset=utf-8");

at top of your script

you can use typeface.js for English, Indian Langauge (Kannada) easy and nice one! get your typeface.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM