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. General Programming
  3. .NET (Core and Framework)
  4. Find out if resource localized for given culture

Find out if resource localized for given culture

Scheduled Pinned Locked Moved .NET (Core and Framework)
comquestionlearning
5 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.
  • L Offline
    L Offline
    la01
    wrote on last edited by
    #1

    Hi all, How would I find out if a resource is localized for a given culture? E.g.: For ResourceManager.GetString(String, CultureInfo) "if the resource is not localized for this culture, the lookup will fall back using the current thread's Parent property, stopping after looking in the neutral culture." (From MSDN) But I don't want it to fall-back or look in neutral cultures, is there a way I could get a value returned if the resource is simply not localized? :confused:

    P 1 Reply Last reply
    0
    • L la01

      Hi all, How would I find out if a resource is localized for a given culture? E.g.: For ResourceManager.GetString(String, CultureInfo) "if the resource is not localized for this culture, the lookup will fall back using the current thread's Parent property, stopping after looking in the neutral culture." (From MSDN) But I don't want it to fall-back or look in neutral cultures, is there a way I could get a value returned if the resource is simply not localized? :confused:

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      What would you expect to be returned if the value hasn't been localized? I'm confused as to your requirements here.

      "WPF has many lovers. It's a veritable porn star!" - Josh Smith

      As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

      My blog | My articles | MoXAML PowerToys | Onyx

      L 1 Reply Last reply
      0
      • P Pete OHanlon

        What would you expect to be returned if the value hasn't been localized? I'm confused as to your requirements here.

        "WPF has many lovers. It's a veritable porn star!" - Josh Smith

        As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

        My blog | My articles | MoXAML PowerToys | Onyx

        L Offline
        L Offline
        la01
        wrote on last edited by
        #3

        null or an empty string, perhaps? I need to know that resource is not localized. I don't want to get an alternative from another language returned.

        P 1 Reply Last reply
        0
        • L la01

          null or an empty string, perhaps? I need to know that resource is not localized. I don't want to get an alternative from another language returned.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Well, when you test it, don't have a fallback resource available. That should do it - basically, only have your localized version in place.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          L 1 Reply Last reply
          0
          • P Pete OHanlon

            Well, when you test it, don't have a fallback resource available. That should do it - basically, only have your localized version in place.

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

            My blog | My articles | MoXAML PowerToys | Onyx

            L Offline
            L Offline
            la01
            wrote on last edited by
            #5

            Hmm.. true, that does seem like the only way. Thanks Pete!

            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