Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues
Author Message
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sun Jul 31, 2011 7:13 pm Reply with quote

I noticed the issue while trying to test my greek HTML Newsletter language files and when I hit the admin section, I had several errors which pointed to several modules with hard-coded "assumptions" of language file inclusions.

The modules where I found issues in the case.php are:
- Advertising
- Encyclopedia
- FAQ

There could be other issues, so might be good to review each module and its admin (if relevant).

Taking advertising as the example, here is the code:

Code:
include_once('modules/' . $module_name . '/admin/language/lang-' . $currentlang . '.php');



As you see, no fall-back. Here is an example of a module (Content) which does have fall-back:

Code:
if(file_exists(INCLUDE_PATH.'modules/'.$module_name.'/admin/language/lang-'.$currentlang.'.php')) {

   include_once(INCLUDE_PATH.'modules/'.$module_name.'/admin/language/lang-'.$currentlang.'.php');
} elseif(file_exists(INCLUDE_PATH.'modules/'.$module_name.'/admin/language/lang-'.$language.'.php')) {
   include_once(INCLUDE_PATH.'modules/'.$module_name.'/admin/language/lang-'.$language.'.php');
} else {
   include_once(INCLUDE_PATH.'modules/'.$module_name.'/admin/language/lang-english.php');
}


I would think that it would be better to have a consistent function/object (API) to call to handle pulling the right language file depending upon all the many factors which come into play.

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Sat Aug 06, 2011 2:40 am Reply with quote

It's been a while but isn't the function get_lang($module) supposed to include the correct user/admin, module dependent language file automatically??
 
View user's profile Send private message Send e-mail
montego







PostPosted: Sat Aug 06, 2011 7:56 am Reply with quote

That may be true, but the above mentioned modules are not using a function. Wink They are hard-coding the language file based upon $currentlang.
 
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Aug 06, 2011 10:04 am Reply with quote

I will look into it.

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> v2.4 RN Issues

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©