From 017ee9fa9225117fd4c5b1bb0cd0f47726babd0d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 8 Dec 2016 11:27:11 +0100 Subject: [PATCH] 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 --- installer/data/mysql/atomicupdate/bug_xxxxx.perl | 3 +++ installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl index b2e32ae..22583e9 100644 --- a/installer/data/mysql/atomicupdate/bug_xxxxx.perl +++ b/installer/data/mysql/atomicupdate/bug_xxxxx.perl @@ -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"; } diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index ef83c3d..844c415 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -523,6 +523,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'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref index 6f7e60a..e6e5024 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref @@ -58,3 +58,10 @@ I18N/L10N: choices: us: US style ([Street number], [Address] - [City], [ZIP/Postal Code], [Country]) de: German style ([Address] [Street number] - [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. -- 2.9.3