Hi Alvaro,
Thanks for your commit.
Regarding the way to get the localized pretty_name, I recommend to use lang::util::localize instead of lang::message::lookup. It would be more straightforward requiring less code and dealing with the cases when the pretty_name is a combination of literal text and message keys (can happen!).
Regarding the form to edit assignments types, the pretty name form fields should be enabled for edition (the value need to be localized as you did). Those types are created by default to provide a pre-configured environment but they may not match the end users needs so they need to be editable.
Also, usually a course will be used in one sole language, so if the admin/teacher decide to enter a literal string it's OK. Anyhow, it should be admin/teacher decision, not the developer one. Also it would be a bit excessive to ask for a message key here.