I did a little Python program :
# -*- coding: utf-8 -*-
""" Program that ask for the birth date and return the day name of the birth """
from datetime import datetime
def ask_birthdate():
""" Raw input of the birth date """
date = raw_input("Enter your birth date (DD-MM-YYYY) : ").strip()
return datetime.strptime(date, '%d-%m-%Y')
def birthday(date):
""" Localized day of birth """
return date.strftime('%A')
if __name__ == "__main__":
date = ask_birthdate()
print u"You was born a %s" % birthday(date)
It is quite simple, but I would like to translate it. First there is the IHM text (Enter your birth date) and (You was born a) then I also wish to translate the name of the day.
In the doc, I saw that it should be localized, but how should I configure the program to be localized ?