Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2000:
[Freeciv-Dev] Re: Russian localization & other questions
Home

[Freeciv-Dev] Re: Russian localization & other questions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Russian localization & other questions
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Mon, 07 Aug 2000 14:37:43 -0400

At 2000/08/05 18:11 , Gaute (B) Strokkenes wrote:
>Dmitriy Genzel <udgenzel@xxxxxxxxxxxxxx> writes:
>
>> Related to this, I found several issues with the way freeciv handles
>> locales. First, sorting is clearly done according to ascii charset, not
>> according to locale. (Disclaimer: I haven't looked at the code, I am
>> judging by effects). There are at least two places where this is apparent:
>> in Help topics and in Science advisor - choosing a technology.
>
>There's an easy fix for the help topics:
>
>>>>
>--- freeciv/client/helpdata.c.old      Sun Jul 30 13:28:36 2000
>+++ freeciv/client/helpdata.c  Sat Aug  5 23:48:36 2000
>@@ -171,7 +171,7 @@
>       break;
>     }
>   }
>-  return strcmp(ta, tb);
>+  return strcoll (ta, tb);
> }
> 
> /****************************************************************
><<<
>
>I haven't tried it, but if you have your locale set up correctly then
>it should work.  Why don't you try it and tell me... 8-) (I use
>--disable-nls.)
>
>The science advisor is not quite that easy. The function
>string_ptr_compare() in common/shared.c is just a wrapper for
>mystrcasecmp().  To my knowledge, there is no strcasecoll().  The best
>fix is probably to investigate where string_ptr_compare() is used and
>decide if case-insensitive would do instead.  And why doesn't
>helpdata.c use it anyway?
>
>Since strcoll() is C89 and later only, it's probably a good idea to
>add a configure test and fall back to strcmp() if necessary.

Attached is a patch which uses strcoll() in several places.  It provides
routines in shared.[hc] to wrap one of strcoll() or strcmp(), depending
upon configuration determinations.

Attachment: sort-using-locale-0.diff.gz
Description: Binary data

jjm

[Prev in Thread] Current Thread [Next in Thread]