nu7hatch/gmail — pull request #83 by ryanlchan (2013-01-31 06:35:36+00:00)
Title: Add support for localizing labels

Remembering localizations for each mailbox name is a pain; Gmail has very little consistency on how they name their folders as well. Some are prefixes by [Gmail], others by [Google Mail]; Some trash folders are called "Trash", others "Bin", yet others are localized into other languages.

This commit leverages Gmail's support of the XLIST command to use standardized, non-localized names for specific folders to find the correct labels. The supported list is:
* :Inbox
* :Allmail
* :Drafts
* :Sent
* :Trash
* :Important
* :Spam

However, even these are not all present on every account. If a name is passed that *should* be recognized, but isn't, the localizer will return nil. If a non-recognized name is passed, it is returned as-is.