Click here to Skip to main content
15,886,075 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 482.9K   6K   211  
Creating multilingual websites - Part 2
Imports System.Web.UI
Imports System.Text

Public NotInheritable Class LocalizedUtility
   Private Sub New()
   End Sub

   Public Shared Function ReplaceParameters(ByVal controls As ControlCollection, ByVal text As String) As String
      If controls Is Nothing OrElse controls.Count = 0 Then
         Return text
      End If

      Dim sb As New StringBuilder(text)
      For i As Integer = 0 To controls.Count - 1
         If TypeOf controls(i) Is Parameter Then
            Dim parameter As Parameter = CType(controls(i), Parameter)
            Dim key As String = parameter.Key
            Dim value As String = parameter.Value
            sb.Replace("{"c + key.ToUpper() + "}"c, value)
         End If
      Next
      Return sb.ToString()
   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