Simplify creation of multilingual sites

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Simplify creation of multilingual sites

Post by cmb » Mon Sep 08, 2014 1:09 pm

Hello Community,

since CMSimple_XH 1.6 the creation of multilingual sites is slightly more complex than in earlier CMSimple(_XH) versions. Apparently, that causes confusion, as there were multiple support requests in this regard, for instance, http://cmsimpleforum.com/viewtopic.php?f=29&t=6625 and http://cmsimpleforum.com/viewtopic.php? ... 612#p38065.

Actually, I thought the new approach is understandable: if one makes a copy of 2lang/ and renames it to the desired language code, he gets a warning that the content file (content/XY/content.htm) is missing. Simply saving the only page ("NEW PAGE") will usually create the necessary file (content/XY/content.htm).

However, Tata reported that he repeatedly get support requests from webmasters regarding how to add another language. He suggested to rename 2lang/ to 2lang-copy_rename_xx/ or so, and to add a respective subfolder to content/. That might make things easier to understand.

Another option would be to automatically move the necessary folder and files to content/, if a second language is accessed, and the structure is not already there, but still resides in 2lang/.

Thoughts?

PS: added link to Tata's suggestion.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Simplify creation of multilingual sites

Post by Tata » Mon Sep 08, 2014 1:47 pm

cmb wrote: Another option would be to automatically move the necessary folder and files to content/, if a second language is accessed, and the structure is not already there, but still resides in 2lang/.
Thoughts?
I thought about this as well, but:
1. the user must create respective folders anyway, they can't be created by PHP (using some option in configuration) and besides, on some servers the rights must be set manually anyway too.
2. crating folders manually will make endusers more aware how CMSimple_XH works and creation of 2lang and 2sites would be more flexible.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: Simplify creation of multilingual sites

Post by svasti » Mon Sep 08, 2014 4:56 pm

cmb wrote:Thoughts?
We could issue CMSimple_XH with a second language, so that people see how the files should be. Now the standard XH is in English, we could add ... (that would be the easiest) German as second language and discribe in both texts how to make (and delete) second language subsites.

So the distribution would be the same, with 2lang, however "de" would be added and "content/de/content.htm" or any other language. May be better to add "sk", so that people understand that it is an example of how to do it. Or what about "eo" to be really international and no offend anybody.

Alternatively we could prepare a download possibility where the user could choose the primary language and if necessary a secondary languages and a template and and and, .... however this is endless, we could also add all kinds of plugins, so I'd rather not do this.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Simplify creation of multilingual sites

Post by cmb » Tue Sep 09, 2014 9:58 am

Tata wrote:the user must create respective folders anyway, they can't be created by PHP (using some option in configuration) and besides, on some servers the rights must be set manually anyway too.
While creating the files and folders automatically has some issues, it is not impossible, though.
svasti wrote:We could issue CMSimple_XH with a second language, so that people see how the files should be. Now the standard XH is in English, we could add ... (that would be the easiest) German as second language and discribe in both texts how to make (and delete) second language subsites.
That is definitely an option. However, it might be confusing for the majority (?) of users who only need a single language (see also http://cmsimpleforum.com/viewtopic.php?f=29&t=6625).

Choosing anything else than "de" would require to include the respective language files in the download.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Simplify creation of multilingual sites

Post by Tata » Tue Sep 09, 2014 1:23 pm

cmb wrote:That is definitely an option. However, it might be confusing for the majority (?) of users who only need a single language...
That's why I thought about a symbolic language files/folders. If there won't be required any 2lang/2site, the folders may stay there without disturbing the website in any way. Or they can be deleted simply without any risk. I a news language shall be added, the szmbolic folders would be simpmly copied and renamed.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: Simplify creation of multilingual sites

Post by svasti » Tue Sep 09, 2014 2:26 pm

Tata wrote:the folders may stay there without disturbing the website
They produce a banner or a text entry, ... even if we take "xx" as language.

May be we should consider creating the content files automatically.

Tata
Posts: 3587
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Simplify creation of multilingual sites

Post by Tata » Tue Sep 09, 2014 7:57 pm

svasti wrote:May be we should consider creating the content files automatically.
There was an issue long time ago that it was not possible to CHMOD the folders/files created by PHP. If its possible to creat the whole 2lang structure utomatically without these limitations, then crearing it e.g. configuration would be the best and most comfortable way.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: Simplify creation of multilingual sites

Post by svasti » Tue Sep 09, 2014 8:17 pm

Tata wrote:There was an issue long time ago that it was not possible to CHMOD the folders/files created by PHP.
You are right, actually there is no change, I experienced this problem when writing the update.php script to update 1.5 to 1.6

On some servers it seems php cannot create these folders. On most modern servers however it seems to be possible (depends on the configuration).

Well this leaves the
Tata wrote:That's why I thought about a symbolic language files/folders.
Probably we'll end up having a tiny German subsite...

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Simplify creation of multilingual sites

Post by cmb » Tue Sep 09, 2014 8:49 pm

svasti wrote:
Tata wrote:There was an issue long time ago that it was not possible to CHMOD the folders/files created by PHP.

You are right, actually there is no change, I experienced this problem when writing the update.php script to update 1.5 to 1.6

On some servers it seems php cannot create these folders. On most modern servers however it seems to be possible (depends on the configuration).
Well, these issues boil down to who is the user executing PHP, who owns the file/folder (a most important "detail", that is frequently overlooked), and what are the permissions of the file/folder resp. its containing folder. See http://www.cmsimple-xh.org/wiki/doku.ph ... ermissions for further explanations.

Anyhow, content/ usually is writable by the PHP user; otherwise no backups could be created, and plugins couldn't create files and folders inside content/. Furthermore the system check would complain. content/ has to be readable and executable anyway.

If content/ is executable, readable and writable by the PHP user, then creating a subfolder for the language plus content.htm inside this folder is possible. Of course, it is mandatory to set the permissions of the subfolder as well as content.htm to 0777 resp. 0666, so that FTPing doesn't make any problems on servers where the FTP user is not the same as the user executing PHP (see also http://cmsimpleforum.com/viewtopic.php?f=29&t=7970).

The only drawback would be too generous permissions, but that is a general issue.
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: Simplify creation of multilingual sites

Post by svasti » Wed Sep 10, 2014 3:05 pm

cmb wrote:If content/ is executable, readable and writable by the PHP user, then creating a subfolder for the language plus content.htm inside this folder is possible.
The situation seems to be different on my server:

content/ is executable, readable and writable by the PHP user, and PHP can create files, write and delete everything. However, if PHP creates a new folder for a secondary language, it cannot create files in that folder, whatever permissions you give to the folder.

This is quite a headache, because some plugins, e.g. flexslider, create a folder userfiles/plugin/flexslider/, but then they are unable to create any files in that folder. Even if you create the folder with filezilla, it won't work. You have to create the folder on your computer and upload the (empty) folder, then it is finally working.

The problem is the "owner" of the folder.
cmb wrote:The solution is simple: just call chmod() directly after mkdir()
Tried it, but doesn't work if the owner isn't right.

Just wondering how many CMSimple_XH users would be affected by such servers?

Post Reply