1

I've setup an ASP.NET MVC Multilingual website. When user registers, they select their preferred language from a drop-down list and then on the website's labels, messages, alerts etc. are shown in their selected language. They can change their preferred language any time. (The registration page is in English - for now)

I've implemented this using the same technique as what is described here. I am doing a multilingual website for first time, so need help.

So I've got all translations in Resources file. For any translation which my client requests, I've to edit the Resources file, compile and deploy the website - for the changes to take effect.

I saw this link, but I cannot use this approach, since the translations should be updated as soon as my client changes them in the Admin panel. I cannot have a console application generating strong type translations as I am running on a shared hosting environment.

What I require:

My client should be able to change the translation text. For now, there are 4 languages that the website provides "English (default), German, Italic, French"

I plan to provide an Admin interface for my client to change the translation text for all languages. See the image for an idea as to how this interface will look like. enter image description here

I plan to save these translations in database (SQL Server). I am basically stuck on the method to retrieve and show these translations.

Here's what I could think of:

  • Write a query to grab a List and store it in "static" variable or "Application[]" or "Session[]" etc. I have no clue how to do it properly, so any help appreciated. The session is not reliable since website is on shared hosting
  • Use caching. When website starts first OR when user logs-in, store the List in cache. When they are updated, update the cache. Again, how to do this properly? I cannot use Redis or any other similar service, since I am on shared hosting and there is no Redis service which I can use

I cannot have separate Views for each language since the languages can be removed or added dynamically by the user.

I am pretty much clueless about how to do this, so any help that I can get would push me in the right direction.

Thank you.

Vaibhav J.
  • 352
  • 2
  • 15

1 Answers1

1

You can do it by using "West Wind Globalization" here is an pretty clean example.

enter image description here

Visit : https://github.com/RickStrahl/Westwind.Globalization

Sohail Ahmad
  • 86
  • 1
  • 1
  • 11