phorcon3 Posted February 3, 2008 Share Posted February 3, 2008 hi, i'd just like to know if that's a really stupid idea what i'm trying to do.. so, ive been tryin to come up with a somewhat decent concept for a multi-language website ...but i still think its crap. i don't wanna do the mysql database thingy ..pullin all the data from my database is sure gonna mess up my servers performance, so i dun really wanna do that. it would only work if i had just a few phrases ..but i have entire sites i need translated ...static text problem is, i dun have templates (is that actually bad? would templates be more efficient? but i dunno how long it would take me to integrate smarty on my website ..for ..300 somewhat files ..probably a year) anyways ..if i had templates ..i could just link to different tpl-folders, such as root/tpl/en/ root/tpl/de/ root/tpl/es/ or whatever.. anyway, that probably woulda been the easiest way to do it.. so, what i might try to do is.. like... i dunno maybe create subdomains? or have just regular urls, such as http://www.domain.com -> english http://www.domain.com/de/index.php -> german instead of the subdomains, which of course would be http://de.domain.com/index.php i dont know how secure subdomains would be. so, anyway, heres my idea, and i gotta know if thats stupid and totally unefficient i copy ALL files, and put them in the root/de/ folder ...and just translate all those files (containing both, code & design) i mean there are 300 files, maybe ..but they only have a total of 2MB anyways.. but id just like to know if copying all of em, and translating em into a different language is just retarded or not. reference: i mean i dont know how youtube is doing it ..but when u link to a different site (ie: espana) ..they have subdomains for it (http://es.youtube.com). and i just wonder - do they use templates? and did they just translate those? - or are they using various text files? - or maybe they are usin database storage? - or did they do the same thing im trying to do. copy all files and translate those and put em in a different folder? i hope this makes sense, and it probably doesnt. i just dun know how to explain it better. lol but i really need this. ive been trying all day to come up with something that would be efficient and not mess up my servers performance. and i think i grew a brain tumor by doing so. and i dont mean to spam. but ive seriously searched the entire forum and havent really found anything. and google. nothing. absolutely nothing. ive found this site http://www.stylusinc.com/website/multilanguage_support.htm ..and is the third method, the same i try to do here? i mean, it says microsoft is usin that method lol. dont know if thats true or not, but if it is, im sure theres a good reason for it why they do it that way. i hope someone reads this lol. Link to comment https://forums.phpfreaks.com/topic/89138-multi-language-website/ Share on other sites More sharing options...
maxudaskin Posted February 3, 2008 Share Posted February 3, 2008 I think the best thing to do would be something like this... <?php /* en.php */ $string1 = 'Hello Earth'; $string2 = 'I love you'; ?> <?php /* fr.php */ $string1 = 'Bonjour terre'; $string2 = 'J'aime tu.'; ?> <?php echo $string1; echo '<br /><br />'; echo $string2; ?> Link to comment https://forums.phpfreaks.com/topic/89138-multi-language-website/#findComment-456543 Share on other sites More sharing options...
maxudaskin Posted February 3, 2008 Share Posted February 3, 2008 Sorry.. I meaned to put: <?php /* en.php */ $string1 = 'Hello Earth'; $string2 = 'I love you'; ?> <?php /* fr.php */ $string1 = 'Bonjour terre'; $string2 = "J'aime tu."; ?> <?php /* index.php */ $lang = $_GET['lang']; if($lang = 'en'){ include("langs/en.php"); }elseif($lang = 'fr'){ include("langs/fr.php") }else{ die("Language Not Found"); } echo $string1; echo '<br /><br />'; echo $string2; ?> Link to comment https://forums.phpfreaks.com/topic/89138-multi-language-website/#findComment-456544 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.