Reputation: 13582
We have a big ASP.NET Web site (Actually a Web Project), all the pages currently are in English, The Company decide to support France and Dutch?
So what is the best option to do this,
The main factors is:
1-performance
2-fast and easy implementations
3-generic solution so we could easy add a new language
I think about this options:
1- Add another page for each current page (so we need add about 800 pages for each language)
2- Translate all texts in code behind: button1.text = GetText("button1");
3- Add a method to translate all texts:
void translate (Control control)
{
foreach(Control cn in control.Controls)
{
TranslateallTextsofControl(cn);
}
}
So really what is the another options?
Some one must be did something like this? what is the best solution really? any suggestion?
Upvotes: 0
Views: 120
Reputation: 19465
Depending on what the state of the project is you need to assess whether a quick hack vs a good globalization/localization solution is what you need.
You should check out these articles:
http://www.codeproject.com/Articles/38907/ASP-NET-Localization-Quick-Reference
http://msdn.microsoft.com/en-us/library/ms247245(v=vs.100).aspx
And then figure which is going to take more work.
Typically what everyone does (in the initial stages of the application itself) is architect the system for globalization. There isn't really any other solution.
I would strongly suggest going the proper globalization route, then eventually adding a new language is just all about creating the right resource files and supplying them into the application.
A non-generic hack, like the the code you've added will bite you eventually and could even be a special hell if you had to support right-to-left languages in the future.
Upvotes: 1