Taxonomy Localization
I have a project that I'm using some of the examples posted in these forums and the developer's guide to get taxonomy terms using the API. It's a bilingual site (English and French) but I'm seemingly only able to get the English versions of the terms.
I'm using the following:
TaxonomyManager tManager = TaxonomyManager.GetManager();
ITaxonomy categoriesTaxonomy = tManager.GetTaxonomy(TaxonomyManager.CategoriesTaxonomyId);
Hi Kevin,
You can set the CurrentUICulture of the current thread to the culture you would like to get the Taxonomy for, then get the taxonomy, then switch the culture back to its original value:
var savedCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
System.Threading.Thread.CurrentThread.CurrentUICulture =
new
System.Globalization.CultureInfo(
"fi"
);
TaxonomyManager tManager = TaxonomyManager.GetManager();
var tagsTaxonomy = tManager.GetTaxonomy(TaxonomyManager.TagsTaxonomyId);
var firstTaxon = tagsTaxonomy.Taxa.First();
System.Threading.Thread.CurrentThread.CurrentUICulture = savedCulture;
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>