Follow BCP 47 for language codes: canonical tags in tests and documents, gettext names only for the locale directories #5
Labels
No labels
bug
documentation
enhancement
performance
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-paperless#5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The requirement: all language codes must follow BCP 47. A BCP 47 tag (RFC 5646) is made of subtags from the IANA registry joined by hyphens, and §2.1.1 gives the form to write one in: the language in lower case, a script in title case, a region in upper case (
pt-BR,en-GB,sr-Cyrl). The rule for the whole project is postulo/postulo#337; this is what it means for this plugin.What exists today
src/postulo_paperless/locale/under gettext locale names (fr_FR,pt_BR,pt_PT), and each PO file'sLanguage:header says the same. They are not language tags; the core'spostulo-messagesderives them from a tag with Django'sto_locale.tests/test_catalogues.pynames the working languages as("fr-fr", "pt-pt")and the European Union's with"fr-fr"and"pt-pt"among them, andtests/test_paperless.pyswitches language withtranslation.override("fr-fr"),("pt-pt")and("en-gb")(lines 393-397). These are the core's own spellings, handed to the core's tool, so they cannot change here before they change there.DocumentMetadata.language, a free string today.src/postulo_paperless/store.pynever reads it, and nothing about a document's language is sent to Paperless.What the plugin should do
pyproject.tomlpins commit1d6cdd7e0), and write the codes in the tests as the core then does (fr-FR,pt-PT,en-GB).locale/directory names being gettext's and made by the tool.Done when
locale/directory names and the PO headers.uv run pytestpasses against the core that carries postulo/postulo#337, anduv run pytest -m releasestill holds the European Union catalogues complete.Requested on 2026-10-01: all language codes must follow BCP 47.