I'm making a content type/id hashmap. The relevant part of the code is something like this (js):

contentMap[content.get_name()] = content.get_id().toString();

I'm worried that the name will change with locale.

For example... If I have a content type called, say, "Help Files", and a .resx file in BOfH that goes:

<data name="Help Files" xml:space="preserve">

If I then try to do this in my code:

var contentTypeId = contentMap['Help Files'];

I know it will work in most cases. But will it fail for a user whose locale is set to BOfH?

I found no documentation on this and, unfortunately, the servers I'm allowed to fiddle with have no language packs installed, so I can't test it myself. The production servers, though, may have multiple languages installed. And I know for a fact that the site will be used by people in many different countries.

If the content type name does change with locale, is there some other property that's more appropriate for a key? A colleague of mine suggested using form url's, but then I saw that in the site we're working on, they are not unique for each content type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.