Zen Cart Logo
Forums / General Questions / What is the correct way to include a file from the current language?

What is the correct way to include a file from the current language?

Locked

Views: 1,636

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
18 Jun 2008, 10:13 PM
#1
karma_lab avatar

karma_lab

Zen Follower

Join Date:
Apr 2008
Posts:
135
Plugin Contributions:
0

What is the correct way to include a file from the current language?

I need to include this file path to an override:

includes/languages/english/CUSTOM/account_history_info.php

Of course, I can just hard-code it and it works. However, what is the correct syntax so that it would still work after changing to a different template or language?

I can't come up with an example at the moment in the code, although I'm sure there is one.

For example, here's some code that gets the correct directory for a template file:

require($template->get_template_dir('tpl_account_history_info_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_account_history_info_default.php');

I'm thinking there must be something similar for language files. Thanks!

19 Jun 2008, 11:51 PM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,703
Plugin Contributions:
56

Re: What is the correct way to include a file from the current language?

What you're looking for here is $_SESSION['language']. So for

includes/languages/english/CUSTOM/account_history_info.php

the include would be

include_once(zen_get_file_directory( DIR_WS_LANGUAGES . $_SESSION['language'] , 'account_history_info.php', 'false'));

20 Jun 2008, 9:28 AM
#3
karma_lab avatar

karma_lab

Zen Follower

Join Date:
Apr 2008
Posts:
135
Plugin Contributions:
0

Re: What is the correct way to include a file from the current language?

Thanks much, I'll try that tomorrow! :smile: