Bug 37969 - Add missing language code nor (Norwegian/inclusive)
Summary: Add missing language code nor (Norwegian/inclusive)
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lari Taskula
QA Contact: Thomas Klausner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-19 20:56 UTC by Lari Taskula
Modified: 2024-11-18 23:05 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds the language code nor for the Norwegian inclusive language ISO 639-2 to Koha.
Version(s) released in:
24.11.00
Circulation function:


Attachments
Bug 37969: Add missing language code nor (5.66 KB, patch)
2024-09-19 21:10 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 37969: Add missing language code nor (6.28 KB, patch)
2024-09-23 08:10 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 37969: Add missing language code nor (6.32 KB, patch)
2024-10-19 13:40 UTC, Thomas Klausner
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lari Taskula 2024-09-19 20:56:42 UTC
Norway has two official forms of written language, nynorsk (nno) and bokmål (nob). However an inclusive ISO 639-2 language code also exists (nor) and is missing from Koha.

https://www.loc.gov/standards/iso639-2/php/code_list.php
Comment 1 Lari Taskula 2024-09-19 21:10:30 UTC Comment hidden (obsolete)
Comment 2 Magnus Enger 2024-09-20 06:21:15 UTC
Thanks for thinking about us! :-) 

This seems to be adding more than just "nor". Is that a mistake or is the name of the bug a little misleading? Or am I missing something?
Comment 3 Lari Taskula 2024-09-20 08:41:58 UTC
(In reply to Magnus Enger from comment #2)
> Thanks for thinking about us! :-) 
We love our Norwegian neighbours.

> This seems to be adding more than just "nor". Is that a mistake or is the
> name of the bug a little misleading? Or am I missing something?
Our issue is that facets display just "nor" instead of a human-readable language name.

The way I came up with this patch was that I copy-pasted one of the other official written forms in subtag_registry.sql and adjusted the ISO 639-1/2 codes accordingly.

Not sure if something is unnecessary in this patch but if there is I am happy to fix.
Comment 4 Magnus Enger 2024-09-23 06:28:46 UTC
Ah, I get it now, I think. I was wondering why you were adding things like this: 

$dbh->do(q{ INSERT INTO language_descriptions(subtag, type, lang, description) VALUES ( 'no', 'language', 'pl', 'Norweski'); });

But I guess "no" is a two letter version of "nor".
Comment 5 Magnus Enger 2024-09-23 08:10:18 UTC
Created attachment 171870 [details] [review]
Bug 37969: Add missing language code nor

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Test plan:
- Start KTD with Elastic: ktd --es7 up
- Edit a record, e.g. "Dom Casmurro : a novel" and change the language
  code in 008/35-37 from "eng" to "nor":
  Before: 980914s1997    nyu           00011 eng b
  After:  980914s1997    nyu           00011 nor b
- Do a search that finds the edited record and some other records,
  so you can see the list of resulots and the facets, e.g. "dom"
- Verify that "nor" is shown in the languages facet
- Apply this patch and run koha-upgrade-schema kohadev
- Do the search again and verify that "Norwegian" is now shown instead
  of "nor"
Comment 6 Thomas Klausner 2024-10-19 13:40:37 UTC
Created attachment 173006 [details] [review]
Bug 37969: Add missing language code nor

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Test plan:
- Start KTD with Elastic: ktd --es7 up
- Edit a record, e.g. "Dom Casmurro : a novel" and change the language
  code in 008/35-37 from "eng" to "nor":
  Before: 980914s1997    nyu           00011 eng b
  After:  980914s1997    nyu           00011 nor b
- Do a search that finds the edited record and some other records,
  so you can see the list of resulots and the facets, e.g. "dom"
- Verify that "nor" is shown in the languages facet
- Apply this patch and run koha-upgrade-schema kohadev
- Do the search again and verify that "Norwegian" is now shown instead
  of "nor"

Signed-off-by: Thomas Klausner <domm@plix.at>
Comment 7 Thomas Klausner 2024-10-19 13:41:41 UTC
Works as advertised => Passed QA!
Comment 8 Katrin Fischer 2024-10-24 13:14:13 UTC
Fixed when moving to dbrev:

 WARN	installer/data/mysql/atomicupdate/bug_37969_add_missing_language_code_nor.pl
   WARN	  tidiness
		The file is less tidy than before (bad/messy lines before: 0, now: 11)
Comment 9 Katrin Fischer 2024-10-24 13:17:42 UTC
Switched database update to use say_success and made it sure it could be run multiple times by using INSERT IGNORE. Also tested running it twice.
Comment 10 Katrin Fischer 2024-10-24 14:57:05 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 11 Lucas Gass (lukeg) 2024-11-18 23:05:37 UTC
Enhancement, no 24.05.x backport