pimutils / pimutils/khal

Calendar misalignment with CJK locales

Open
#751 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat:ui pri:Low type: bug
Dominant language
Python
Stars
3.1k
Forks
233
Avg merge
1h 44m
Merged PRs (30d)
1

Description

Khal doesn't display the calendar correctly when using LC_TIME values that require CJK fonts.
I've tested this with Chinese, Japanese and Korean locales (see below). These locales use full-width characters for weekdays and months, and full-width characters have a width of 2.

I think the underlying issue is in the Python standard library (bugs related to the calendar.LocaleTextCalendar class and about finding character width) but I found this when I was trying out khal so thought I'd raise it here.

$ LC_TIME=zh_CN.UTF-8 python -m khal
    一  二  三  四  五  六  日      No events
1月   1  2  3  4  5  6  7
 ...

$ LC_TIME=ko_KR.UTF-8 python -m khal
    월  화  수  목  금  토  일      No events
 1월  1  2  3  4  5  6  7 
 ...

$ LC_TIME=ja_JP.UTF-8 python -m khal
    月  火  水  木  金  土  日      No events
 1月  1  2  3  4  5  6  7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the python -m khal entry point and the zh_CN, ko_KR, and ja_JP LC_TIME examples. Trace the calendar rendering and width handling, including the referenced Python calendar.LocaleTextCalendar behavior and character-width issue. Done means weekday and month labels align correctly for these CJK locales.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
40/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.