1

This is more of an advise / best practice question that I'm hoping someone has come across before and can give me a steer.

I need to build a web application (the client would like webforms because that's what their developers know for when i hand it over)

Essentially when the client logs in, they will pick a language then I need to replace the text for menus, input boxes etc. The client wants to add their translations and update them at any time.

Ideas I have looked at are:

  • Holding the translations in resource files, building an editor in to the web application and then adding attributes on the fly to my viewmodels.

  • Holding the translations in sql server so i have the name, language and translation as a lookup e.g. Home | French | Maison. Then on pre-render I'll scrape the screen for any controls needing translation in the menu, labels, text areas.

Does anyone know of any good examples or had the experience of doing this themselves.

Nanne
  • 64,065
  • 16
  • 119
  • 163
Lost-Hedgehog
  • 29
  • 1
  • 5

1 Answers1

1

I've a similar situation, and chose to store data in SQL.

Translation mistakes happen often, and you don't want to recompile or disassemble every time.

It is possible to avoid the need to republish, but I've found it just more intuitive and straightforward to maintain SQL.

Bottom line, it depends on the amount of data you have. If it's more than just a couple of keywords, it sounds like a job for SQL to me.


Edit:

In a similar question, users recommend using resources, claiming it is the standard method.

However, if your users are going to make changes to values on regular basis (not because of mistake correction, but because data actually changes), then SQL seems best fit for the job.

Community
  • 1
  • 1
Yehuda Shapira
  • 8,460
  • 5
  • 44
  • 66
  • Thanks Jacob - SQL sounds like the best plan. How did you render the text at the front end per language? did you scrape the page and "replace" or did you create custom controls for MultiLinguagualLabel and look up the value from the database (or cached) based on the chosen language being stored in a session variable? – Lost-Hedgehog Feb 26 '14 at 11:37
  • Since you're using webforms, I'd have a member which contains the values, then bind the data like so: `<%# ( MyValues.WelcomeText ) %>` or `<%# ( MyValues["WelcomeText"] ) %>` – Yehuda Shapira Feb 26 '14 at 11:43