Internationalization in ASP.NET

Discussion in 'ASP .Net' started by Kiran A K, Mar 2, 2006.

  1. Kiran A K

    Kiran A K Guest

    Hi,

    i want my web application to support several languages (like english,
    russian, danish etc).
    how do i achieve this in ASP.NET?

    the application should automatically detect the client's locale and then
    display the web pages
    in the appropriate language.
    is it possible to have separate language files for each language?
    in each of these files i would like to specify all the text strings used in
    the application.

    actually i from Java background and in Struts there is a concept of resource
    bundles.
    Resource bundles are nothing but separate language files for each language
    containing all
    the text strings used in the application.

    regards,
    Kiran
     
    Kiran A K, Mar 2, 2006
    #1
    1. Advertising

  2. Start here, see if it gives you an idea

    http://msdn.microsoft.com/library/d...t/html/cpsmpnetsamples-aspnetlocalization.asp

    --
    Regards

    John Timney
    Microsoft MVP

    "Kiran A K" <> wrote in message
    news:ezz2$$...
    > Hi,
    >
    > i want my web application to support several languages (like english,
    > russian, danish etc).
    > how do i achieve this in ASP.NET?
    >
    > the application should automatically detect the client's locale and then
    > display the web pages
    > in the appropriate language.
    > is it possible to have separate language files for each language?
    > in each of these files i would like to specify all the text strings used
    > in the application.
    >
    > actually i from Java background and in Struts there is a concept of
    > resource bundles.
    > Resource bundles are nothing but separate language files for each language
    > containing all
    > the text strings used in the application.
    >
    > regards,
    > Kiran
    >
     
    John Timney \( MVP \), Mar 2, 2006
    #2
    1. Advertising

  3. Kiran A K

    vinu Guest

    Hi..
    Check the following site...
    http://www.c-sharpcorner.com/Upload...rticleID=96602e53-0fb1-44ec-a67b-1c68b05eb2e1

    vinu
    "Kiran A K" <> wrote in message
    news:ezz2$$...
    > Hi,
    >
    > i want my web application to support several languages (like english,
    > russian, danish etc).
    > how do i achieve this in ASP.NET?
    >
    > the application should automatically detect the client's locale and then
    > display the web pages
    > in the appropriate language.
    > is it possible to have separate language files for each language?
    > in each of these files i would like to specify all the text strings used
    > in the application.
    >
    > actually i from Java background and in Struts there is a concept of
    > resource bundles.
    > Resource bundles are nothing but separate language files for each language
    > containing all
    > the text strings used in the application.
    >
    > regards,
    > Kiran
    >
     
    vinu, Mar 2, 2006
    #3
  4. The links provided by John's and Vinu's are great if you want to use the
    built-in methods. But any serious multilingual development is going to run
    into a number of problems with the basic approach. I have a 3 parter that's
    been well established as the real way to build multilingual ASP.NET
    websites:

    http://openmymind.net/index.aspx?documentId=3
    http://openmymind.net/index.aspx?documentId=4
    http://openmymind.net/index.aspx?documentId=52

    Karl
    --
    http://www.openmymind.net/
    http://www.fuelindustries.com/


    "Kiran A K" <> wrote in message
    news:ezz2$$...
    > Hi,
    >
    > i want my web application to support several languages (like english,
    > russian, danish etc).
    > how do i achieve this in ASP.NET?
    >
    > the application should automatically detect the client's locale and then
    > display the web pages
    > in the appropriate language.
    > is it possible to have separate language files for each language?
    > in each of these files i would like to specify all the text strings used
    > in the application.
    >
    > actually i from Java background and in Struts there is a concept of
    > resource bundles.
    > Resource bundles are nothing but separate language files for each language
    > containing all
    > the text strings used in the application.
    >
    > regards,
    > Kiran
    >
     
    Karl Seguin [MVP], Mar 2, 2006
    #4
  5. Kiran A K

    Maury Guest

    Karl Seguin [MVP] ha scritto:
    > The links provided by John's and Vinu's are great if you want to use the
    > built-in methods. But any serious multilingual development is going to run
    > into a number of problems with the basic approach.

    I watched at your links but I have a further question for you:
    in my simple site I ovverride the method InitializeCulture
    of a page I would like to do this
    after the user clicks on a button, but the
    button_click event raises after the InitializeCulture
    event so I have to click twice to view the new language...

    Do you know how can I fix this without using URL rewriting
    you explain in your article?

    Thanks!
    M.
     
    Maury, Mar 2, 2006
    #5
  6. You've run into a common problem. The timing issue is quite problematic.
    There aren't any good ways unfortunetly. One thing you can do is use the
    Request.Form[] variable in your initializeCulture. You can use it to
    pre-emptively see if the button was clicked, and if so switch the culture -
    this is a throw back to how we programmed in classic ASP or how it's done in
    PHP - it's quite effective actually.


    karl

    --
    http://www.openmymind.net/
    http://www.fuelindustries.com/


    "Maury" <> wrote in message
    news:m%CNf.15794$...
    > Karl Seguin [MVP] ha scritto:
    >> The links provided by John's and Vinu's are great if you want to use the
    >> built-in methods. But any serious multilingual development is going to
    >> run into a number of problems with the basic approach.

    > I watched at your links but I have a further question for you:
    > in my simple site I ovverride the method InitializeCulture
    > of a page I would like to do this
    > after the user clicks on a button, but the
    > button_click event raises after the InitializeCulture
    > event so I have to click twice to view the new language...
    >
    > Do you know how can I fix this without using URL rewriting
    > you explain in your article?
    >
    > Thanks!
    > M.
     
    Karl Seguin [MVP], Mar 2, 2006
    #6
  7. Kiran A K

    Maury Guest

    Karl Seguin [MVP] ha scritto:
    > You've run into a common problem.

    fantastic :-(

    > There aren't any good ways unfortunetly.

    ....

    > One thing you can do is ...

    I tried to use Javascript: the image (with the flag)
    has a javascript function (onclick event, client side)
    in this function I write the culture
    into an hidden field (with runat=server)
    then in InitializeCulture I read the hidden field...
    I have some problem with Javascript but I think this
    can be a solution (even if there are some drawbacks...
    for example if the borwser ha javascript disable)
    Do you think that this can be a solution?

    > karl

    Thanks
    M.
     
    Maury, Mar 3, 2006
    #7
  8. yes, I think it'd be a good one. Just do Request.Form["hiddenFieldName"] to
    get your culture and voila :)

    Good idea!

    Karl
    --
    http://www.openmymind.net/
    http://www.fuelindustries.com/


    "Maury" <> wrote in message
    news:KtSNf.16251$...
    > Karl Seguin [MVP] ha scritto:
    >> You've run into a common problem.

    > fantastic :-(
    >
    >> There aren't any good ways unfortunetly.

    > ...
    >
    >> One thing you can do is ...

    > I tried to use Javascript: the image (with the flag)
    > has a javascript function (onclick event, client side)
    > in this function I write the culture
    > into an hidden field (with runat=server)
    > then in InitializeCulture I read the hidden field...
    > I have some problem with Javascript but I think this
    > can be a solution (even if there are some drawbacks...
    > for example if the borwser ha javascript disable)
    > Do you think that this can be a solution?
    >
    >> karl

    > Thanks
    > M.
    >
     
    Karl Seguin [MVP], Mar 3, 2006
    #8
    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. Pablo Jose Almeida da Guia

    Internationalization Problem

    Pablo Jose Almeida da Guia, Dec 5, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    382
    Pablo Jose Almeida da Guia
    Dec 5, 2003
  2. =?Utf-8?B?Z2FieW0=?=

    ASP.NET 2.0 Internationalization

    =?Utf-8?B?Z2FieW0=?=, Jun 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,405
    =?Utf-8?B?Z2FieW0=?=
    Jun 23, 2005
  3. Lee C.

    ASP.NET Internationalization bug?

    Lee C., Jun 27, 2008, in forum: ASP .Net
    Replies:
    31
    Views:
    1,486
    Lee C.
    Aug 13, 2008
  4. Jane Giles

    ASP & Internationalization

    Jane Giles, Sep 25, 2003, in forum: ASP General
    Replies:
    0
    Views:
    125
    Jane Giles
    Sep 25, 2003
  5. Emre Sevinc
    Replies:
    2
    Views:
    244
    Emre Sevinc
    Aug 16, 2004
Loading...

Share This Page