Skowronek

Posts Tagged ‘l10n’

Ektron and Localization Tags

AddThis Social Bookmark Button

I ran across an interesting API library deep in the Ektron API framework that allows you to pull the actual localization tag (e.g. en-US, en-GB, etc.) for the current language type id of the site (e.g. 1033, 2058, etc.). Previous to this, we had to create our own associative, key/value pair XML file that stored the relationships. Since I could only find a single reference to this library on the Ektron site, I hoping this information proves useful to others. Enjoy.

// get and instance of the current site API object
Ektron.Cms.SiteAPI sAPI = new Ektron.Cms.SiteAPI();
// retrieve the language date for the current site API instance
Ektron.Cms.LanguageData ld = sAPI.GetLanguageById(ContentBlock.LanguageID);
// assign the localization tag
string langTag = Ld.XmlLang;