Reputation: 8805
/* index.php */
require_once('region.php');
require_once('es.php');
region.php
-region-related info (also sets $regionLang = 'es';
) and es.php
-mostly Spanish translations. Second file needed if language is Spanish 'es'
or it would be a different file e.g. 'en-us.php'
es.php
inside region.php
and why? Also how?
es.php
?/* index.php */
require_once('region.php');
/* region.php */
require_once('es.php');
Upvotes: 0
Views: 55
Reputation: 722
I would include es.php into region.php
Because, region.php decide my language whether it is spanish or not. If it is not my language, i can change the language file
We suppose in region.php;
//region.php
if(myRegion()=="Turkey"){
require_once('turkish.php');
}else if(myRegion()=="Spania"){
require_once('es.php');
}
so we avoid unnecessary file loads
Upvotes: 1