[Phpmyadmin-git] [SCM] phpMyAdmin website branch, master, updated. 5fc76a8f5a83c2561ac7725cfa0e819ec98afc83

Michal Čihař nijel at users.sourceforge.net
Tue Mar 30 11:19:52 CEST 2010


The branch, master has been updated
       via  5fc76a8f5a83c2561ac7725cfa0e819ec98afc83 (commit)
       via  735539fbc4324baa6c79457bfc929028823cea8c (commit)
       via  344d5a458c89fca389c3b48a49b7bb782b07a187 (commit)
       via  9bdf025ec3a463f33292c91274784bb7aa291336 (commit)
       via  0551fde89e117b0b5cab42770c72d001db5d82ae (commit)
      from  e69384948a6f73edbd1b06de626590171a5d8825 (commit)


- Log -----------------------------------------------------------------
commit 5fc76a8f5a83c2561ac7725cfa0e819ec98afc83
Author: Michal Čihař <mcihar at novell.com>
Date:   Tue Mar 30 11:19:38 2010 +0200

    Adjust to work wit gettext.

commit 735539fbc4324baa6c79457bfc929028823cea8c
Author: Michal Čihař <mcihar at novell.com>
Date:   Tue Mar 30 10:58:14 2010 +0200

    Update description of translations.

commit 344d5a458c89fca389c3b48a49b7bb782b07a187
Merge: 9bdf025ec3a463f33292c91274784bb7aa291336 e69384948a6f73edbd1b06de626590171a5d8825
Author: Michal Čihař <mcihar at novell.com>
Date:   Mon Mar 29 09:05:46 2010 +0200

    Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/website

commit 9bdf025ec3a463f33292c91274784bb7aa291336
Author: Michal Čihař <mcihar at novell.com>
Date:   Mon Mar 15 14:03:39 2010 +0100

    Better description.

commit 0551fde89e117b0b5cab42770c72d001db5d82ae
Author: Michal Čihař <mcihar at novell.com>
Date:   Mon Mar 15 14:03:09 2010 +0100

    Add translators list to overview.

-----------------------------------------------------------------------

Summary of changes:
 README                     |    2 +
 data/langnames.py          |  119 ++++++++++++++++++++++----------------------
 helper/cache.py            |    2 +-
 render.py                  |   35 ++++++-------
 templates/support.tpl      |    5 +-
 templates/translations.tpl |   24 ++++-----
 6 files changed, 92 insertions(+), 95 deletions(-)

diff --git a/README b/README
index 12c4747..b2e49ff 100644
--- a/README
+++ b/README
@@ -16,6 +16,8 @@ python-feedparser - http://www.feedparser.org
 (4.1 tested)
 GitPython - http://gitorious.org/projects/git-python/
 (0.1.6 tested)
+polib - http://bitbucket.org/izi/polib/src/
+(0.5.1 tested)
 
 
 Security announcements
diff --git a/data/langnames.py b/data/langnames.py
index e3f612d..eb1559f 100644
--- a/data/langnames.py
+++ b/data/langnames.py
@@ -17,64 +17,65 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 MAP = {
-    'afrikaans' : 'af',
-    'afrikaans' : 'af',
-    'arabic' : 'ar',
-    'azerbaijani' : 'az',
-    'bangla' : 'bn',
-    'belarusian_cyrillic' : 'be',
-    'belarusian_latin' : 'belat',
-    'bulgarian' : 'bg',
-    'bosnian' : 'bs',
-    'catalan' : 'ca',
-    'czech' : 'cs',
-    'danish' : 'da',
-    'german' : 'de',
-    'greek' : 'el',
-    'english' : 'en',
-    'english-gb' : 'engb',
-    'spanish' : 'es',
-    'estonian' : 'et',
-    'basque' : 'eu',
-    'persian' : 'fa',
-    'finnish' : 'fi',
-    'french' : 'fr',
-    'galician' : 'gl',
-    'hebrew' : 'he',
-    'hindi' : 'hi',
-    'croatian' : 'hr',
-    'hungarian' : 'hu',
-    'indonesian' : 'id',
-    'italian' : 'it',
-    'japanese' : 'ja',
-    'korean' : 'ko',
-    'georgian' : 'ka',
-    'lithuanian' : 'lt',
-    'latvian' : 'lv',
-    'macedonian_cyrillic' : 'mk',
-    'mongolian' : 'mn',
-    'malay' : 'ms',
-    'dutch' : 'nl',
-    'norwegian' : 'no',
-    'polish' : 'pl',
-    'brazilian_portuguese' : 'ptbr',
-    'portuguese' : 'pt',
-    'romanian' : 'ro',
-    'russian' : 'ru',
-    'slovak' : 'sk',
-    'slovenian' : 'sl',
-    'sinhala' : 'si',
-    'albanian' : 'sq',
-    'serbian_latin' : 'srlat',
-    'serbian_cyrillic' : 'sr',
-    'swedish' : 'sv',
-    'thai' : 'th',
-    'turkish' : 'tr',
-    'tatarish' : 'tt',
-    'ukrainian' : 'uk',
-    'uzbek_cyrillic': 'uz',
-    'uzbek_latin': 'uzlat',
-    'chinese_traditional' : 'zhtw',
-    'chinese_simplified' : 'zh',
+    'af' : 'afrikaans',
+    'af' : 'afrikaans',
+    'ar' : 'arabic',
+    'az' : 'azerbaijani',
+    'bn' : 'bangla',
+    'be' : 'belarusian_cyrillic',
+    'be at latin' : 'belarusian_latin',
+    'bg' : 'bulgarian',
+    'bs' : 'bosnian',
+    'ca' : 'catalan',
+    'cs' : 'czech',
+    'da' : 'danish',
+    'de' : 'german',
+    'el' : 'greek',
+    'en' : 'english',
+    'en_GB' : 'english-gb',
+    'es' : 'spanish',
+    'et' : 'estonian',
+    'eu' : 'basque',
+    'fa' : 'persian',
+    'fi' : 'finnish',
+    'fr' : 'french',
+    'gl' : 'galician',
+    'he' : 'hebrew',
+    'hi' : 'hindi',
+    'hr' : 'croatian',
+    'hu' : 'hungarian',
+    'id' : 'indonesian',
+    'it' : 'italian',
+    'ja' : 'japanese',
+    'ko' : 'korean',
+    'ka' : 'georgian',
+    'lt' : 'lithuanian',
+    'lv' : 'latvian',
+    'mk' : 'macedonian_cyrillic',
+    'mn' : 'mongolian',
+    'ms' : 'malay',
+    'nl' : 'dutch',
+    'nb' : 'norwegian',
+    'pl' : 'polish',
+    'pt_BR' : 'brazilian_portuguese',
+    'pt' : 'portuguese',
+    'ro' : 'romanian',
+    'ru' : 'russian',
+    'sk' : 'slovak',
+    'sl' : 'slovenian',
+    'si' : 'sinhala',
+    'sq' : 'albanian',
+    'sr at latin' : 'serbian_latin',
+    'sr' : 'serbian_cyrillic',
+    'sv' : 'swedish',
+    'te' : 'telugu',
+    'th' : 'thai',
+    'tr' : 'turkish',
+    'tt' : 'tatarish',
+    'uk' : 'ukrainian',
+    'uz' : 'uzbek_cyrillic',
+    'uz at latin' : 'uzbek_latin',
+    'zh_TW' : 'chinese_traditional',
+    'zh_CN' : 'chinese_simplified',
 }
 
diff --git a/helper/cache.py b/helper/cache.py
index 3cd3dd8..c7dc626 100644
--- a/helper/cache.py
+++ b/helper/cache.py
@@ -188,4 +188,4 @@ class GitCache(Cache):
             os.system('cd %s ; git pull -q' % self.dirname)
         self.repo = git.Repo(self.dirname)
         self.tree = self.repo.tree()
-        self.langtree = self.tree['lang']
+        self.langtree = self.tree['po']
diff --git a/render.py b/render.py
index faf85cc..3e81c8e 100755
--- a/render.py
+++ b/render.py
@@ -27,6 +27,7 @@ import shutil
 import csv
 import traceback
 import datetime
+import polib
 from genshi.template import TemplateLoader
 from genshi.template import NewTextTemplate
 from genshi.input import XML
@@ -57,7 +58,7 @@ BRANCH_REGEXP = re.compile('^([0-9]+\.[0-9]+)\.')
 MAJOR_BRANCH_REGEXP = re.compile('^([0-9]+)\.')
 TESTING_REGEXP = re.compile('.*(beta|alpha|rc).*')
 SIZE_REGEXP = re.compile('.*\(([0-9]+) bytes, ([0-9]+) downloads to date')
-LANG_REGEXP ='((translation|lang|%s).*update|update.*(translation|lang|%s)|^updated?$|new lang|better word|fix.*translation)'
+LANG_REGEXP ='((translation|lang|%s).*update|update.*(translation|lang|%s)|^updated?$|new lang|better word|fix.*translation|Translation update done using Pootle)'
 
 # Base URL (including trailing /)
 SERVER = 'http://www.phpmyadmin.net'
@@ -914,26 +915,21 @@ class SFGenerator:
         list = self.git.langtree.keys()
         list.sort()
         translators = XML(self.git.tree['translators.html'].data)
-        english = self.git.langtree['english-utf-8.inc.php'].data
-        allmessages = len(re.compile('\n\$str').findall(english))
         for name in list:
-            if name[-14:] != '-utf-8.inc.php':
+            if name[-3:] != '.po':
                 continue
-            lang = name[:-14]
-            try:
-                baselang, ignore = lang.split('_')
-            except:
-                baselang = lang
-            translator = translators.select('tr[@id="%s"]/td[2]/text()' % lang)
+            lang = name[:-3]
+            longlang = data.langnames.MAP[lang]
+            po = polib.pofile('cache/git___phpmyadmin.git.sourceforge.net_gitroot_phpmyadmin_phpmyadmin/po/%s' % name)
+            translator = translators.select('tr[@id="%s"]/td[2]/text()' % longlang)
             translator = unicode(translator).strip()
             if translator == '':
-                translator = translators.select('tr[@id="%s"]/td[2]/text()' % baselang)
+                translator = translators.select('tr[@id="%s"]/td[2]/text()' % longlang.split('_')[0])
                 translator = unicode(translator).strip()
             translator = self.fmt_translator(translator)
-            short = data.langnames.MAP[lang]
-            helper.log.dbg(' - %s [%s]' % (lang, short))
+            helper.log.dbg(' - %s [%s]' % (lang, longlang))
             gitlog = self.git.repo.log(path = 'lang/english-utf-8.inc.php')
-            langs = '%s|%s|%s' % (lang, short, baselang)
+            langs = '%s|%s' % (lang, longlang)
             regexp = re.compile(LANG_REGEXP % (langs, langs), re.IGNORECASE)
             found = None
             if lang == 'english':
@@ -943,10 +939,9 @@ class SFGenerator:
                     if regexp.findall(x.message) != []:
                         found = x
                         break
-            content = self.git.langtree[name].data
-            missing = len(re.compile('\n\$str.*to translate').findall(content))
-            translated = allmessages - missing
-            percent = 100.0 * translated / allmessages
+
+            percent = po.percent_translated()
+            translated = len(po.translated_entries())
             if percent < 50:
                 css = ' b50'
             elif percent < 80:
@@ -958,8 +953,8 @@ class SFGenerator:
             except TypeError:
                 dt = ''
             self.data['translations'].append({
-                'name': lang,
-                'short': short,
+                'name': longlang,
+                'short': lang,
                 'translated': translated,
                 'translator': translator,
                 'percent': '%0.1f' % percent,
diff --git a/templates/support.tpl b/templates/support.tpl
index 56b894b..2f7ebbb 100644
--- a/templates/support.tpl
+++ b/templates/support.tpl
@@ -25,8 +25,9 @@
 <h2>Mailing Lists</h2>
 <ul>
     <li>For news/announcements: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-news">phpmyadmin-news at lists.sourceforge.net</a></li>
-    <li>For user questions: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-users">phpmyadmin-users at lists.sourceforge.net</a></li>
-    <li>For developer questions: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-devel">phpmyadmin-devel at lists.sourceforge.net</a></li>
+    <li>For users: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-users">phpmyadmin-users at lists.sourceforge.net</a></li>
+    <li>For developers: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-devel">phpmyadmin-devel at lists.sourceforge.net</a></li>
+    <li>For translators: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-translators">phpmyadmin-translators at lists.sourceforge.net</a></li>
     <li>Git commit notifications: <a href="https://lists.sourceforge.net/mailman/listinfo/phpmyadmin-git">phpmyadmin-git at lists.sourceforge.net</a></li>
     <li><a href="http://sourceforge.net/mail/?group_id=23067">Mailing lists overview</a></li>
 </ul>
diff --git a/templates/translations.tpl b/templates/translations.tpl
index 3dc0d49..2203021 100644
--- a/templates/translations.tpl
+++ b/templates/translations.tpl
@@ -6,23 +6,21 @@
 <h2>Translations</h2>
 
 <p>
-Translations inside phpMyAdmin are in various states. The ones that have less
-than 80% translated strings are shown in dark red, the ones below 50% in more
-intensive red (those are considered orphaned and the phpMyAdmin project would
-appreciate any help in updating them). Translators contacts are available on
-our <a href="http://www.phpmyadmin.net/documentation/translators.html">translators
-list</a>.
-</p>
-<p>
-If you want to help improving a translation, please follow intructions on <a
-href="${base_url}improve.${file_ext}#translate">how to improve page</a>.
+Translations of phpMyAdmin are handled using Gettext. It is used for both
+translating phpMyAdmin as well as the documentation (where Po4a is being
+used).
 </p>
+
 <p>
-Documentation translation is kept separately, you can see it's summary on our
-<a href="https://l10n.cihar.com/projects/pmadoc/">translation server</a>.
+You are welcome to contribute to any translations, you can follow instructions
+on <a href="${base_url}improve.${file_ext}#translate">how to improve page</a>.
+Or simply go to the <a href="https://l10n.cihar.com/">translation server</a>
+and translate there projects <a
+href="https://l10n.cihar.com/projects/phpmyadmin/">phpMyAdmin</a> or <a
+href="https://l10n.cihar.com/projects/pmadoc/">phpMyAdmin documentation</a>.
+The translation server also provides you overview of translation status.
 </p>
 
-
 <table class="graph sortable" id="sorttable">
 <thead>
 <tr>


hooks/post-receive
-- 
phpMyAdmin website




More information about the Git mailing list