Jump to content

Two languages to choose


kurt.santo

Recommended Posts

We're now starting to talk content management, rather then language negotiation...Speaking of which, this is exactly why I said I store each language's files in folders. This allows me to also have subfolders with more subfolders as needed.So, your folder structure could look like

content   |   |- _common.php   |   +-- sub1   |  |   |  |- _commonToSub1.php   |  |   |  |- _anotherCommonToSub1.php   |  |   |  |- pageInSub1.php   |  |   |  |- anotherPageInSub1.php   |  |   |  +-- sub1sub1   |	 |   |	 |- _commonToSub1sub1.php   |	 |   |	 |- pageInSub1sub1.php   |   +-- sub2   |  |   |  |- _commonToSub2.php   |  |   |  |- _anotherCommonToSub2.php   |  |   |  |- pageInSub2.php   |  |   |  |- anotherPageInSub2.php   |   +-- sub3...

This gives you unlimited flexibility in what you may have and how are you going to change it. The trick is to go into each sub folder, gathering the common files along the way, until finally loading the targeted page. How exactly do you do it is a tricky bit though, and if I'm going to implement it, I'll be practically making a CMS for you.If you wanted (though I assume you won't need it), you can create an index of common files needed for each page, so that you can gather for example only _commonToSub2.php without _anotherCommonToSub2.php or vise versa if only one is required for say pageInSub2.php. Files not indexed though should probably assume they need all common files along the way.

Link to comment
Share on other sites

That sound like a lot of fun (adding to my desperate efforts to master JavaScript;-))... Great input! I will certainly try to follow your guidance as much as possible. Learned a lot, lol:-) Am sure you will see my efforts when I am done with the functionality. Will post to receive some feedback about how bad I was doing...Kurt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...