Re: Issue with spanish and serbian translations

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Issue with spanish and serbian translations
Дата
Msg-id 4635E4F7.5060801@postgresql.org
обсуждение исходный текст
Ответ на Issue with spanish and serbian translations  (Guillaume Lelarge <guillaume@lelarge.info>)
Ответы Re: Issue with spanish and serbian translations  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgadmin-hackers
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++;
             }
         }
     }

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: svn@pgadmin.org
Дата:
Сообщение: SVN Commit by dpage: r6241 - trunk/www/development
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Issue with spanish and serbian translations