On Mon, Jul 12, 2010 at 3:24 AM, Frederic Demians <frederic@tamil.fr> wrote:
As regards the system preference issue in particular, the problem may be better resolved by moving the serialization into a table in the database. As it stands presently, part of the system preference data is kept in the database in the systempreferences table while the other part is kept in the *.pref files. Moving the serialization into the database will have the benefits of keeping the data in one location as well as overcoming the file writing issues.
Isn't it too late?
I'll defer to Galen on that point. To be translatable you need not to forget to serialize
syspref templates per language, and then:
* modify syspref editor to get YAML data from DB rather than from .pref files, per language * modify translation process (LangInstaller.pm) to extract text from DB and and write into DB
Actually, the present yaml would simply go into a *.sql file under mandatory sysprefs. This would ensure their installation during the initial run of the web installer. As for translation: The current yaml files should be translated already. This change would only necessitate a one-time move of those files into the previously mentioned *.sql files and their appropriate directories. Translation into presently un-translated languages would then follow the already established procedures for translating the mandatory, etc. sql files.
It would be very useful to have a complete API to manage sysprefs and allowing to add, modify, update sysprefs, integrated with updatabase.pl process.
Now when we add a new syspref, we have to:
1. Add some text into a .pref file (history in git) 2. Add an INSERT statement to syspref table into kohastructure.sql 3. Modify various default values per language located in installer/data/mysql/<lang>/.../default-syspref.sql 4. Update DB number kohaversion.pl and add in updatabase.pl an INSERT statement.
Any sysprefs modification should aim at simplification. There is room for simplification:
* Clearly distinguish syspref values from a koha instance (stored in DB) and syspref templates (.pref file/db) * Put default values per language directly in .pref file (or DB but how will you track modifications by developers, we have git now) * Delete all perl language default values located in installer/data/mysql... * Delete deprecated fields in syspreferences table: options, explanation, type. And modify accordingly all .sql files.
This process is not aimed at fixing the syspref system for ease of use by developers... sorry, there is definitely not time for that before the 3.2 release. It is simply aimed at restoring a feature which is present in 3.0.x which many users depend on, but is not presently in 3.2.x. Having said that: this work could certainly form the basis of a solution to those problems encountered by developers when adding sysprefs to areas other than the 'local-use' tab. Kind Regards, Chris