XH Multilanguage support

Please post answers on the most frequently asked questions about CMSimple
beate_r
Posts: 171
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: XH Multilanguage support

Post by beate_r » Mon Oct 03, 2016 2:16 pm

svasti wrote:Well, it has become a little tricky...

Your domain (base folder)
...de
...|-2lang
...|-index.php
...content
...|-content.htm
...|-.htaccess
...|-de
.......|-content.htm
.......|-.htaccess
I have some trouble getting this to work (in a migration from a bilingual site done in Cmsimple 3.1):

the structure above is correct in my installation. site title, meta keywords and meta description initially have been left to their installation defaults (meanwhile ich changed the settings in de.php):

The German (default) version works fine, including all links.
The language menu is NOT displayed, although the call to languagemenu() is in the template and works under 3.1. The HTML code shows the empty container for it.
Explicitly calling b.ritzert.net/en/ shows the German text.

The old side is http://www.ritzert.net
And why is it helpful to configure Meta-Stuff and Site title in the generic language files?

The error_log moans on a missing default.css file (which might be a remnant to the 3.1 version; i'll check immediately) and expects images in en/images.

Mhmm.

lck
Posts: 1380
Joined: Wed Mar 23, 2011 11:43 am
Contact:

Re: XH Multilanguage support

Post by lck » Mon Oct 03, 2016 8:42 pm

Hello beate_r,

if your default language is German.
Login and set: Settings > Language ?Default: de

copy 2lang and rename new folder to en
open folder en
rename folder content to en
move this folder en to ./content/
copy your old englisch content.htm to ./content/en/content.htm

Login once http://example.com/en, edit a site and save it.

Also important for folders images und downloads:
http://cmsimpleforum.com/viewtopic.php? ... =10#p38521
http://cmsimpleforum.com/viewtopic.php? ... =30#p47177
„Bevor du den Pfeil der Wahrheit abschießt, tauche die Spitze in Honig!“   👉 Ludwig's XH-Templates for MultiPage & OnePage

cmb
Posts: 12934
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: XH Multilanguage support

Post by cmb » Mon Oct 03, 2016 9:42 pm

And if there are still problems, just activate debug mode. That might give helpful info in admin mode.
beate_r wrote:And why is it helpful to configure Meta-Stuff and Site title in the generic language files?
See the respective discussion. TL;DR: the langconfig was somewhat arbitrary, and there was no langconfig for plugins, so why keep it?
Christoph M. Becker –Plugins for CMSimple_XH

beate_r
Posts: 171
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: XH Multilanguage support

Post by beate_r » Tue Oct 04, 2016 11:37 am

Just a minor issue:

Something else:
info mode says:

OK'./content/content.htm' schreibbar
...
Warnung'./cmsimple/config.php' zugriffsgeschützt
Warnung'./content/content.htm' zugriffsgeschützt
Warnung'./templates/epi_beate/template.htm' zugriffsgeschützt

I'm on Debian. The ownership is www-data:beate and the permissions are set to 770. This enables full access to the web user (www-data) and to me in order to manually edit the configuration. To my understanding there should not be any problem with these permissions. It is the warning which contradicts the real accessibility test which might be misleading.

Back to my question.
BTW: debug mode gives no errors.

beate_r
Posts: 171
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: XH Multilanguage support

Post by beate_r » Tue Oct 04, 2016 12:17 pm

Small supplement. A fresh installation with just the default content works. So the problem must be elsewhere. I'll set up the site freshly.

cmb
Posts: 12934
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: XH Multilanguage support

Post by cmb » Tue Oct 04, 2016 12:46 pm

"zugriffsgeschützt" is about accessing these files via HTTP. Nobody should be allowed to access content.htm and template.htm from a browser (accessing config.php is no problem, as long as the file is processed by PHP; otherwise one could see the password hash). We ship respective .htaccess files, but these are apparently not recognized by your webserver.
Christoph M. Becker –Plugins for CMSimple_XH

beate_r
Posts: 171
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: XH Multilanguage support

Post by beate_r » Tue Oct 04, 2016 1:54 pm

mhmm, then the wording is misleading. It should read "ist nicht zugriffsgeschützt" instead, shouldn't it? Or, even clearer "ist nicht vom Zugriff über den Webserver geschützt" or something like that.

And Yes, You are right. This should never happen. Thanks for the hint. I need to check why a download is now possible. It was not when i did the initial configuration years ago.



BTW: not surprisingly after my last remark - i copied the modified files into the fresh installation - template, content files, languae files. Not config.php. And it works. My only idea is a syntax error in config.php of the failing installation.

cmb
Posts: 12934
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: XH Multilanguage support

Post by cmb » Tue Oct 04, 2016 2:19 pm

beate_r wrote:It should read "ist nicht zugriffsgeschützt" instead, shouldn't it?
Well, we have a only single message for both success and failure, and I'd rather not have two message (one for success and one for failure). Maybe we should improve the current messages, something like:
Prüfen ob content.htm zugriffsgeschützt ist … fehlgeschlagen
beate_r wrote:Or, even clearer "ist nicht vom Zugriff über den Webserver geschützt" or something like that.
Yes, we probably should clarify this message (IIRC you're not the first to ask about it).
beate_r wrote:BTW: not surprisingly after my last remark - i copied the modified files into the fresh installation - template, content files, languae files. Not config.php. And it works. My only idea is a syntax error in config.php of the failing installation.
A syntax error in config.php is supposed to trigger a fatal PHP error; so either you'd get a blank screen, or a respective message (depending on debug mode). I've no idea what could be wrong with your config.php, but maybe it's best to change the shipped config piecemeal, and check each time.
Christoph M. Becker –Plugins for CMSimple_XH

beate_r
Posts: 171
Joined: Thu May 22, 2008 11:44 pm
Location: Hessen / Germany

Re: XH Multilanguage support

Post by beate_r » Tue Oct 04, 2016 3:23 pm

I just diffed that config.php against the default. Nothing suspicious.
Must be a strange error, most probably not a problem with the CMS but due to me.
Meanwhile the updated site is productive; i even managed to reconstruct a bit more of the content lost by the old server crash.

Code: Select all

diff  config.php defaultconfig.php 
3,4c3,4
< $cf['security']['password']="\$P\$BlubbBlubb...";
< $cf['security']['secret']="BlubbBlubbBlubb";
---
> $cf['security']['password']="\$P\$BHYRVbjeM5YAvnwX2AkXnyqjLhQAod1";
> $cf['security']['secret']="5b2b98208d4fc6ce9331e47d";
7c7
< $cf['site']['template']="epi_beate";
---
> $cf['site']['template']="mini1";
9c9
< $cf['language']['default']="de";
---
> $cf['language']['default']="en";
11c11
< $cf['mailform']['email']="beate@ritzert.net";
---
> $cf['mailform']['email']="";
15c15
< $cf['meta']['author']="Dr. Beate Ritzert";
---
> $cf['meta']['author']="";
22c22
< $cf['backup']['numberoffiles']="5";
---
> $cf['backup']['numberoffiles']="10";
49d48
< 

cmb
Posts: 12934
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: XH Multilanguage support

Post by cmb » Tue Oct 04, 2016 4:18 pm

beate_r wrote:Meanwhile the updated site is productive; […]
Great! :-)
Christoph M. Becker –Plugins for CMSimple_XH

Post Reply