Database MVC/Razor localization
Hi,
Is there a built-in feature for localization using razor with the translation text stored in a database?
Thanks,
Jaan
Hi Jaan,
I presume you are talking about the content that is inserted in Sitefinity - there is no built-in tool for automatic content localization. Each content type has API to interface with its content. Depending on your needs content can be obtained and saved in some format, then provided for translation. When the translation is ready, the API can be used for creating a localized version of that content item and the translated content can be inserted there.
This is a 10 000 feet overview of how the process could look like. What would your use case be? That would be useful feedback as we are also researching different approaches for content exportation and automated translation.
Looking forward to your reply!
Regards,
Grisha 'Greg' Karanikolov
Telerik
Hi,
Thanks for the reply.
We are looking at how we could localize the strings we would put in a widget, say a table of data with with predefined columns for example. Our team would really like to be able to build widgets frontend using razor/MVC while being able to provide a backend to end users to manage the labels.
Hi Jaan,
I see, that makes it clearer now :-) You might want to check this forum thread. You can use localized strings for label texts in various places throughout Sitefinity, including MVC widgets. Strings originally look like this:
<
asp:Label
runat
=
"server"
ID
=
"lbl1"
Text='<%$ Resources:NewsResources, Content %>'></
asp:Label
>
There are various ways to call them inside an MVC view. Here are some useful articles that could get you there:ASP.NET MVC - Localization Helpers
Resource Files and ASP.NET MVC Projects