Created
November 11, 2012 04:18
-
-
Save keitheis/4053649 to your computer and use it in GitHub Desktop.
Python Quest #2 of Python Taiwan 2012 November
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf8 | |
# Kanban of Python Taiwan in Early November | |
# Python Quest #2 | |
dates = ['1 year, 10 months, 15 days', | |
'2 years, 1 month, 15 days', | |
'1 month, 15 days', | |
'1 yesr', | |
'2 months', | |
'15 days', | |
'1 days', | |
'2 year, 1 month, 1 day'] | |
print dates | |
def _(string): | |
# Return translated string. | |
# e.g. _("days") returns "天" here. | |
# and don't worry, you can say that _("day") also returns "天". | |
return string # we pretend it's translated | |
# Q: how to translate all English unit to Chinese? | |
# For example: | |
# ['1 年, 10 個月, 15 天', | |
# '2 年, 1 個月, 15 天', | |
# '1 個月, 15 天', | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, I have got one more exception for this string: 'less than 1 day' XD