Skip to content

Instantly share code, notes, and snippets.

@keitheis
Created November 11, 2012 04:18
Show Gist options
  • Save keitheis/4053649 to your computer and use it in GitHub Desktop.
Save keitheis/4053649 to your computer and use it in GitHub Desktop.
Python Quest #2 of Python Taiwan 2012 November
# 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 天',
# ...
@keitheis
Copy link
Author

Oh, I have got one more exception for this string: 'less than 1 day' XD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment