Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Issue with spanish and serbian translations


  • From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
  • To: pgadmin-hackers(at)postgresql(dot)org
  • Subject: Issue with spanish and serbian translations
  • Date: Mon, 30 Apr 2007 13:49:38 +0200
  • Message-id: <4635D7D2.8010709@lelarge.info> <text/plain>

Hi,

I've worked on an issue reported by Diego Gil. There's no spanish and serbian options in the combo box of the options's dialog.

I've looked at this issue a bit. The problem seems related to pgAdmin3::OnInit method in src/pgAdmin3.cpp. Here is the specific part :

while (true)
{
  langInfo=wxLocale::GetLanguageInfo(langNo);
  if (!langInfo)
    break;

  if (englishName == langInfo->Description &&
    (langInfo->CanonicalName == wxT("en_US") ||
    (!langInfo->CanonicalName.IsEmpty() &&
    wxDir::Exists(i18nPath + wxT("/") + langInfo->CanonicalName))))
  {
    existingLangs.Add(langNo);
    existingLangNames.Add(translatedName);
    langCount++;
  }
  langNo++;
}

I tried with the change on the patch attached. Now, I see the spanish option, but the serbian one is still missing. And start time is quite longer.

I also took a look at the internat sample from wxWidgets. They use an array to list all translations available... :
static const wxLanguage langIds[] =
{
    wxLANGUAGE_DEFAULT,
    wxLANGUAGE_FRENCH,
    wxLANGUAGE_GERMAN,
    wxLANGUAGE_RUSSIAN,
    wxLANGUAGE_BULGARIAN,
    wxLANGUAGE_CZECH,
    wxLANGUAGE_POLISH,
    wxLANGUAGE_SWEDISH,
#if wxUSE_UNICODE || defined(__WXMOTIF__)
    wxLANGUAGE_JAPANESE,
#endif
#if wxUSE_UNICODE
    wxLANGUAGE_GEORGIAN,
    wxLANGUAGE_ENGLISH,
    wxLANGUAGE_ENGLISH_US,
    wxLANGUAGE_ARABIC,
    wxLANGUAGE_ARABIC_EGYPT
#endif
};

I wonder if we can do the same.

If we prefer to get a dynamic list, I think it would be better to get the list of the i18n's subdirectories and use wxLocale::FindLanguageInfo with each subdirectories' titles.

Some advices would be really appreciated.

Regards.


--
Guillaume.
http://www.postgresqlfr.org
http://docs.postgresqlfr.org
Index: src/pgAdmin3.cpp
===================================================================
--- src/pgAdmin3.cpp	(révision 6239)
+++ src/pgAdmin3.cpp	(copie de travail)
@@ -317,9 +317,10 @@
 
             while (true)
             {
+		if (langNo >= 100000)
+		  break;
                 langInfo=wxLocale::GetLanguageInfo(langNo);
-                if (!langInfo)
-                    break;
+                if (langInfo) {
 
                 if (englishName == langInfo->Description && 
                     (langInfo->CanonicalName == wxT("en_US") || 
@@ -330,8 +331,11 @@
                     existingLangNames.Add(translatedName);
                     langCount++;
                 }
+}
                 langNo++;
             }
+
+//wxLogError(str);
         }
     }
 


Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group