What is the best practice to get dictionary item in a controller action now? I am thinking either localizationService or ContextAccessor, which is "heavier" to use?
I still need to get the current language somehow right?
d
D_Inventor
02/04/2025, 5:24 PM
Hey, as far as I know, you should always get dictionary items through
UmbracoHelper
.
In a
RenderController
, I think you automatically have access to an umbraco helper, but you could also inject
IUmbracoHelperAccessor
if you can't find it.
D_Inventor
02/04/2025, 5:27 PM
At least the Umbraco Helper automatically takes the current language from your request context, so you don't have to worry about that
s
Sebastiaan
02/05/2025, 11:50 AM
this would have been a great question for #1125392773038755890 by the way 😇
s
skttl
02/07/2025, 12:42 PM
inject ICultureDictionaryFactory and use that to create your CultureDictionary