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
Created attachment 171807 [details] [review] Bug 37969: Add missing language code nor
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?
(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.
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".
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"
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>
Works as advertised => Passed QA!
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)
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.
Pushed for 24.11! Well done everyone, thank you!
Enhancement, no 24.05.x backport