Hello,
A client of mine wants a website supporting 2 languages. (English and Dutch)
Currently I've worked out all the static content with labels pointing to LocalResources and GlobalResources.
It works great. If I change my language in my browser, the content dynamically changes to the prefered language.
Now all that I need to do is make a dropdown so that the user can override their browser preference. I also want to store this preference into a cookie and the profile.
But I do however have a problem with the content being read out of the database.
All my tables have dual language support.
example: the Table NEWS contains the rows: new_id, date, title_nl, title_en, content_nl, content_en
Is there a way so let the page generate the specific row when loading the page with a specific culture.
In other words:
when the page is loaded in dutch the select statement should be:
when the page is loaded in english the select statement should be:Code:select news_id, date, title_nl, content_nl ......
Code:select news_id, date, title_en, content_en ....
I tried to use local en global localization like this:
in the localization file a field LanguagePrefix with either "_nl" or "_en"
-GlobalLocalization:
Code:SelectCommand="Select date, title" + "<%$ Resources:Resource, LanguagePrefix %>" + " ... (and so on...)
-LocalLocalization:
Code:SelectCommand="Select date, title"+meta:resourceKey="LanguagePrefix"+"... (and so on...)
this however doesn't work. Any ideas on how to get this done ?
an alternative option would be to simple make 2 folders: /EN and /NL
and have a seperate page for either /EN and /NL but frankly I don't like this solution because I don't see the use of localization features in this context. (ie. duplicate pages, and so on...)
tips are very welcome
thanks



Reply With Quote
Bookmarks