Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use dconv for some months #132

Open
aborruso opened this issue Oct 14, 2021 · 5 comments
Open

Not able to use dconv for some months #132

aborruso opened this issue Oct 14, 2021 · 5 comments

Comments

@aborruso
Copy link
Contributor

Hi,
if I run echo "aprile" | dconv --from-locale it_IT -i "%B" | dateconv -f "%m" I have 04.

If I choose "luglio" - july in Italian - and run echo "luglio" | dconv --from-locale it_IT -i "%B", I have

dconv: cannot make sense of `luglio' using the given input formats

What's wrogn in my command?

I'm using dateconv 0.4.7.git21.0a82108.

Thank you

@hroptatyr
Copy link
Owner

Hi Andrea,

thanks for the report. You can have a long explanation or a short work around:

$ echo "luglio 1" | dconv --from-locale it_IT -i "%B %d"
2021-07-01

The problem is an optimisation for the sed-mode (-S) that does not like text-only specifiers in conjunction with custom locales.

@aborruso
Copy link
Contributor Author

Thank you very much.

But why does it work for "aprile"?

@hroptatyr hroptatyr reopened this Oct 15, 2021
@hroptatyr
Copy link
Owner

The details are a bit complex but dconv looks for (a static set of) letters/characters that demark month names. This set is optimised for the English month names. If, however, numeric specifieres are in the format string it prefers those.

@aborruso
Copy link
Contributor Author

I have closed the issue, because your solution works for my goal.

please choose whether to leave it open

@hroptatyr
Copy link
Owner

I know, thank you. I might try and fix it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants