Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » General » Downloads
 

Creating multilingual websites - Part 2

By , 25 Aug 2004
 
LocalizedSamplePart2.zip
LocalizedSample
bin
Localization.dll
LocalizedSample.dll
language
en-CA
fr-CA
Localization
bin
Localization.csproj.user
Localization.resharperoptions
LocalizedSample.csproj.webinfo
LocalizedSample.resharperoptions
LocalizedSamplePart2VB.zip
LocalizedSampleVB
bin
Localization.dll
LocalizedSampleVB.dll
language
en-CA
fr-CA
Localization
bin
Localization.dll
Localization.vbproj.user
LocalizedSampleVB.resharperoptions
LocalizedSampleVB.vbproj.webinfo
Imports System.Configuration
Imports System.Xml

Public Class LocalizationConfiguration

#Region "fields and properties"
   Private _defaultCultureName As String
   Private _languageFilePath As String

   Public Property DefaultCultureName() As String
      Get
         Return _defaultCultureName
      End Get
      Set(ByVal Value As String)
         _defaultCultureName = Value
      End Set
   End Property

   Public Property LanguageFilePath() As String
      Get
         Return _languageFilePath
      End Get
      Set(ByVal Value As String)
         _languageFilePath = Value
      End Set
   End Property
#End Region

   Public Shared Function GetConfig() As LocalizationConfiguration
      Return CType(ConfigurationSettings.GetConfig("Localization/Localization"), LocalizationConfiguration)
   End Function

   Friend Sub LoadConfigValues(ByVal node As XmlNode)
      Dim attributeCollection As XmlAttributeCollection = node.Attributes
      _defaultCultureName = attributeCollection("defaultCulture").Value
      _languageFilePath = attributeCollection("languageFilePath").Value
   End Sub
End Class

Friend Class LocalizationConfigurationHandler
   Implements IConfigurationSectionHandler

   Public Function Create(ByVal parent As Object, ByVal configContext As Object, ByVal node As XmlNode) As Object Implements System.Configuration.IConfigurationSectionHandler.Create
      Dim config As New LocalizationConfiguration
      config.LoadConfigValues(node)
      Return config
   End Function
End Class

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Karl Seguin
Canada Canada
Member
No Biography provided

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130516.1 | Last Updated 26 Aug 2004
Article Copyright 2004 by Karl Seguin
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid