Hi,
here is my strategy of a current multilingual site.
It's a hackfree, cookiefree, programming free way, that hopefully not conflicts with further multilanguage concept of phpwcms.
I've setup a structure in Admin like this:
+ Home (root)
++ Home (de)
++ Home (en)
++ Home (ru)
++ Home (zh)
for each language I need to setup an own template
since phpwcms 1.3.x (?) you can setup and reference a custom setting file which overwrite config/phpwcms/conf.template_default.inc.php.
(this file hold global dateformats and some formating stuff)
take a look at this file and take a look to template/inc_settings/custom_settings.php and you will see.
You can choose this custom file where you setup you template (for each language) or when you setup your categories [Home(de)]
so for Home(de) I choose the de.template/inc_settings/de.custom_settings.php for Home(ru) template/inc_settings/ru.custom_settings.php etc.
in these files I just enable the language relevant options and set a new variable so it looks like this:
Code: Select all
$template_default['language'] = 'de';
// date and time formatting
$template_default['date']['language'] = 'DE'; // DE=German, IT=Italian, FR=French
$template_default['date']['long'] = 'l, j. F Y'; // (Monday, 1. October 2003)
$template_default['date']['medium'] = 'D, j. M y'; // (Mon, 1. Oct 03)
$template_default['date']['short'] = 'Y/m/d'; // (2003/12/25)
$template_default['date']['article'] = 'Y/m/d'; // (2003/12/25)
$template_default['time']['long'] = 'H:i:s'; // 15:25:45
$template_default['time']['short'] = 'H:i'; // 15:25
thats the basic - the $template_default['language'] variable is now globally for each language available and can be used for custom programming.
then I setup my german basic site and when finished copying the whole german structure to the other language and set the custom_settings in template or structure to the right file.
the languageswitch on site looks like this:
Code: Select all
// index-de is the alias of each root
<div id="languagebox">
[ID index-de]DE[/ID] [ID index-en]EN[/ID]
[ID index-fr]FR[/ID] [ID index-es]ES[/ID]
[ID index-ru]RU[/ID] [ID index-zh]CN[/ID]
</div>
the only thing that need to be programmed is a redirection to the right structure when switching language and I hope my idea is not so far away from olivers?! but I'm not shure. I imagine to set aliases in categories to other categories, to get an easier access in backend to related (other language) categorie - same in frontend.
but this is a basic idea that I need to figure out for a current project.
the {DE}Inhalt{/DE}{EN}Content{/EN} may work for smaller site with no complex content/text - but for bigger sites it's a pain in the ass I think, because of WYSIWYG Editors and linebreaks and loosing overview in longer texts.
yo, I hope you can follow me.
at the moment my solution works very well and the only thing I really need to figure out is the redirection to related cat when switching language and there is no logical connection between the language nodes in category setup and so new categorys and articles need to setup seperatly for each language - but that's the price in any multilanguage site
tell me what you think about that idea in general (Maybe Oliver can give some hints).
best wishes
marcus