frictionlessdata / frictionless-py

Data management framework for Python that provides functionality to describe, extract, validate, and transform tabular data
https://framework.frictionlessdata.io
MIT License
703 stars 148 forks source link

Error messages i18n #544

Open cbenz opened 3 years ago

cbenz commented 3 years ago

Overview

Context: I co-wrote Validata in 2018, based on goodtables-py. Now our team is updating Validata with new features, and we’d like to upgrade to frictionless-py even if it's not released. In 2019 I was given maintainer status on goodtables-py (but did not make "use" of it).

As the audience target is French the error messages must be i18n. Do you plan to add a i18n system in frictionless-py?

In particular I'd need error template messages of errors.py to be translatable.

We could overload all the error classes in Validata but in our sense the right place for i18n is in frictionless-py. In the current implementation of Validata that's somehow what we did in messages.py, by monkey-patched the original error messages.

I don't want to enlarge your backlog, I can submit a PR with any idiomatic i18n Python library that we'd decide together. We'll also be able to contribute by translating the actual error messages in French.


Please preserve this line to notify @roll (lead of this repository)

roll commented 3 years ago

Hi @cbenz,

Thanks, I think it's an important feature to work on. I'll not have time to do so I think till the end of the year as I'm in very active work on finishing the last internal/stability bits for the release. I think, for now, it's pretty fine to do something like:

from frictionless import errors

errors.TypeError.name = 'new name'
errors.TypeError.template = 'new template'
errors.TypeError.description = 'new description'

After frictionless@4 is released we will work on i18n. Please let me know what is your recommended i18n approach

wardi commented 2 years ago

Hello, I'm interested in helping with this as well. We also need a French translation of the error messages.

@roll @cbenz Has work started on this already? Is there an approach you recommend?

cbenz commented 2 years ago

Hi @wardi , I did not start working on this. I changed to a new job, therefore I won't spend much time on this project.

I do not have a specific approach to recommend.

johanricher commented 2 years ago

Hi @wardi, as @cbenz said in its original message, Validata covers i18n but specifically for French users. In the future, we would like to see frictionless-py cover these needs in a more generic way, but in the meantime you can use Validata if you want French translations of frictionless error messages.

I'd be happy yo answer your questions if you have any.

JVickery-TBS commented 3 months ago

Reviving this a bit, I am upgrading our very old goodtables to latest frictionless. And adding in i18n support via babel and message extractors.

If all goes well, I will make a pull request with the changes.