[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] KABC Addresses
From:       Tobias Koenig <tokoe82 () yahoo ! de>
Date:       2002-10-02 16:19:27
[Download RAW message or body]

On Wed, Oct 02, 2002 at 02:22:37AM +0200, Jost Schenck wrote:
Hi Jost,

> The code for the localized address formatting is done, however, there's one 
> problem I find difficult. Because of this, the correct country for the 
> address formatting can not be detected yet:
> 
> On Monday 30 September 2002 00:44, Tobias Koenig wrote:
> > ATM there is no country name <-> country iso code conversation tool
> > available in kdelibs and the KCountryCombo seemed not to implement it as
> > well. Either we write our one stuff (I don't like this idea) or we extend
> > KLocale => everybody can prefer from that change.
> 
> Right now KLocale offers mapping of ISO code to country by looking up the 
> entry.desktop for a specific ISO code; it then returns this file's Name 
> field. I clearly can't do this the other way round, so I would have to 
> provide some kind of translation map.
Yes, I know. For this reason I suggested to extend the coming up KCountryCombo
in KDE 3.2.
We could add a ISO<->Name map there and the proper methods.

> The problem I see with this is that at least in my std.vcf file the country 
> information is localized. I.e. in a german address I have stored, it says:
> 
> ADR;TYPE=home:;;Foobarstr. 32;Bonn;;53111;Deutschland
> 
> so this is "Deutschland" instead of "Germany". However, if an english person 
> would store this information it would read "Germany". I have no idea of how 
> to map localized country names to ISO codes apart from having a translation 
That is no problem. The map will be created like this

QMap<QString,QString> cMap

cMap.insert( i18n("Germany"), "de");
cMap.insert( i18n("Tuvalu"), "tv");

The translations for all countries already exists so it is no additional
work for the i18n guys.
You can query a ISO code by cMap[ country ]. (country == "Deutschland")
If you create this cMap with a current locale of 'de' that will work fine.

Ciao,
Tobias
-- 
In a world without walls and fences who
needs Windows and Gates???
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic