Click here to Skip to main content
15,888,600 members
Articles / Web Development / ASP.NET

Creating Multilingual Websites - Part 2

Rate me:
Please Sign up or sign in to vote.
4.83/5 (64 votes)
25 Aug 2004CPOL14 min read 484.2K   6K   211  
Creating multilingual websites - Part 2
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 Service 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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions