Last post Apr 16, 2008 10:24 AM by Joël Hébert
Apr 14, 2008 08:43 AM|rabbit1986|LINK
I have created a website, which enables the administrators to create their own pages. PageData is then saved in a database, and loaded in a default.aspx - page according to the given ID in the querystring.
While adding a page, the Web.siteMap is also changed.
But now, the site has to have multilanguage-support. What is the best solution for me here? Anyone has any idea?
Here is what I have in mind.
1) For the pageData:
I create a table for each language, which contains the translation of the pages.
2) For the Web.siteMap
I will create a Web.SiteMap for each language.
3) For the static items such as some labels:
I will use the ASP.net localization resource-pages.
==> According to Culture, other tables and siteMaps will be used.
Is this a good plan? I searched the internet, but it's always the ASP.net localization I see, but they do not have this custom CMS.
Thanks in advance.
Apr 14, 2008 08:59 AM|Joël Hébert|LINK
for #2 you can have 1 sitemap for both languages
<siteMapNode title_eng="Home" title_fra="Accueil" url="~/index.aspx" description_eng="Home" description_fra="Accueil">
I have used this countless times..... easyer since you update 1 file and not 2 when you add pages.
Apr 15, 2008 10:29 AM|rabbit1986|LINK
And how do I specify when to use what language? Or does ASP.net localization do this?
Thanks already, this helps me alot!
Apr 16, 2008 10:24 AM|Joël Hébert|LINK
you do it in the templates of the navigation controls.....use an inline if, if french use (xxxxFRA) if eng use (xxxxENG) and you then have an english or french caption
#IIf((Request.QueryString("lang") = "fra"), Eval("[title_fra]"), Eval("[title_eng]"))%></asp:HyperLink> </NodeTemplate>
if you have custom fields they are accessible in [ ] it is documented by asp.net