SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

according to the documentation I can do:


However I seem to be unable to do:

var contentType = new ContentType(parent, web.ContentTypes, "$Resources:LocalizeContentType,ContentTypeTitle"); 

The error being that a name of a contentType can not contain characters like "$" and so on...

How can I create a ContentType (in code) whose name is localized?

share|improve this question
up vote 0 down vote accepted

You should use SPUtility to retrieve content type name and use this name like this:

string str = "$Resources:key";
string locStr = SPUtility.GetLocalizedString(str, "resource_file", (uint)culture.LCID);
var contentType = new ContentType(parent, web.ContentTypes, locStr);
share|improve this answer
Thanks, that's what I'm doing now. Having read the declarive way I was somehow stuck in trying the same in code. ;-) – Nils Oct 12 '12 at 16:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.