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. C#
  4. Multi-lingual possessive case

Multi-lingual possessive case

Scheduled Pinned Locked Moved C#
questioncsharplounge
4 Posts 2 Posters 1 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.
  • T Offline
    T Offline
    Tyrone Watt
    wrote on last edited by
    #1

    Hi Not sure if this is the right forum for this as its more of a general question, but it didnt seem to fit any other category, and since I am looking for a c# solution.... I am looking for ideas to handle possessive case for a multi-lingual site. e.g John Smith's photo's (the 's after smith). Since the name is what the user entered, and in this case IN ENGLISH it requires an 's to make it possessive, but in some cases it will just require an apostrophe, without the (s). Doing this for a single language is easy enough when you know the rules, but how would you implement this on a site using Localization? Is there a better way than hard-coding the language rules per culture code? Thanks

    L 1 Reply Last reply
    0
    • T Tyrone Watt

      Hi Not sure if this is the right forum for this as its more of a general question, but it didnt seem to fit any other category, and since I am looking for a c# solution.... I am looking for ideas to handle possessive case for a multi-lingual site. e.g John Smith's photo's (the 's after smith). Since the name is what the user entered, and in this case IN ENGLISH it requires an 's to make it possessive, but in some cases it will just require an apostrophe, without the (s). Doing this for a single language is easy enough when you know the rules, but how would you implement this on a site using Localization? Is there a better way than hard-coding the language rules per culture code? Thanks

      L Offline
      L Offline
      Lukasz Nowakowski
      wrote on last edited by
      #2

      I don't think you can do that a generic solution. In English it's easy, but in Polish you would have something like this: The name: "Jan Kowalski". Possessive case: "Jana Kowalskiego". You see, in Polish we have 7 (seven) cases. And those are applied to both first name and last name. Similar situation also applies to Russian, Czech and other Slavic languages. Don't know many others, but generally, you can't create generic solution for all languages.

      Don't forget to rate answer, that helped you. It will allow other people find their answers faster.

      T 1 Reply Last reply
      0
      • L Lukasz Nowakowski

        I don't think you can do that a generic solution. In English it's easy, but in Polish you would have something like this: The name: "Jan Kowalski". Possessive case: "Jana Kowalskiego". You see, in Polish we have 7 (seven) cases. And those are applied to both first name and last name. Similar situation also applies to Russian, Czech and other Slavic languages. Don't know many others, but generally, you can't create generic solution for all languages.

        Don't forget to rate answer, that helped you. It will allow other people find their answers faster.

        T Offline
        T Offline
        Tyrone Watt
        wrote on last edited by
        #3

        Thanks, I figured that would be the case. I was just wondering if there was a better way than a whole bunch of "ifs" for each language we implement.

        L 1 Reply Last reply
        0
        • T Tyrone Watt

          Thanks, I figured that would be the case. I was just wondering if there was a better way than a whole bunch of "ifs" for each language we implement.

          L Offline
          L Offline
          Lukasz Nowakowski
          wrote on last edited by
          #4

          Well... Another way could be to do with String.Format. // retrieve formattingString from resource string.Format(formattingString, "John Smith"); And now for English you can have resource: "{0}'s photos". For Polish you could have: "Zdjęcia należące do użytkownika {0}". And although it is quite long, it is grammatically valid. But you have to create a version for each language you support :-)

          Don't forget to rate answer, that helped you. It will allow other people find their answers faster.

          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