asp.net - Resource file for language dictionary in C# -
i have web application works in several languages. on client side, store words in javascript arrays this:
var somesectionofthepage = ['word1', 'word2', ... ] and when i'm generating html dynamically in client this:
var thehtml = '<div>' + somesectionofthepage[0] + '</div>'; i keep dictionary arrays in different .js files , when need generate page, url javascript file resolved according user's language. works great because don't need touch code modify words in language dictionaries.
i want same thing back-end: want have different resource files loaded depending on user's language.
for now, i'm doing generating html on server:
<div><asp:literal runat="server" id="someid" /></div> and in code-behind, this:
switch (thelanguage) { case 1: someid.text = "hi"; case 2: someid.text = "bonjour"; } as can see, text stored in c# file , works want move text resource file. how store words they're easy restore in c# when generating html? i'm looking ideas on how put functionality together.
thanks.
you may want start here information:
Comments
Post a Comment