rrrhythm Posted October 17, 2006 Posted October 17, 2006 as i'm getting pretty deep in the coding of my site i've been thinking about the overall structure of osC. in particular, the fact that any text appearing on a page is actually defined as a constant in catalog/includes/languages/english/specific_file.php, then called as a constant in catalog/specific_file.php i've been thinking about the "why" behind that, and clearly it's because of the need to display a single page in multiple languages. but i'm wondering if that's the only reason. because i'm pretty darn sure that i'll never put my pages in any language besides english, so that particular structure of defining the text somewhere else is just an unnecessary complication that is a middling sized annoyance. so i'm considering just coding each catalog/specific_file.php to simply contain the text defined in catalog/includes/languages/english/specific_file.php, and not rely on the constants, thereby simplifying my life in terms of coding, and potentially speeding up my store, since i can get rid of the require for the file with all the defines in it. but being a relative novice, i want the advice of any of you gurus out there as to whether there is some reason to keep that particular structure, besides the obvious, and for me unnecessary, ability to have my site in multiple languages. (and all you non-USAers out there can feel free to call me a typical isolationist american, i suppose ;) ) thanks for any thoughts rj
squeekit Posted October 17, 2006 Posted October 17, 2006 seems to me, hardcoding the text is "safe" enough - however, i think you would find doing so for all text would be more difficult than using the system as it's currently set up - but sure, where convienient hardcoding the text in should be fine. just to note - concerning links: i would, however, avoid hardcoding links and continue to use the "tep_href_link" function - because that function performs certian tests - specifically to see if a user that clicks a link is logged in or not - if logged in, then on the page linked to they will still be logged on -- if you hardcode your links it will bump logged on users to logged off... i thought i'd mention that just in case you were thinking about hardcoding links too...
Jack_mcs Posted October 17, 2006 Posted October 17, 2006 so i'm considering just coding each catalog/specific_file.php to simply contain the text defined in catalog/includes/languages/english/specific_file.php, and not rely on the constants, thereby simplifying my life in terms of coding, and potentially speeding up my store, since i can get rid of the require for the file with all the defines in it. Coding in modular form is the best practice. Getting rid of that wil make matters much worse for you and I strongly suggest against it. There are no advantages to the changes you suggest but several disadvantages. First, it won't save you any time by removing the includes. Then, trying to add a contribution, any contribution, will mean you will have to ignore the install instructions since they will no longer apply to your shop. Plus, any troubleshooting would be more difficult due to all of the extra text in the file. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Jack_mcs Posted October 18, 2006 Posted October 18, 2006 I'm not seeing the problem so it is difficult to think of a solution. If all you are concerned about is the other languages, besides English, then those directories can be deleted and then delete the languages in admin->localization->languages. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Recommended Posts
Archived
This topic is now archived and is closed to further replies.