# Autho: Patrick Palczewski """ The code below is the workaround to display all months in a unicode calendar. The java.utilCalendar method getDisplayNames() works for standard ASCII, but fails for unicode strings. """ from java.util import GregorianCalendar #Init variables gc = GregorianCalendar() locale = [] sublocale = [] months = [] curmonth = gc.get(2) # Save to reset calendar when done #Get the available locales from your sysstem. locale.extend(gc.getAvailableLocales()) # Uncomment the next line if you want to see how many locales are #installed on your system # print len(locale) #Build a list of the language(s) you want for x in range(len(locale)): t = str(locale[x]) #must convert to str to search if t.endswith('VN'): # Country sublocale.append(locale[x]) # Now start building the lsublocale list with the months and print # Manually iterate the list i = iter(sublocale) if sublocale == []: print 'Locale not found' exit else: for x in i: loc = x print '\t',x, ':' months = [] for y in range(12): # start setting month variable gc.set(2,y) #Set month months.append(gc.getDisplayName(2,2,loc)) # Now print the months j = iter(months) for z in j: print z # Reset month gc.set(2, curmonth)