Problem with language. Thank You.

Discussion in 'ASP .Net' started by Miguel Dias Moura, Apr 16, 2004.

  1. Hello,

    i have a Calendar Control in my web site and when it's in my computer the
    months and weekdays are in portuguese.
    When i change it to my server the months and weekdays change to english.

    Do you think i can solve this by changing culture in my web.config file?

    If yes, can you tell me what should be the code to include in the web.config
    file to force my culture to portuguese?

    If no, can you tell me what should be the solution?

    Thank You,
    Miguel
     
    Miguel Dias Moura, Apr 16, 2004
    #1
    1. Advertising

  2. Hello Miguel,

    One solution would be to put your culture information in the web.config like
    this:

    <configuration>
    <appSettings>
    <add key="CI" value="pt-PT" />
    </appSettings>

    <system.web>
    .....

    Then, you could retrieve the value in a variable and use the CultureInfo
    class to set the language of the calendar:


    Public strCI As String
    Private Sub Page_Load _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles MyBase.Load
    strCI = ConfigurationSettings.AppSettings("CI")
    If Not IsPostBack Then
    Dim dtNow As Date = DateTime.Now
    Dim strName As String = Session("strLanguage")
    Thread.CurrentThread.CurrentUICulture = _
    New CultureInfo(strCI, False)
    Thread.CurrentThread.CurrentCulture = _
    New CultureInfo(strCI)
    Calendar1.SelectedDate = dtNow
    Calendar1.VisibleDate = dtNow
    End If
    End Sub


    Private Sub Calendar1_SelectionChanged _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles Calendar1.SelectionChanged
    Thread.CurrentThread.CurrentUICulture = _
    New CultureInfo(strCI, False)
    Thread.CurrentThread.CurrentCulture = _
    New CultureInfo(strCI)
    End Sub


    Does this help?

    Ken
    Microsoft MVP [ASP.NET]
    Toronto

    "Miguel Dias Moura" <> wrote in message
    news:u$...
    > Hello,
    >
    > i have a Calendar Control in my web site and when it's in my computer the
    > months and weekdays are in portuguese.
    > When i change it to my server the months and weekdays change to english.
    >
    > Do you think i can solve this by changing culture in my web.config file?
    >
    > If yes, can you tell me what should be the code to include in the
    > web.config
    > file to force my culture to portuguese?
    >
    > If no, can you tell me what should be the solution?
    >
    > Thank You,
    > Miguel
    >
    >
     
    Ken Cox [Microsoft MVP], Apr 16, 2004
    #2
    1. Advertising

  3. Hi,

    i am getting some problems in making this code work. Could you please send
    me an example page with a calendar control and how to use the code you
    sugested me?

    Please use my email

    Thank You Very Much,
    Miguel

    "Ken Cox [Microsoft MVP]" <> wrote in message
    news:...
    > Hello Miguel,
    >
    > One solution would be to put your culture information in the web.config

    like
    > this:
    >
    > <configuration>
    > <appSettings>
    > <add key="CI" value="pt-PT" />
    > </appSettings>
    >
    > <system.web>
    > ....
    >
    > Then, you could retrieve the value in a variable and use the CultureInfo
    > class to set the language of the calendar:
    >
    >
    > Public strCI As String
    > Private Sub Page_Load _
    > (ByVal sender As System.Object, _
    > ByVal e As System.EventArgs) _
    > Handles MyBase.Load
    > strCI = ConfigurationSettings.AppSettings("CI")
    > If Not IsPostBack Then
    > Dim dtNow As Date = DateTime.Now
    > Dim strName As String = Session("strLanguage")
    > Thread.CurrentThread.CurrentUICulture = _
    > New CultureInfo(strCI, False)
    > Thread.CurrentThread.CurrentCulture = _
    > New CultureInfo(strCI)
    > Calendar1.SelectedDate = dtNow
    > Calendar1.VisibleDate = dtNow
    > End If
    > End Sub
    >
    >
    > Private Sub Calendar1_SelectionChanged _
    > (ByVal sender As System.Object, _
    > ByVal e As System.EventArgs) _
    > Handles Calendar1.SelectionChanged
    > Thread.CurrentThread.CurrentUICulture = _
    > New CultureInfo(strCI, False)
    > Thread.CurrentThread.CurrentCulture = _
    > New CultureInfo(strCI)
    > End Sub
    >
    >
    > Does this help?
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    > Toronto
    >
    > "Miguel Dias Moura" <> wrote in message
    > news:u$...
    > > Hello,
    > >
    > > i have a Calendar Control in my web site and when it's in my computer

    the
    > > months and weekdays are in portuguese.
    > > When i change it to my server the months and weekdays change to english.
    > >
    > > Do you think i can solve this by changing culture in my web.config file?
    > >
    > > If yes, can you tell me what should be the code to include in the
    > > web.config
    > > file to force my culture to portuguese?
    > >
    > > If no, can you tell me what should be the solution?
    > >
    > > Thank You,
    > > Miguel
    > >
    > >

    >
     
    Miguel Dias Moura, Apr 19, 2004
    #3
  4. No need,

    i just solved it.

    Thank You Anyway,
    Miguel

    "Miguel Dias Moura" <> wrote in message
    news:...
    > Hi,
    >
    > i am getting some problems in making this code work. Could you please send
    > me an example page with a calendar control and how to use the code you
    > sugested me?
    >
    > Please use my email
    >
    > Thank You Very Much,
    > Miguel
    >
    > "Ken Cox [Microsoft MVP]" <> wrote in message
    > news:...
    > > Hello Miguel,
    > >
    > > One solution would be to put your culture information in the web.config

    > like
    > > this:
    > >
    > > <configuration>
    > > <appSettings>
    > > <add key="CI" value="pt-PT" />
    > > </appSettings>
    > >
    > > <system.web>
    > > ....
    > >
    > > Then, you could retrieve the value in a variable and use the CultureInfo
    > > class to set the language of the calendar:
    > >
    > >
    > > Public strCI As String
    > > Private Sub Page_Load _
    > > (ByVal sender As System.Object, _
    > > ByVal e As System.EventArgs) _
    > > Handles MyBase.Load
    > > strCI = ConfigurationSettings.AppSettings("CI")
    > > If Not IsPostBack Then
    > > Dim dtNow As Date = DateTime.Now
    > > Dim strName As String = Session("strLanguage")
    > > Thread.CurrentThread.CurrentUICulture = _
    > > New CultureInfo(strCI, False)
    > > Thread.CurrentThread.CurrentCulture = _
    > > New CultureInfo(strCI)
    > > Calendar1.SelectedDate = dtNow
    > > Calendar1.VisibleDate = dtNow
    > > End If
    > > End Sub
    > >
    > >
    > > Private Sub Calendar1_SelectionChanged _
    > > (ByVal sender As System.Object, _
    > > ByVal e As System.EventArgs) _
    > > Handles Calendar1.SelectionChanged
    > > Thread.CurrentThread.CurrentUICulture = _
    > > New CultureInfo(strCI, False)
    > > Thread.CurrentThread.CurrentCulture = _
    > > New CultureInfo(strCI)
    > > End Sub
    > >
    > >
    > > Does this help?
    > >
    > > Ken
    > > Microsoft MVP [ASP.NET]
    > > Toronto
    > >
    > > "Miguel Dias Moura" <> wrote in message
    > > news:u$...
    > > > Hello,
    > > >
    > > > i have a Calendar Control in my web site and when it's in my computer

    > the
    > > > months and weekdays are in portuguese.
    > > > When i change it to my server the months and weekdays change to

    english.
    > > >
    > > > Do you think i can solve this by changing culture in my web.config

    file?
    > > >
    > > > If yes, can you tell me what should be the code to include in the
    > > > web.config
    > > > file to force my culture to portuguese?
    > > >
    > > > If no, can you tell me what should be the solution?
    > > >
    > > > Thank You,
    > > > Miguel
    > > >
    > > >

    > >

    >
    >
     
    Miguel Dias Moura, Apr 19, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    1
    Views:
    401
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Apr 1, 2004
  2. Miguel Dias Moura
    Replies:
    1
    Views:
    424
    Lars Netzel
    Jun 18, 2004
  3. Miguel Dias Moura
    Replies:
    2
    Views:
    344
    Martin
    Jun 22, 2004
  4. Shawn
    Replies:
    8
    Views:
    390
    Shawn
    Sep 21, 2006
  5. PETER WONG F H (+971 50 8320722)

    Please send you property detail to me,thank you !

    PETER WONG F H (+971 50 8320722), Mar 14, 2010, in forum: Python
    Replies:
    0
    Views:
    319
    PETER WONG F H (+971 50 8320722)
    Mar 14, 2010
Loading...

Share This Page