Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Where is the tpl_header.php for non-English?

Where is the tpl_header.php for non-English?

Views: 1,263

Results 1 to 13 of 13
6 Dec 2011, 3:53 PM
#1
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Where is the tpl_header.php for non-English?

I see there is a tpl_header.php for the template I am using in my site, I installed two other languages, I was expecting to see the same files in these two languages however I couldn't find them.

Am I missing something when installing them? or they just don't exist?

If they don't exist, then how the header is generated in that language? which file it is using to generate the header? I created my menu in the tpl_header.php, I would need to do the translation for other two languages but don't know which files should I work on?

Thanks.

6 Dec 2011, 3:59 PM
#2
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tpl_header.php is zencarts core file. this file has been moved to your custom template folder ( common ) because perhaps has been modified . this is called overriding .

language files don't alter core files , they are only translation for your site and those files reside in language directory of your site and is called by zencart whenever needed .

6 Dec 2011, 5:08 PM
#3
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tony_sar:

tpl_header.php is zencarts core file. this file has been moved to your custom template folder ( common ) because perhaps has been modified . this is called overriding .

language files don't alter core files , they are only translation for your site and those files reside in language directory of your site and is called by zencart whenever needed .

Understood, but there got to be a place for me to customize this particular file for different languages, right? Where and how do I do it?

Thanks

6 Dec 2011, 5:23 PM
#4
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

if you are talking about the constant that shows on your page ..

HEADER_TITLE_CONTACT_US.

go to admin > tools > Developers tool kit .

type the constant in bottom most search field . that should give you the location of language file that contains it . ( english ) , once you locate the correct english file , you can then correct the problem in other languages

6 Dec 2011, 5:34 PM
#5
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tony_sar:

if you are talking about the constant that shows on your page ..

HEADER_TITLE_CONTACT_US.

go to admin > tools > Developers tool kit .

type the constant in bottom most search field . that should give you the location of language file that contains it . ( english ) , once you locate the correct english file , you can then correct the problem in other languages

Thank you.

That only gives me the English file, when I switched to other languages and go to the tools/DevKit, I couldn't locate the constant in any files. :frusty::frusty::frusty:

6 Dec 2011, 6:11 PM
#6
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

because that constant dose not exist in other language files.
open the english file that contains that constant . locate that constant . it should start with word Define ()
note which english file contains that constant . then open the corresponding file in other languages . copy the exact define () statement into corresponding files then save your work . this should fix the problem for your other language.

6 Dec 2011, 6:21 PM
#7
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tony_sar:

if you are talking about the constant that shows on your page ..

HEADER_TITLE_CONTACT_US.

go to admin > tools > Developers tool kit .

type the constant in bottom most search field . that should give you the location of language file that contains it . ( english ) , once you locate the correct english file , you can then correct the problem in other languages

tony_sar:

because that constant dose not exist in other language files.
open the english file that contains that constant . locate that constant . it should start with word Define ()
note which english file contains that constant . then open the corresponding file in other languages . copy the exact define () statement into corresponding files then save your work . this should fix the problem for your other language.

Thank you, but like I said in previous posts, I didn't see tpl_header.php file in languages other than English

6 Dec 2011, 6:32 PM
#8
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

there is nothing to modify in tpl_header.php for language.

go to

includes / languages / your language

look for the file called header.php
open this file
add the following
define('HEADER_TITLE_CONTACT_US','Contact Us');

replace contact us with correct chines translation.

6 Dec 2011, 6:39 PM
#9
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tony_sar:

there is nothing to modify in tpl_header.php for language.

go to

includes / languages / your language

look for the file called header.php
open this file
add the following
define('HEADER_TITLE_CONTACT_US','Contact Us');

replace contact us with correct chines translation.

:hug::hug::hug:

Can I do the same thing to all the ezpages I put on the header as menu?

6 Dec 2011, 6:43 PM
#10
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

ez pages can only be translated if you add the free addon that i mentioned in other post . ez pages information reside in database.

6 Dec 2011, 6:50 PM
#11
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tony_sar:

ez pages can only be translated if you add the free addon that i mentioned in other post . ez pages information reside in database.

Thank you for patiently answer my silly questions, really appreciate that.

How do I not use ezpage to create my menu?

6 Dec 2011, 6:57 PM
#12
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

that requires a bit of hard codding . you need to add correct PHP code to your tpl_header.php , Create Constant , use those constant in your tpl_header.php and header.php file ( language files ) for correct translation .

although process is not that hard for experienced PHP programmer . However, novice might create more problem then is worth :)

you can search the Forum for how to add custom links to header . you should find more information regarding how to do that and how corresponding codes look like .

6 Dec 2011, 7:12 PM
#13
mdivk avatar

mdivk

Zen Follower

Join Date:
Sep 2011
Location:
Toronto, Ontario, Canada
Posts:
290
Plugin Contributions:
0

Re: Where is the tpl_header.php for non-English?

tony_sar:

that requires a bit of hard codding . you need to add correct PHP code to your tpl_header.php , Create Constant , use those constant in your tpl_header.php and header.php file ( language files ) for correct translation .

although process is not that hard for experienced PHP programmer . However, novice might create more problem then is worth :)

You are absolutely correct, however, pain is the path to no pain and there is no shortcut from novice to experienced, right?

I want to do that way.

And hope you (or anyone else on the forum) can shed me more light.

I searched the constant HEADER_TITLE_CONTACT_US and found it exists in header.php for all the languages, if I want to create a new constant HEADER_TITLE_WHATEVER, should I create it in all the header.php files? and how to make it appear in menu and link to the ezpage?

Thanks lots.