playframework/Play20 — pull request #338 by rssh (2012-05-28 06:09:08+00:00)
Title:  added optional creation of Lang obect is one if correct.

It would be good to have in API ability to create language from string only if string can represent correct language. This is needed when you want to have explicit localization be available (for example when language is set as part or url). So, I added `optional` method to Lang object, with typical usage:

Lang.optional(slang).getOrElse(Lang.prefferedLanguage)