Bug 39355 - New sample notices are added in English during database migration/Koha upgrade, instead of being transalted
Summary: New sample notices are added in English during database migration/Koha upgrad...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-17 10:25 UTC by Michał
Modified: 2025-03-17 13:46 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał 2025-03-17 10:25:49 UTC
Full list of sample notices is specified in this file: https://github.com/Koha-Community/Koha/blob/6cffdc70059d04e39507cc94d58c226eb762c80a/installer/data/mysql/en/mandatory/sample_notices.yml#L2624

It is translatable and used by the installer to fill up the "letters" table with sample notices in our selected languages at the time of Koha installation.

However, if a Koha upgrade is ran, database migrations are ran, such as these two:
- https://github.com/Koha-Community/Koha/blob/6cffdc70059d04e39507cc94d58c226eb762c80a/installer/data/mysql/db_revs/240600038.pl#L6
- https://github.com/Koha-Community/Koha/blob/6cffdc70059d04e39507cc94d58c226eb762c80a/installer/data/mysql/db_revs/230600067.pl#L22

Unfortunately, these migrations add new notices with sample hardcoded English text of the notice, with a discord of its definition in sample_notices.yml (which might also mean the text is different, if someone adjusts the default in one place but not another). In practice all new notices that were added after the installation are in English, instead of the instance language.

Expected behavior: the migrations should add the new notices from sample_notices.yml, in the same language as those set up during the installation.

Caveat: I am not sure what determines/saves that primary language. You can have your default OPAC and staff languages be English, your default Linux system locale also be English, while the notices might be another language. I failed to find where that original language might be saved.

Also to be clear: this is about the situation where TranslateNotices pref is DISABLED.
Comment 1 Katrin Fischer 2025-03-17 13:46:11 UTC
The first language in the list of opaclanguages is used as the default. There is a note in new version about that on the notices page at the top. 
(note, the pref is sortable!)

I am trying to avoid adding notices by updatedatabase for that reason currently and rely more on the new review feature. See discussion about alternate solutions here: bug 38859