Bug 30290: (follow-up) Add warning for translated notices

Note: Problem is that we cannot know if default was translated
or en contains the original notice. Actually this holds for
the other languages too. So this is an educated guess without
using the lang field.

Test plan:
Run db rev.
Trigger the warning by replacing Pages by PPages in an AR notice.
Run db rev again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Marcel de Rooy 2022-03-14 13:01:22 +00:00 committed by Fridolin Somers
parent 5d96207f2d
commit 9f37d3bc2d
1 changed files with 9 additions and 0 deletions

View File

@ -12,5 +12,14 @@ SET content=REPLACE(content, '\nPages:', '\nTOC: [% IF article_request.toc_reque
WHERE code RLIKE '^AR_' AND module='circulation' AND content NOT RLIKE '\nTOC:';
|;
$dbh->do( $sql );
# Warn if we find translated notices (educated guess with word Pages)
$sql=q|
SELECT COUNT(*)
FROM letter
WHERE code RLIKE '^AR_' AND module='circulation' AND content NOT RLIKE '\nPages:';
|;
my ( $count ) = $dbh->selectrow_array( $sql );
say $out "WARNING: If you have translated AR notices, please add TOC lines yourself." if $count;
},
};