Simplify creation of multilingual sites
Simplify creation of multilingual sites
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.
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
Re: Simplify creation of multilingual sites
I thought about this as well, but: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?
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.
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.
Re: Simplify creation of multilingual sites
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.cmb wrote:Thoughts?
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.
Re: Simplify creation of multilingual sites
While creating the files and folders automatically has some issues, it is not impossible, though.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.
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).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.
Choosing anything else than "de" would require to include the respective language files in the download.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Simplify creation of multilingual sites
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.cmb wrote:That is definitely an option. However, it might be confusing for the majority (?) of users who only need a single language...
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.
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.
Re: Simplify creation of multilingual sites
They produce a banner or a text entry, ... even if we take "xx" as language.Tata wrote:the folders may stay there without disturbing the website
May be we should consider creating the content files automatically.
Re: Simplify creation of multilingual sites
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.svasti wrote:May be we should consider creating the content files automatically.
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.
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.
Re: Simplify creation of multilingual sites
You are right, actually there is no change, I experienced this problem when writing the update.php script to update 1.5 to 1.6Tata wrote:There was an issue long time ago that it was not possible to CHMOD the folders/files created by PHP.
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
Probably we'll end up having a tiny German subsite...Tata wrote:That's why I thought about a symbolic language files/folders.
Re: Simplify creation of multilingual sites
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.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).
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
Re: Simplify creation of multilingual sites
The situation seems to be different on my server: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.
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.
Tried it, but doesn't work if the owner isn't right.cmb wrote:The solution is simple: just call chmod() directly after mkdir()
Just wondering how many CMSimple_XH users would be affected by such servers?