If the page contents are mostly complicated codes interweaved with foreign language, I would most certainly make use of different folders for different tutorials.
/Tutorial1/lang/en/index.php
/Tutorial1/lang/de/index.php
I find consistency to be very important in such cases to get a solid multi-language system up and running. One way to get the the universal language codes?.. e.g. en/de/cn/etc so that the system is robust enough for future upgrades.
You will probably need an administration interface to add new languages (database driven), manage the articles and to shift/rename the tutorial folders perhaps? Or a menu to indicate/store the number of languages that each tutorial would support?
e.g.
Language Administration
en -> English
de -> German
cn -> Chinese, etc
Overview Administration
Tutorial1 -> Supported languages (en,de) [Manage]
Tutorial2 -> Supported languages (cn) [Manage]
Tutorial Administration
Tutorial Name: Tutorial Lesson 1
etc.
The challenge of a multi-language site is high, to maintain it, probably even more difficult. :eek: A good base would certainly help alot!
I'm currently attempting to build a Hybrid language site. It contains 2 different styles of language management.
1) Using language folders. (similiar to above)
2) Using database-driven words/phrases.
The second method entails adding a new "phrase", e.g. "hello" into the database. I will have a menu that requires me to enter the translated word for other languages as well (e.g. chinese, german).
To fetch the phrases, I created a Language class which will fetch the required values based on the phrase.
Something like:
$myLanuage->setLanguage("de"); // Set to german
//.... (more code) ...
echo $myLanguage->parse("hello");
If it manages to get a match, it returns the translated word (& caches the word as well in a cache array of the Language class, in case the word appears many times on the same page).
The helpful part is IF it doesn't find a match, I can make the object return a generic message (e.g. "hello", or some warning message "hello" phrase cannot be found) This way, in the event that I add a new phrase, but didn't enter the correct translated description, I would see a warning on the output.
P.S. I'm picking up ActionScripting!
Cheers,
Alvin.