Closed lehnerpat closed 5 months ago
Thank you for well structured bug report!
The issue happens because currently the language codes are hardcoded:
The fix would be to, well, just extend current set of hardcoded values with another batch of languages (incl. Japanese).
PR#300 to include extra language codes (incl. Japanese)
Pull request was merged and it will available as part of Papermerge 3.0.1 release.
Description After installing an additional OCR language (for example, Japanese) as described in the docs, the additional language can be used in OCR by setting it as the default, but it cannot be used from the web UI because the backend rejects it as an invalid value.
Expected Additionally installed languages should be usable from web UI, just like the default languages.
Actual The additional language shows up in the language selection dropdown for running OCR:![CleanShot 2023-12-31 at 17 12 25@2x](https://github.com/ciur/papermerge/assets/1099818/85fb3675-8313-4afc-a24a-62b5b52061d7)
But when you click "Start", the backend responds with a 422 error saying the additional language is not an allowed value for the enum.
Additionally, the UI completely ignores this error and doesn't show any error message :(
Full error payload:
Browser console screenshot:![CleanShot 2023-12-31 at 17 12 41@2x](https://github.com/ciur/papermerge/assets/1099818/aa846a18-aa31-4bc2-8449-f72a609b7c82)
Info:
More info about setup:
Using custom docker image with Japanese language package for tesseract installed, following instructions: https://docs.papermerge.io/3.0/setup/add-ocr-langs/
Dockerfile:
Built with:
docker build -t mypaper:3.0 -f Dockerfile .
Using Docker Compose, following instructions: https://docs.papermerge.io/3.0/setup/docker-compose/
mypaper:3.0
)PAPERMERGE__OCR__DEFAULT_LANGUAGE: jpn