D14163: Fix translation of country names

Pino Toscano noreply at phabricator.kde.org
Mon Jul 16 18:34:27 BST 2018


pino added a comment.


  In D14163#293198 <https://phabricator.kde.org/D14163#293198>, @vkrause wrote:
  
  > In D14163#293194 <https://phabricator.kde.org/D14163#293194>, @pino wrote:
  >
  > > I noticed the recent changes in this file, so time to chime in.
  > >  This approach only works if each English text (which happens to be the very first for each country, so that's why `ISOtoCountry()` "works") is **exactly** the same (including capitalization) as the country name specified in iso-codes. Also considering the history of this file, it is very much likely to miss changes done in the latest years...
  > >
  > > IMHO this code is simply beyond any repair -- users ought to use iso-codes for these tasks, and not just the catalogs but also the JSON/XML files for all the mappings.
  > >
  > > I have locally a prototype of library that uses only QtCore, QtXml, and KI18n for reading iso-codes data; I can publish it somewhere, and fix these issues once and for all.
  >
  >
  > You are right, there are definitely more problems in this code.
  >
  > Replacing the data table currently in use here is next on the list, it's indeed heavily outdated. I'm not sure the iso-codes xml/json files are directly usable for this though, as this code can also map localized country names to ISO codes.
  
  
  `ISOtoCountry()` IMHO ought to be deprecated altogether, and replaced by a pure iso-codes lookup done elsewhere (e.g. in an external library, as I mentioned). This is definitely possible using iso-codes.
  
  OTOH `countryToISO()` is a more complex situation, and sadly iso-codes does not help here -- you can lookup English names, but that's about it.
  
  > This change is indeed not perfect in case the spelling doesn't match exactly, but that seems to be the exception. So it's still a low-risk step forward IMHO.
  
  There seems to be 20-21 entries of countries that either a) do not exist anymore b) their spelling does not match any of name / common name / official name in iso-codes, which makes 9% of the entries... Not to mention around 26 countries that `countrytransl.map` does not know about.

REPOSITORY
  R174 PIM: KContacts

REVISION DETAIL
  https://phabricator.kde.org/D14163

To: vkrause, mlaurent, pino
Cc: pino, kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20180716/75059bc9/attachment.html>


More information about the kde-pim mailing list