Zen Cart Logo
Forums / General Questions / Japanese language support?

Japanese language support?

Locked

Views: 1,655

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
4 Nov 2009, 2:45 AM
#1
totsubo avatar

totsubo

New Zenner

Join Date:
Nov 2009
Posts:
8
Plugin Contributions:
0

Japanese language support?

I'm looking at setting up an e-commerce with using Lunarpages as my hosting solution and ZenCart as my chopping cart solution. My clients will mostly be Japanese and before I sign up with the hosting company I need to make sure that ZenCart supports the following:

1- Japanese text input
2- Displaying the cart UI and any messages in Japanese
3- Users can select to have the cart in a language other than Japanese

The Hosting provider thinks ZenCart can do all of the above but can't give me a 100% guarantee.

From what I've read on the documentation Wiki it looks like there is no Japanese language pack since I see Japanese in the 'Translation Wanted' section but I would like someone with first-hand knowledge to confirm this for me :)

If a translation is needed, how much work is this? I may be willing to do it. Then again I see there is a Japan in the International support section and if they haven't done the translation it's probably because it's not that simple or easy?

Thanks in advance!

4 Nov 2009, 3:57 AM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Japanese language support?

srw2d.com/content/zen-cart-138-japanese-pack-install

Here you go

If you want to automate the process to change tables to utf8, you can use the script below (please back up your db first)

Create a file named utf8.php at the root of the cart, then place the code in

<?php
/* utf8 convert by yellow1912*/

require('includes/configure.php');

$db->Execute("ALTER DATABASE `".DB_DATABASE."` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");

$username = DB_SERVER_USERNAME;
$password = DB_SERVER_PASSWORD;
$db = DB_DATABASE;
$host = DB_SERVER;

function MysqlError()
{
        if (mysql_errno())
        {
                echo "<b>Mysql Error: " . mysql_error() . "</b>\n";
        }
}

$target_charset = "utf8";
$target_collate = "utf8_general_ci";

echo "<pre>";

$conn = mysql_connect($host, $username, $password);
mysql_select_db($db, $conn);

$tabs = array();
$res = mysql_query("SHOW TABLES");
MysqlError();
while (($row = mysql_fetch_row($res)) != null)
{
        $tabs[] = $row[0];
}

// now, fix tables
foreach ($tabs as $tab)
{
        $res = mysql_query("show index from {$tab}");
        MysqlError();
        $indicies = array();

        while (($row = mysql_fetch_array($res)) != null)
        {
                if ($row[2] != "PRIMARY")
                {
                        $indicies[] = array("name" => $row[2], "unique" => !($row[1] == "1"), "col" => $row[4]);
                        mysql_query("ALTER TABLE {$tab} DROP INDEX {$row[2]}");
                        MysqlError();
                        echo "Dropped index {$row[2]}. Unique: {$row[1]}\n";
                }
        }

        $res = mysql_query("DESCRIBE {$tab}");
        MysqlError();
        while (($row = mysql_fetch_array($res)) != null)
        {
                $name = $row[0];
                $type = $row[1];
                $set = false;
                if (preg_match("/^varchar\((\d+)\)$/i", $type, $mat))
                {
                        $size = $mat[1];
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} VARBINARY({$size})");
                        MysqlError();
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} VARCHAR({$size}) CHARACTER SET {$target_charset}");
                        MysqlError();
                        $set = true;

                        echo "Altered field {$name} on {$tab} from type {$type}\n";
                }
                else if (!strcasecmp($type, "CHAR"))
                {
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} BINARY(1)");
                        MysqlError();
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} VARCHAR(1) CHARACTER SET {$target_charset}");
                        MysqlError();
                        $set = true;

                        echo "Altered field {$name} on {$tab} from type {$type}\n";
                }
                else if (!strcasecmp($type, "TINYTEXT"))
                {
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} TINYBLOB");
                        MysqlError();
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} TINYTEXT CHARACTER SET {$target_charset}");
                        MysqlError();
                        $set = true;

                        echo "Altered field {$name} on {$tab} from type {$type}\n";
                }
                else if (!strcasecmp($type, "MEDIUMTEXT"))
                {
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} MEDIUMBLOB");
                        MysqlError();
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} MEDIUMTEXT CHARACTER SET {$target_charset}");
                        MysqlError();
                        $set = true;

                        echo "Altered field {$name} on {$tab} from type {$type}\n";
                }
                else if (!strcasecmp($type, "LONGTEXT"))
                {
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} LONGBLOB");
                        MysqlError();
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} LONGTEXT CHARACTER SET {$target_charset}");
                        MysqlError();
                        $set = true;

                        echo "Altered field {$name} on {$tab} from type {$type}\n";
                }
                else if (!strcasecmp($type, "TEXT"))
                {
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} BLOB");
                        MysqlError();
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} TEXT CHARACTER SET {$target_charset}");
                        MysqlError();
                        $set = true;

                        echo "Altered field {$name} on {$tab} from type {$type}\n";
                }

                if ($set)
                        mysql_query("ALTER TABLE {$tab} MODIFY {$name} COLLATE {$target_collate}");
        }

        // re-build indicies..
        foreach ($indicies as $index)
        {
                if ($index["unique"])
                {
                        mysql_query("CREATE UNIQUE INDEX {$index["name"]} ON {$tab} ({$index["col"]})");
                        MysqlError();
                }
                else
                {
                        mysql_query("CREATE INDEX {$index["name"]} ON {$tab} ({$index["col"]})");
                        MysqlError();
                }

                echo "Created index {$index["name"]} on {$tab}. Unique: {$index["unique"]}\n";
        }

        // set default collate
        mysql_query("ALTER TABLE {$tab}  DEFAULT CHARACTER SET {$target_charset} COLLATE {$target_collate}");
}

// set database charset
mysql_query("ALTER DATABASE {$db} DEFAULT CHARACTER SET {$target_charset} COLLATE {$target_collate}");

mysql_close($conn);
echo "</pre>";
4 Nov 2009, 4:03 AM
#3
totsubo avatar

totsubo

New Zenner

Join Date:
Nov 2009
Posts:
8
Plugin Contributions:
0

Re: Japanese language support?

Wow! Thank you so much for contributing this back to the community!

I'm new to the whole shopping cart thing so just want to confirm, using your language pack will simply give the user the possibility of switching the cart display to Japanese correct?

I'm envisioning my site to be bilingual (English/Japanese) and want to make sure that the cart solution I go with will allow me to easily, and dynamically changed the cart's language using the user's preferences.

Thanks!

4 Nov 2009, 4:04 AM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Japanese language support?

totsubo:

Wow! Thank you so much for contributing this back to the community!

I'm new to the whole shopping cart thing so just want to confirm, using your language pack will simply give the user the possibility of switching the cart display to Japanese correct?

I'm envisioning my site to be bilingual (English/Japanese) and want to make sure that the cart solution I go with will allow me to easily, and dynamically changed the cart's language using the user's preferences.

Thanks!
Yup, you can read more info on crystal koi's page posted above. He can also speak Japanese I believe, which may help.

10 Nov 2009, 1:45 PM
#5
totsubo avatar

totsubo

New Zenner

Join Date:
Nov 2009
Posts:
8
Plugin Contributions:
0

Re: Japanese language support?

I've download Krystal Koi's language pack and read is installation instructions. I'm new to this and the instructions don't say where to put the language pack.

Should I put the whole thing in my CUSTOM template folder?

Thanks!

9 Dec 2009, 4:12 PM
#6
reesy avatar

reesy

Totally Zenned

Join Date:
Mar 2005
Posts:
535
Plugin Contributions:
3

Re: Japanese language support?

@totsubo
http://www.zen-cart.com/wiki/index.php/Languages

@yellow1912
Thanks very much for your script, its just what most need.
Presuming your code is missing a ?> from the end. I tried it and received an error

Fatal error: Call to a member function on a non-object in /home/var/public_html/utf8.php on line 6

Line 6:

$db->Execute("ALTER DATABASE `".DB_DATABASE."` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
9 Dec 2009, 4:23 PM
#7
reesy avatar

reesy

Totally Zenned

Join Date:
Mar 2005
Posts:
535
Plugin Contributions:
3

Re: Japanese language support?

@yellow1912
Ignore my dribbel above, for some reason the site was running in php4 .
But I now get

Fatal error: Call to a member function Execute() on a non-object in /home/ukcarp/public_html/utf8.php on line 6

9 Dec 2009, 4:42 PM
#8
reesy avatar

reesy

Totally Zenned

Join Date:
Mar 2005
Posts:
535
Plugin Contributions:
3

Re: Japanese language support?

Remind me to think for 2 seconds before posting next time.

Add
require('includes/application_top.php');

And it all works like magic :clap:

26 Jan 2010, 5:22 AM
#9
studiotucker avatar

studiotucker

New Zenner

Join Date:
Sep 2008
Posts:
47
Plugin Contributions:
0

Re: Japanese language support?

totsubo:

I need to make sure that ZenCart supports the following:

1- Japanese text input
2- Displaying the cart UI and any messages in Japanese
3- Users can select to have the cart in a language other than Japanese

I used the Japanese language pack from Crystal Koi and it works perfectly. I disabled EN on my cart, but you can include icons to allow customers to switch to their language of choice.

Admin may also be switched between languages.

I'm very happy with the package, it allowed us to create a successful store within the Japanese market.

You will want to contact Crystal Koi about the payment module you decide on. There are a couple tweaks that may need to be done to make it work better. He can take care of those easily for a fair price.

26 Jan 2010, 5:52 AM
#10
totsubo avatar

totsubo

New Zenner

Join Date:
Nov 2009
Posts:
8
Plugin Contributions:
0

Re: Japanese language support?

Thanks for the reply. I've decided to go with Drupal and Ubercart instead of Zen. I guess I should unsubscribe myself from this thread :)