Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Culture Info

Culture Info

Scheduled Pinned Locked Moved ASP.NET
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Amit Kumar G
    wrote on last edited by
    #1

    I am developing an home page which can be access from 5 countries. Based on user location (which i don't know it could be Country A, B, C , D or E) i need to change home page accordingly. By default we will have country A. My boss says try to explore culture...but i have no idea for the same...Could you please show some directon.... Thanks Thanks

    G 1 Reply Last reply
    0
    • A Amit Kumar G

      I am developing an home page which can be access from 5 countries. Based on user location (which i don't know it could be Country A, B, C , D or E) i need to change home page accordingly. By default we will have country A. My boss says try to explore culture...but i have no idea for the same...Could you please show some directon.... Thanks Thanks

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You can create a CultureInfo object from a culture identifier or culture name. Example: CultureInfo culture = new CultureInfo("en-GB"); You just have to find out what culture the user preferres. The Accept-Language header in the HTTP headers might be one way to find this out. You use the CultureInfo object whenever you format any data that is culture dependant, for example in the string.Format or double.ToString methods. Example: labelPrice.Text = price.ToString("C2", culture);

      --- single minded; short sighted; long gone;

      A 1 Reply Last reply
      0
      • G Guffa

        You can create a CultureInfo object from a culture identifier or culture name. Example: CultureInfo culture = new CultureInfo("en-GB"); You just have to find out what culture the user preferres. The Accept-Language header in the HTTP headers might be one way to find this out. You use the CultureInfo object whenever you format any data that is culture dependant, for example in the string.Format or double.ToString methods. Example: labelPrice.Text = price.ToString("C2", culture);

        --- single minded; short sighted; long gone;

        A Offline
        A Offline
        Amit Kumar G
        wrote on last edited by
        #3

        I am using this Response.Write(CultureInfo.CurrentCulture.ThreeLetterISOLanguageName); and everytime is shows USA....I tried to change the settings from control panel-->regional and language options.... But no luck!! thanks

        G 1 Reply Last reply
        0
        • A Amit Kumar G

          I am using this Response.Write(CultureInfo.CurrentCulture.ThreeLetterISOLanguageName); and everytime is shows USA....I tried to change the settings from control panel-->regional and language options.... But no luck!! thanks

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Amit Kumar G wrote:

          I am using this Response.Write(CultureInfo.CurrentCulture.ThreeLetterISOLanguageName); and everytime is shows USA...

          Yes, of course. You are showing the culture that the server is using.

          --- single minded; short sighted; long gone;

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups