Forums / Templates, Stylesheets, Page Layout / Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Views: 1,526

Results 1 to 10 of 10
6 Dec 2012, 3:47 AM
#1
truongtamphong avatar

truongtamphong

New Zenner

Join Date:
Dec 2012
Posts:
5
Plugin Contributions:
0

Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Dear all,

  1. I am building a shop for Vietnamese language and I found this in source code of home page:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

Because my native language requires UTF-8, so I wanna change charset from "iso-8859-1" to "utf-8",
otherwise the web browser displays wrong.
I have tried to change many things in english.php and query_factory.php but the problem was not fixed.
Please show me how to make it change.

  1. I tried to find language package for Vietnamese fit to the version 1.5.1 but it seems the latest version
    is for 1.3.8. Please show me the way to create new language package, so I can do it myself and hope able
    to submit to the community.

I long to see your help. Thank you so much,

6 Dec 2012, 4:19 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

A brand new install of v1.5.1 is ALREADY entirely in utf-8, and will NOT show as iso-8859-1.

How did you get your site to be using iso-8859-1 ?

Maybe your language pack is written with CHARSET defined as iso-8859-1 in its vietnamese.php file? You'll need to fix that, and upgrade everything else missing in that language pack to include the things added/changed in v1.5.1

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Dec 2012, 4:57 AM
#3
truongtamphong avatar

truongtamphong

New Zenner

Join Date:
Dec 2012
Posts:
5
Plugin Contributions:
0

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Thank DrByte for your quick reply.

I knew that v1.5.1 is compatible with UTF-8, however what I got is "view source" from the home page "localhost/zen/" as the following:
Attachment 11585
You could see the charset in the red box. Is there anything wrong when I installed it?
In addition, there has been no language package for Vietnamese with v1.5.1 right now. So I would want to know how to create this package, for me, and for others if I think its translating quality is acceptable.

Thank you DrByte,

6 Dec 2012, 5:18 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

In a fresh install of Zen Cart v1.5.0 and v1.5.1, when you choose View Source, you'll see:```
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


If yours is showing iso-8859-1, then your CHARSET in your english.php (or whatever language file you're using) is set to iso-8859-1.  THIS IS VERY COMMON IF YOU ARE UPGRADING FROM AN OLD VERSION, and in the case of an upgrade, if your old site was actually using iso-8859-1, then converting your database to utf8 is a MUCH MORE COMPLEX ISSUE.

You haven't indicated whether this is a new install or an upgrade.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Dec 2012, 6:20 AM
#5
truongtamphong avatar

truongtamphong

New Zenner

Join Date:
Dec 2012
Posts:
5
Plugin Contributions:
0

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Dear DrByte,

My site is a brand new 1.5.1, not an upgraded version. I just installed new template "Sheffield Blue".
Could this template is the problem make change the charset of website?

6 Dec 2012, 6:52 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Then you've changed your english.php file incorrectly.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Dec 2012, 7:10 AM
#7
truongtamphong avatar

truongtamphong

New Zenner

Join Date:
Dec 2012
Posts:
5
Plugin Contributions:
0

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Finally I found the problem is english.php file.

I just changed the file F:\wamp\www\zen\includes\languages\sheffield_blue\english.php:

Line 22: @setlocale(LC_TIME, 'en_US.utf8');

And refresh the page. Done.
Thank you for your help DrByte.

By the way, could you show me the tutorial or some link to create new language package?
I would wanna localize the version 1.5.1.

6 Dec 2012, 7:17 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

truongtamphong:

By the way, could you show me the tutorial or some link to create new language package?
I would wanna localize the version 1.5.1.
Simple:

copy:
/includes/languages/english.php
/includes/languages/english/-everything, files and folders

to:
/includes/languages/vietnamese.php
/includes/languages/vietnamese/... all those other files and folders

Then translate every "define" statement in those files:

define('LEAVE_THIS_ALONE', 'translate this part here');

And be sure to save the files as "UTF8-without-BOM". There's a setting in your text editor for that encoding choice.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Dec 2012, 7:26 AM
#9
truongtamphong avatar

truongtamphong

New Zenner

Join Date:
Dec 2012
Posts:
5
Plugin Contributions:
0

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Cool,

I knew the problem with UTF with BOM in Notepad++.
Thank you so much for dedicated help, DrByte.

6 Dec 2012, 3:32 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Change CHARSET for home page & Localizing v1.5.1 for Vietnamese language

Don't forget the email templates:

/email/??

where ?? is the 2-character language code for vietnamese. You can start by just copying all the files from the /email directory into that one.