Forums / General Questions / Where are page specific language file included?

Where are page specific language file included?

Views: 1,274

Results 1 to 6 of 6
17 Jul 2012, 2:31 PM
#1
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Where are page specific language file included?

Can someone point me at the piece of code that includes page specific language files please?
I'm trying to make a jQuery mobile version of my store. On the whole, it is pretty straight forward....most pages just work.

One problem I've just noticed is it seems that the loading of page specific language files isn't working correctly.
It seems to be including all language files that begin with the current page name.
For example, if I load the checkout_shipping page, I seem to be getting the checkout_shipping AND the checkout_shipping_address language files loaded.

I'm pretty sure this will be down to something I've done!
If you can let me know where the language files are pulled in, I should be able to see what's going on.

Thanks!

17 Jul 2012, 2:44 PM
#3
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Where are page specific language file included?

It seems this does include both files as I thought.
If I leave the echo in this section of code

// set language or template language file
$directory_array = $template->get_template_part($language_page_directory . $template_dir_select, '/^'.$current_page_base . '/');
while(list ($key, $value) = each($directory_array)) {
  echo "I AM LOADING: " . $language_page_directory . $template_dir_select . $value . '<br />';
  require_once($language_page_directory . $template_dir_select . $value);
}

I get...
I AM LOADING: includes/languages/english/template/checkout_shipping.php<br />
I AM LOADING: includes/languages/english/template/checkout_shipping_address.php<br />

...is there a reason for loading both language files?
In other words, is it normal Zen Cart behavior or something I've broken?

17 Jul 2012, 4:10 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Where are page specific language file included?

It's normal.

.
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.

17 Jul 2012, 4:26 PM
#5
damiantaylor avatar

damiantaylor

Zen Follower

Join Date:
Aug 2009
Posts:
244
Plugin Contributions:
0

Re: Where are page specific language file included?

Thanks Doctor B,
Do you know if it will cause any problems if I change it to load only the 1 specific page language file?

Just out of curiosity, why does it load both language files?

17 Jul 2012, 6:05 PM
#6
drbyte avatar

drbyte

Sensei

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

Re: Where are page specific language file included?

What problem is it causing for you right now?

.
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.