Bug 17762: Add the new TranslateNotices syspref

This whole patch set adds the ability to translate notices in different
languages.
That way, if a library has patrons from different countries, they will
not have to send the notices in only one language but they will be able to
translate them.

Test plan:
- Switch on TranslateNotices
- Translate the interface in different languages
- Edit patron's details
=> You should see a new "prefered language" entry
That language will be used to send notices to this patron
- Edit several notice templates
=> You should see different tabs, 1 tab per language translated at the
opac (which sounds to make sense)
- Now the notice generated for this patron should be the one translated
in the language picked for him
To confirm that, try to generate several notices for this patron.
If the notice is not translated, the default one should be used.

Sponsored-by: Orex Digital

Signed-off-by: Hugo Agud <hagud@orex.es>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-12-08 11:27:11 +01:00 committed by Kyle M Hall
parent 613c6508f0
commit 2b35e37d7f
3 changed files with 11 additions and 0 deletions

View File

@ -10,6 +10,9 @@ if( CheckVersion( $DBversion ) ) {
$dbh->do( "ALTER TABLE deletedborrowers ADD COLUMN lang VARCHAR(25) NOT NULL DEFAULT 'default' AFTER lastseen" );
}
$dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
VALUES ('TranslateNotices', '0', NULL, 'Allow notices to be translated', 'YesNo') ");
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug XXXXX - Add columns letter.lang and borrowers.lang to allow translation of notices)\n";
}

View File

@ -537,6 +537,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('TrackLastPatronActivity','0',NULL,'If set, the field borrowers.lastseen will be updated everytime a patron is seen','YesNo'),
('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'),
('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'),
('TranslateNotices','0',NULL, 'Allow notices to be translated','YesNo'),
('UNIMARCAuthorityField100','afrey50 ba0',NULL,'Define the contents of UNIMARC authority control field 100 position 08-35','Textarea'),
('UNIMARCAuthorsFacetsSeparator',', ',NULL,'UNIMARC authors facets separator','short'),
('UNIMARCField100Language','fre',NULL,'UNIMARC field 100 default language','short'),

View File

@ -59,3 +59,10 @@ I18N/L10N:
us: US style ([Street number], [Address] - [City], [ZIP/Postal Code], [Country])
de: German style ([Address] [Street number] - [ZIP/Postal Code] [City] - [Country])
fr: French style ([Street number] [Address] - [ZIP/Postal Code] [City] - [Country])
-
- pref: TranslateNotices
choices:
yes: Allow
no: "Don't allow"
- notices to be translated.
- If set, notices will be translatable from the "Notices and Slips" interface. The language used to send a notice to a patron will be the one defined for the patron.