doing icon indicating copy to clipboard operation
doing copied to clipboard

Os locale are not used when listing dates

Open krzysiek-b opened this issue 3 years ago • 3 comments

Describe the bug

My locale are set to Polish and ubuntu seems to act right. Doing is still using EN.

What I get when calling eg. ls /tmp -l is image

Doing still uses EN image

To Reproduce

Enable other locales on Ubuntu. Use any doing listing command like doing show

Expected behavior

Doing should display dates using os selected locales.

krzysiek-b avatar May 09 '22 09:05 krzysiek-b

I'm not sure how to fix this. Date formatting just uses the date_format config string and Ruby's strftime. If it's not respecting locale, that seems like it would be a Ruby issue. If you find any documentation that shows a way to get strftime to respect locale in your case, please let me know.

On 9 May 2022, at 4:05, krzysiek-b wrote:

Describe the bug

My locale are set to Polish and ubuntu seems to act right. Doing is still using EN.

What I get when calling eg. ls /tmp -l is image

Doing still uses EN image

To Reproduce

Enable other locales on Ubuntu. Use any doing listing command like doing show

Expected behavior

Doing should display dates using os selected locales.

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/doing/issues/144 You are receiving this because you were assigned.

Message ID: @.***>

ttscoff avatar May 09 '22 14:05 ttscoff

I'm not a Ruby expert but here's something which looks promising https://stackoverflow.com/questions/18593661/how-do-i-strftime-a-date-object-in-a-different-locale

Still I assume this should inherit the locale from the system and use pl_PL in my case as the default. Can we add DEBUG logs to sww which one is used?

krzysiek-b avatar May 09 '22 14:05 krzysiek-b

That answer is for Python, but I can see if something similar affects Ruby's strftime output.

-Brett

On 9 May 2022, at 9:42, krzysiek-b wrote:

I'm not a Ruby expert but here's something which looks promising

https://stackoverflow.com/questions/18593661/how-do-i-strftime-a-date-object-in-a-different-locale

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/doing/issues/144#issuecomment-1121195796 You are receiving this because you were assigned.

Message ID: @.***>

ttscoff avatar May 09 '22 14:05 ttscoff

Sorry to let this sit for TWO YEARS, but upon re-reading it I realize that the issue is that the date formats are hardcoded. You can modify any of them using templates. See https://github.com/ttscoff/doing/wiki/Templates#date-formatting

ttscoff avatar Mar 26 '24 15:03 ttscoff

No problem, I understand both so this is not a big issue. Take your time :)

krzysiek-b avatar Mar 26 '24 15:03 krzysiek-b