Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

language_id


bobosc123

Recommended Posts

Posted

Hello my friends,

 

I have been trying to get a folder to change according to the language in use (or selected) by the user to select language driven files from the custom folders.

 

I am working on a contribution that already allows the administrator to select the addon folder in the admin. I have the following folders:

myaddons1 for English

myaddons2 for Dutch

myaddons3 for Spanish

 

I have the following code in my contribution that points to the folder "myaddons" that was chosen in the admin:

 

	define('ADDONS_DIR', MODULE_ADDONS_FOLDER . $this->addons_folder . '/');

 

The code above defines the addon folder like this: includes/addons/myaddons/

Notice that it also adds the '/' slash at the end.

 

How would I rewrite the define so that it would automatically add the language ID (numbers 1-3) to the end of the addons_folder?

 

I want the code to generate the ID of the language so that the addon folder path would look like this:

includes/addons/myaddons1/

 

The above would actually point to this path: includes/addons/myaddons1/ (for English) it would be myaddons2 if Dutch was the selected language and includes/addons/myaddons3/ for Spanish.

 

I know I am very close with this. Here is where I am at but no cigar:

global $languages_id;
define('ADDONS_DIR', MODULE_ADDONS_FOLDER . $this->addons_folder . '"$languages_id"/');

 

This does not work since it adds $language_id to the path instead of the id of the language:

includes/addons/myaddons$language_id/

 

At least I am getting the tag to add to the end of "myaddons" but that is not what I need. I need the actual ID (number) to be added to the end of "myaddons".

 

Anyone know what I may be missing...besides laying off of the coffee and getting some sleep?

 

Thanks so much in advance,

 

Bob

Posted

Have you tried this:

 

define('ADDONS_DIR', MODULE_ADDONS_FOLDER . $this->addons_folder . $languages_id . '/');

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted
Have you tried this:

 

define('ADDONS_DIR', MODULE_ADDONS_FOLDER . $this->addons_folder . $languages_id . '/');

OH MY GOSH!!!!

I'm such an idiot!!!

 

That did it! Thanks SO MUCH for taking the time to answer to my post! I can now go to bed in peace. :lol: :thumbsup: :thumbsup:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...