HomeHomeUsing DotNetNuk...Using DotNetNuk...Language and In...Language and In...Localize just a contact page with resx filesLocalize just a contact page with resx files
Previous
 
Next
New Post
7/20/2010 12:40 PM
 
DotNetNuke does not support ASP.Net localization, this is turned off in web.config, because it conflicts with DNN localization. I remember however a project by Brandon Haynes on Codeplex, how to enable ASP.Net localization in DNN. IMHO the easiest way might be either using a different application folder for your solution or just converting your pages into a DNN module.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group   European Network of DotNetNuke Professionals

 
New Post
7/20/2010 12:52 PM
 
Thanks Sebastian,

May be I do need to convert this one page into its own module.

I do not want to take the risk of messing up the default localization but I will first check out the codeplex and try my luck.

Thanks,
Wasay

http://blog.wasay.net
 
New Post
7/20/2010 1:37 PM
 
Solution:

Got the hint from post of David Pugmire at 
http://www.dotnetnuke.com/tabid/795/forumid/78/postid/16911/scope/posts/default.aspx

To resolve the url... I have used the resolve url before but may be it was just the think that was not working for me today lolz

The localization files are in "/App_LocalResources/" with extension "ContactForm.ascx.resx" and "ContactForm.ascx.es-ES.resx"

Actual page is in "/Portals/0/Pages/ContactForm.aspx"

***************************************
	Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
		
		Dim lang As System.Globalization.CultureInfo
		Dim langSetDefault As Boolean
				
		langSetDefault = False		

		'Add query string logic
		Dim qsLang As String
		qsLang = Request.QueryString("lang")
		If (Len(qsLang) > 0) Then
			If (qsLang = "spanish") Then
				lang = New System.Globalization.CultureInfo("es-ES")
			ElseIf (qsLang = "german") Then
				lang = New System.Globalization.CultureInfo("de-DE")
			ElseIf (qsLang = "dutch") Then
				lang = New System.Globalization.CultureInfo("nl-BE")
			Else
				langSetDefault = True
			End If				
		Else
			langSetDefault = True
		End If
		
		If (langSetDefault = True) Then
			lang = New System.Globalization.CultureInfo("en-US")
		End If
		
		System.Threading.Thread.CurrentThread.CurrentCulture = lang
		System.Threading.Thread.CurrentThread.CurrentUICulture = lang

	End Sub
    Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

		lblAboutYourself.Text = Localization.GetString("lblAboutYourself.Text", ResolveUrl("~/App_LocalResources/ContactForm"))
		lblFirstName.Text = Localization.GetString("lblFirstName.Text", ResolveUrl("~/App_LocalResources/ContactForm"))
		
    End Sub 'Page_Load
With link href "?lang=english" "?lang=spanish"....
***************************************

I am still working on this and may need to rename file names for other reasons...

Thanks Sebastian for your suggestions as well :)
It has been a great day even though the first half was frustrating :D

Thanks,
Wasay

http://blog.wasay.net
 
Previous
 
Next
HomeHomeUsing DotNetNuk...Using DotNetNuk...Language and In...Language and In...Localize just a contact page with resx filesLocalize just a contact page with resx files


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Attend A Webinar
Free Demo Site
Download DotNetNuke Professional Edition Trial
Have Someone Contact Me
Have Someone Contact Me

Like Us on Facebook Join our Network on LinkedIn Follow DNN Corporate on Twitter Follow DNN on Twitter

Advertisers

DotNetNuke Scoop!

Sponsors

DotNetNuke Corporation

DotNetNuke Corp. is the steward of the DotNetNuke open source project, the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft. Organizations use DotNetNuke to quickly develop and deploy interactive and dynamic web sites, intranets, extranets and web applications. The DotNetNuke platform is available in a free Community and subscription-based Professional and Enterprise Editions with an Elite Support option. DotNetNuke Corp. also operates the DotNetNuke Store where users purchase third party apps for the platform.