Web pgadmin.org
 Home 
 ·  ·  ·  ·  ·  ·  · 
Re: Issue with spanish and serbian translations

Re: Issue with spanish and serbian translations



Guillaume Lelarge wrote:
> 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.

I hacked up the attached for testing which is a similar idea - the
downside being that languages that are listed twice in pgadmin3.lng are
shown twice in the list if they exist (eg. Chinese (Simplified) vs.
Chinese (Taiwan)). That should be an easy fix though.

I couldn't get Serbian to work though - does wxWidgets even support it?
If so, are we using the correct code?

Regards, Dave
Index: pgadmin/pgAdmin3.cpp
===================================================================
--- pgadmin/pgAdmin3.cpp	(revision 6227)
+++ pgadmin/pgAdmin3.cpp	(working copy)
@@ -301,24 +301,17 @@
             wxString englishName=line.BeforeFirst(',').Trim(true);
             wxString translatedName=line.AfterFirst(',').Trim(false);
 
-            langNo=2;       // skipping default, unknown
-
-            while (true)
+            langInfo=wxLocale::FindLanguageInfo(englishName);
+            if (langInfo)
             {
-                langInfo=wxLocale::GetLanguageInfo(langNo);
-                if (!langInfo)
-                    break;
-
-                if (englishName == langInfo->Description && 
-                    (langInfo->CanonicalName == wxT("en_US") || 
+                if (langInfo->CanonicalName == wxT("en_US") || 
                     (!langInfo->CanonicalName.IsEmpty() && 
-                     wxDir::Exists(i18nPath + wxT("/") + langInfo->CanonicalName))))
+                     wxDir::Exists(i18nPath + wxT("/") + langInfo->CanonicalName)))
                 {
-                    existingLangs.Add(langNo);
+                    existingLangs.Add(langInfo->Language);
                     existingLangNames.Add(translatedName);
                     langCount++;
                 }
-                langNo++;
             }
         }
     }


Home | Main Index | Thread Index

top