djddc Posted March 25, 2010 Share Posted March 25, 2010 Hi all , I need some help with this line of code : define('DEFAULT_DB_LANGUAGE', 'english'); Where it says 'english' is refered to the folder ROOT >> language >> english. If say I have a folder named spanish but don't want to change the line manually each time, what could i put in the place of 'english' ? include_once( $fileExtension."language/".$session->value( "site_lang" )."/global.lang.php" ); is an example of a line of code i use that automatically selects the right file based on chosen language. could some one give me a hand with this ? thanx guys Link to comment https://forums.phpfreaks.com/topic/196508-help-with-1-line-of-code/ Share on other sites More sharing options...
alberrambo Posted March 25, 2010 Share Posted March 25, 2010 define function used as you for make a constant to represent some other constant.You have to define it each time independently. Link to comment https://forums.phpfreaks.com/topic/196508-help-with-1-line-of-code/#findComment-1031717 Share on other sites More sharing options...
shlumph Posted March 25, 2010 Share Posted March 25, 2010 Is this what you're looking for? define('DEFAULT_DB_LANGUAGE', 'english'); //Elsewhere in the code include_once( $fileExtension."language/". DEFAULT_DB_LANGUAGE ."/global.lang.php" ); Another example: define('DEFAULT_DB_LANGUAGE', 'espanol'); //Elsewhere in the code include_once( $fileExtension."language/". DEFAULT_DB_LANGUAGE ."/global.lang.php" ); Link to comment https://forums.phpfreaks.com/topic/196508-help-with-1-line-of-code/#findComment-1031719 Share on other sites More sharing options...
djddc Posted March 25, 2010 Author Share Posted March 25, 2010 ok thanks , thats what i was looking for ! Link to comment https://forums.phpfreaks.com/topic/196508-help-with-1-line-of-code/#findComment-1031722 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.