Validation error messages aren't translated
Closed this issue · 3 comments
This refers to things like validation_error_template_lookup and validation_error_template_lookup_safe in https://github.com/OpenDataServices/lib-cove/blob/master/libcove/lib/common.py#L32
There may be other places, too.
The ideal fix here is that human readable strings like this should never be made in the libraries.
Instead, the libraries should pass out data structures that automatic processes can parse, and if needed, turn into a human readable interface.
That means that:
- Strings can vary for different interfaces; what we want in CoVE web's UI might not be what we want in a CLI tool, for instance.
- I18N Translations happen completely at the UI stages and not in the libraries, so translation needs and practices for different UI's can differ.
- The libraries should NOT have a dependency on Django at all, so that when they are used in other context (like Kingfisher) Django is not pulled in.
Seems to be translated by lib-cove-web.
Test data:
{"version":"1.1","releases":[{"tender":{"title":1,"value":{"amount":"1"}}}]}
Done in this commit:
OpenDataServices/lib-cove-web@35e4cd5
Relevant code:
FWIW lib-cove-ocds no longer needs Django in non-CoVE contexts since 0.12.0.
The ideas around refactoring belong as a lib-cove issue.