Recent

Author Topic: Add 'Language' property to Controls with Text?  (Read 58847 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Add 'Language' property to Controls with Text?
« Reply #90 on: February 28, 2013, 01:15:25 pm »
Seems there's some movement on sorting based on various collation:
http://bugs.freepascal.org/view.php?id=22909#c65896

of course, only in trunk and it probably hasn't been committed yet (haven't checked) - would be nice if there were a way to set collation as well...


Or maybe I misunderstand - haven't looked at the actual patch, but it sounds interesting.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Add 'Language' property to Controls with Text?
« Reply #91 on: March 16, 2013, 06:36:22 pm »
Since I'm visiting in the US, I had a chance to take a quick look at the Latest Delphi.  I ran some of the same sort tests that I did with Lazarus and Delphi doesn't have the nightmarish sorting problems.  I'm not sure how it does it but it was successful in sorting a Hebrew list with NO coding in TListBox.Sort and TComboBox.Sort.  If I have another chance I will do more tests and try to look at the code to see what it is doing.
Lazarus Trunk / fpc 2.6.2 / Win32

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Add 'Language' property to Controls with Text?
« Reply #92 on: November 28, 2013, 07:52:17 am »
The subject of Sorting a TStringList came up in BugTracker again.  See issue# 0025378 - 'The Sort procedure in TStringList doesn't work correctly.'

A link was provided (https://www.gnu.org/software/coreutils/faq/#Sort-does-not-sort-in-normal-order_0021) that explains how TStringList.Sort is supposed to work. 

If I read it correctly,  it uses the System.Locale and not the Application.Locale.  That make absolutely no sense.  If my System.Locale is the US and I need to sort a list of French strings, I have to change my System.Locale???  (Yes I know I can use CustomSort but I would have to build an elaborate system and know which sort methods to use for an unknowable language).

Also it doesn't seem to work that way anyway.  My System.Locale is Israel and TStringList.Sort completely scrambles a list of Hebrew strings.  I checked it in Delphi and TStringList.Sort had no problem getting the sort order right.
Lazarus Trunk / fpc 2.6.2 / Win32

 

TinyPortal © 2005-2018