Bug 10509: Using i18n function for translation of MySQL web installer files

This patch makes the changes needed to progressively use a i18n function to
translate strings in the web installer's MySQL files. The English scripts may
contain fields like i18n(columnvalue); for English i18n(a) is a, but for the
other languages i18n(a) is the translation of a.
The corresponding script in the language folder contains the i18n definition.
The work is done in such a way that current installations are not affected.

Subsequent patches will make the changes in the .sql files themselves. This can
be done per folder, per language. Using the extension .i18n in the last
subfolder name triggers the new translation mechanism. (See also test plan.)

In Installer.pm the all_languages parameter is removed from load_sql_in_order.
This code was not used. This change also affects the call in install.pl.
The most important change is the use of a new subroutine _run_mysql_file in
load_sql. This new routine contains the above logic.
Although I also tested changing marc_framework_sql_list and
sample_data_sql_list, it proved imo to be easier (and more maintainable) to do
this via load_sql.

Test plan:
Since no .sql files are changed in this patch, please test if you can install
English and e.g. German (or another one) in the web installer without any
changes.

Bonus points for the following additional tests :)
They serve to illustrate the i18n concept more clearly.
1) Place in en/mandatory/userflags.sql around a few strings i18n('...').
Run English install again and check the userflags table. No changes expected.
2) Place in de-DE/mandatory/userflags.sql i18n around a few strings too. Also
precede the insert statements with this definition:
DROP FUNCTION IF EXISTS i18n;
CREATE FUNCTION i18n (d text) RETURNS text DETERMINISTIC RETURN concat(d,'xx');
Now run German install again; some of the userflag strings (with i18n) should
now end with xx.
3) Before retesting German install, make some changes:
Edit en/optional/sample_holidays.sql. Add i18n calls around strings.
Create an additional folder optional.i18n in de-DE.
Copy sample_holidays.sql and sample_holidays.txt from de-DE/optional.
Edit de-DE/optional.i18n/sample_holidays.sql. Remove all text! Add:
DROP FUNCTION IF EXISTS i18n;
CREATE FUNCTION i18n (d text) RETURNS text DETERMINISTIC
RETURN CASE d
WHEN 'Sundays' THEN 'Sonntag'
ELSE d END;
Now run German install again; in the optional part of the install mark
sample holidays (in the last section standing separately; do not confuse with
 the other one). Check the repeatable_holidays table afterwards. The string
above should have been translated only, the others are still English.
Undo the changes in .sql files; remove optional.i18n folder.
Bug 10520: Add i18n function to en/mandatory mysql files

Main goal: Adds i18n calls around translatable columns.
Additionally: Removes backtics.
Adds column names in inserts (where missing).
Uses consistent style (based on my interpretation of coding guidelines).

Test plan:
Make sure that you apply this patch on top of the 10509 patches!
Run English mysql install.
Verify that you include all mandatory files.
Check if webinstaller does not report errors.
Inspect table contents via interface or mysql.
Search for a column not using i18n where you would expect translation.

Note: If you prefer to run the mysql files from command line, please make sure
now that you define a 'fake' i18n, doing nothing (see Installer.pm code).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested both ways myself.
Noticed that I missed one message_transport_type (phone) and one language
description (180 vs. 181). If needed, will handle these on a separate report.
They do not directly relate to this patch.
Bug 10520: Add i18n function to en/optional mysql files

Main goal: Adds i18n calls around translatable columns.
Additionally: Removes backtics.
Adds column names in inserts (where missing).
Uses consistent style (based on my interpretation of coding guidelines).
Removed some locking statements in sample_creator_data.
NOTE: Some scripts insert numbers in auto-increment columns. Although this
works, I would not prefer to do so.
This patch however is not meant to change that, so leaves them for now.

Test plan:
Make sure that you apply this patch on top of the 10509 patches!
Run English mysql install.
Verify that you include all OPTIONAL files (in the OTHER DATA section).
Check if webinstaller does not report errors.
Inspect table contents via interface or mysql.
Search for a column not using i18n where you would expect translation.

Note: If you prefer to run the mysql files from command line, please make sure
now that you define a 'fake' i18n, doing nothing (see Installer.pm code).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested all optional data via webinstaller.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>