Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Get current language from BlockData in PublishingContent

Vote:
 

I'm doing some operations on PublishingContent event and need the language of the current Content of the event.

`if (e.Content is StandardPage standardPage)` This gives me access to standardPage.Language (CultureInfo)

`if (e.Content is TextBlock textBlock)` This however does not. Both inherits from IContent in the end.

How can I get CultureInfo from textBlock?

#285735
Edited, Aug 18, 2022 10:10
Vote:
 

Casting block to ILocalizable makes Language propery available.

#285737
Aug 18, 2022 10:41
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.