Search code examples
pythontkintertkcalendar

How to set language of months to Polish for a tkcalendar DateEntry?


Like in the title, how to set language of months to Polish in tkcalendar's DateEntry?

DateEntry(lbf,width=12,bg="darkblue",fg="white",year=1990,state="readonly",
          date_pattern="yyyy-mm-dd",textvariable=two)

Solution

  • tkcalendar uses babel module to translate the week days and months. The language is set via the "locale" option. I am not sure about the language code for Polish but it should be something like:

    DateEntry(lbf,width=12,bg="darkblue",fg="white",year=1990,
              locale="pl", state="readonly", date_pattern="yyyy-mm-dd",textvariable=two)