From d2e06c13de2fd20e9ff5187cbb4eeab03e68fc3c Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:58:59 -0800 Subject: [PATCH] Fix: resolve language map TODO and map Norwegian --- src/paperless/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/paperless/utils.py b/src/paperless/utils.py index 12a812f13..061d60cc6 100644 --- a/src/paperless/utils.py +++ b/src/paperless/utils.py @@ -11,8 +11,9 @@ logger = logging.getLogger("paperless.utils") # - Python dateparser languages: https://dateparser.readthedocs.io/en/latest/supported_locales.html # - ISO 639-2: https://www.loc.gov/standards/iso639-2/php/code_list.php OCR_TO_DATEPARSER_LANGUAGES = { - # TODO check these Dateparser languages as they are not referenced on the ISO639-2 standard, - # so we didn't find the equivalent in Tesseract: + # These dateparser languages have no equivalent in any Tesseract release + # (checked against tessdata, tessdata_best and tessdata_fast), so they cannot + # be reached from the OCR language. Set PAPERLESS_DATE_PARSER_LANGUAGES to use them: # agq, asa, bez, brx, cgg, ckb, dav, dje, dyo, ebu, guz, jgo, jmc, kde, kea, khq, kln, # ksb, ksf, ksh, lag, lkt, lrc, luy, mer, mfe, mgh, mgo, mua, mzn, naq, nmg, nnh, nus, # rof, rwk, saq, sbp, she, ses, shi, teo, twq, tzm, vun, wae, xog, yav, yue @@ -76,6 +77,7 @@ OCR_TO_DATEPARSER_LANGUAGES = { "msa": "ms", "mlt": "mt", "mya": "my", + "nor": "nb", "nep": "ne", "nld": "nl", "ori": "or",