Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    sorting in different language

    I had an inquiry about sorting in different languages - For example I have the following data. In Turkish, ç comes after c - if you sort by name in the listgrid, ç comes BEFORE c, but sorting with the text column, ç comes after c. What is the proper way to make the sorting work for a particular language? I've tried to just switch the browser language to turkish but it does not make a difference.

    Code:
    testData = [
    {
    name: "aa",
    text: "aa"
    },
    {
    name: "bb",
    text:"bb"
    },
    {
    name: "cc",
    text:"cc"
    },
    {
    name: "ç",
    text:"çç"
    }
    ]
    
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true,
        data: testData,fields:[{name:"name"},{name:"text"}]
    })

    #2
    We're using browser-native sorting (String.localeCompare()), so, whatever browser you're seeing this in (you didn't mention) either it's localeCompare() has a bug or you don't fully understand Turkish sorting rules :)

    Comment


      #3
      I was using Firefox to test - I'm getting my information from a Turkish person, so naturally, I believe her. I also looked it up on wiki

      http://en.wikipedia.org/wiki/Turkish_alphabet

      Capital letters
      A B C Ç D E F G Ğ H I İ J K L M N O Ö P R S Ş T U Ü V Y Z
      Lower case letters
      a b c ç d e f g ğ h ı i j k l m n o ö p r s ş t u ü v y z

      And on http://www.princeton.edu/~ehgilson/alpha.html - says the exact same thing. So, if you know of some other "Turkish sorting rule" please do enlighten me.

      Comment


        #4
        Again, if the sorting is not correct, it would be a native browser bug. There is no feasible way to write replacement locale-sensitive comparators that would be in the ballpark of fast enough, so you'll need to file a bug against Firefox.

        Comment


          #5
          Acarur01,

          Did u find a solution to that??

          Comment


            #6
            No, we resolved it as not fixable

            Comment


              #7
              Just an update:

              We discover that Internet Explorer sort the data correctly in Turkish but Chrome do it wrong. Just looking for other browsers.

              Comment


                #8
                Originally posted by gokhanoner
                Just an update:

                We discover that Internet Explorer sort the data correctly in Turkish but Chrome do it wrong. Just looking for other browsers.
                Firefox also sort correctly.

                Comment

                Working...
                X