default language files for all languages

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
svasti
Posts: 1651
Joined: Wed Dec 17, 2008 5:08 pm

default language files for all languages

Post by svasti » Thu May 22, 2014 3:31 pm

Just having updated cmsimple-xh.org, I noticed that the new language items are not there in German. Therefore I'd like to propose something for 1.6.3:

Maybe we could add a default_de.php, default_nl.php etc. etc. so that newly added language items will be shown in the respective languages.
In this way one could keep the language files like de.php, nl.php very small, containing only items which have been changed from the default_de.php, default_nl.php

svasti

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

Re: default language files for all languages

Post by cmb » Thu May 22, 2014 5:37 pm

svasti wrote:Maybe we could add a default_de.php, default_nl.php etc. etc. so that newly added language items will be shown in the respective languages.
Sounds not unreasonable. However, in the long run we have to find some solution to let the system so many files (currently we read 2 config and 2 language files for every plugin on every request, and we will have to read another language file when we implement this suggestion; default.php has to stay there in case of missing language files).
svasti wrote:In this way one could keep the language files like de.php, nl.php very small, containing only items which have been changed from the default_de.php, default_nl.php
The actual language files will keep small only as long as they are not saved from the back-end, though.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: default language files for all languages

Post by svasti » Thu May 22, 2014 6:01 pm

cmb wrote:we have to find some solution to let the system so many files
What about generating one file with all language variables and one with all config variables similar to core/css/plugins.css
cmb wrote:The actual language files will keep small only as long as they are not saved from the back-end, though.
This could be changed, so that language and config files only contain changes to the default files. Makes updating easier.
Would even simplify development, as we could have a default language file and the English (which would remain rather empty) too in the developer version.

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

Re: default language files for all languages

Post by cmb » Thu May 22, 2014 11:20 pm

svasti wrote:
cmb wrote:we have to find some solution to let the system so many files

What about generating one file with all language variables and one with all config variables similar to core/css/plugins.css
I assume that there'll be no performance improvement when doing this for the config and language files. The problem is to detect whether the cache is stale, what seems to require detecting the filemtime() of all involved files. Most likely that pays off when it avoids additonal HTTP requests, but not for files which are handled solely on the server side.
svasti wrote:
cmb wrote:The actual language files will keep small only as long as they are not saved from the back-end, though.

This could be changed, so that language and config files only contain changes to the default files. Makes updating easier.
Would even simplify development, as we could have a default language file and the English (which would remain rather empty) too in the developer version.
I see two difficulties here. (a) We'd have to save only a "diff" (what might not be too hard), and (b) deliberately changed and removed language strings will not be catered for easily.

Anyway, it seems to me we'd have to measure instead of assuming/guessing/supposing.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: default language files for all languages

Post by svasti » Fri May 23, 2014 4:28 pm

The subject is really, how to get a painless update.
The small upgrade is relatively painless, however you don't get the new languages variabels in your language and deleted variable are still staying around, like "publisher".
I am just thinking about a way to improve this situation.
And in the long term it would be nice to simplify the upgrading process even more, like clicking a button "upgrade" and the program gets the correct download and installs it. At least in the cases linke going from 1.6.1 to 1.6.2 ? When others can do it, ...

Holger
Site Admin
Posts: 3470
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: default language files for all languages

Post by Holger » Fri May 23, 2014 4:55 pm

svasti wrote:When others can do it, ...
Look at the "painless" Worpress auto-update, LOL...

Personally I would not trust such a update-feature under all circumstances. It could break everything with a small mistake and you're not aware what exactly happened.

And I do not really understand where the "pain" should be when updating to a new version.
Uploading a few MB to the server should not be a problem for every webmaster.

Useful seems to me tools like your update_content-script. Maybe we need just something like that to clean-up unused variables or to create new
ones. So a little script which has to run on first login after an update should be enough...

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

Re: default language files for all languages

Post by cmb » Fri May 23, 2014 6:01 pm

Holger wrote:Look at the "painless" Worpress auto-update, LOL...

Personally I would not trust such a update-feature under all circumstances. It could break everything with a small mistake and you're not aware what exactly happened.
And you may not even know, that your site has been broken!

Furthermore WP's update requires all files and folders to be writable (or at least owned by the PHP user, so the files can be chmod'ed if necessary). It seems to me that this is likely to increase the impact of potential vulnerabilities.
Holger wrote:And I do not really understand where the "pain" should be when updating to a new version.
Uploading a few MB to the server should not be a problem for every webmaster.
Well, I don't see any problem regarding updating to a new revision, but upgrading to a new minor version is a PITA currently. To be on the safe side, you have to upload the new config and language files (core + plugins), and reconfigure them. The same has to be done for all plugin stylesheets, and perhaps even for the editor inits. All this is worse, if you have to upgrade a foreign installation, where you don't know which files had been changed.

All gets even worse, if there are plugins involved, which don't work under the new version. Simply removing or disabling them might break the site or at least parts of it.
Holger wrote:Useful seems to me tools like your update_content-script. Maybe we need just something like that to clean-up unused variables or to create new
ones. So a little script which has to run on first login after an update should be enough...
At least that might help somewhat.

However, I think it is important that we clearly distinguish between updates and upgrades, and don't force upgrades upon users too often, while still regurlarly offering updates with bugfixes and minor improvements.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: default language files for all languages

Post by svasti » Fri May 23, 2014 11:32 pm

cmb wrote:Well, I don't see any problem regarding updating to a new revision,
However you don't get the new language variables and don't get rid of unused ones, even if you go on updating and updating.
The concept is to differenciate the variables a user has changed from the ones he hasn't changed. This differentiation makes upgrading and updating easier, I think. Usually you want to keep the changes, and for the rest you want the up-to-date default.
How this is done technically is another point.

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

Re: default language files for all languages

Post by cmb » Fri May 23, 2014 11:47 pm

svasti wrote:The concept is to differenciate the variables a user has changed from the ones he hasn't changed. This differentiation makes upgrading and updating easier, I think.
ACK. And while this can be done relatively easy for the language and config files, it is extremely hard to do it for the stylesheets. I'm not thinking only about the core, where there is no user editable stylesheet, but about the plugins as well (I'm pretty sure, that a lot of users edit the plugin stylesheets). And keeping the plugins up-to-date seems to be more work as is necessary for the core.

So, all in all I would prefer some sophisticated update solution. But until there is one, we may improve the situation step by step.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: default language files for all languages

Post by Tata » Sat May 24, 2014 8:20 am

My "PHP LAMA" logic says, it would be safe to have distributed the most used languages and core dafault files (config, stylesheets etc.) in InstallPackage (named e.g. "file"_default.*).
Then to have "start_defaults_chek" wich would check:
[ external image ]
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.

Post Reply