Sunday, April 20, 2014

Localizing MVC web site with Microsoft Excel file using EPPlus

This blog entry contains the idea behind the project. The project and documentation can be found here:

The Xource Project (https://xource.codeplex.com)

   For a long time I was looking for a good and stable way to manage content on web sites I developed. Personally I don't like using CMS's of any type. I am more from scratch approach developer - not that I believe that CMS's are bad - I just believe that they serve very specific types of needs. Also, I am not talking about texts that represents actual content - such as articles, blog posts etc. This is more about "neglected" type of content such as links text, login text - content like that. Working for many years for media companies where the urge to change this kind of content is measured in minutes, there were never a good way.

Using resources (resx files): That is an option. A good one. But when someone wants to overview those texts, you need to extract them some how, or find a tool to do that for you. If those resources are compiled you will need to recompile the site.

Using database: Also a good option. But then again, you need to develop interface where content department can manipulate those texts.

Since in my cases all the texts transactions between content department and developers department was made by Microsoft Excel files - I thought: why not to use those files? Very friendly for ANYONE who have the very basic knowledge of computers. The only thing that was missing is way to interact with Excel from code. So after short search I found this great add-on - EPPlus (https://epplus.codeplex.com). This add-on allows to manipulate Excel worksheet without installing Excel on production environment, simply referencing it in your project, which today can be easily done thanks to NuGet project.

This is the example of localized Excel worksheet:


So, feel free to visit project page and find it useful.