changeset 300:d2950f2ad2f6 stable-0.9.x

Ported [328:333] back to 0.9.x stable branch.
author cmlenz
date Tue, 18 Dec 2007 15:21:31 +0000
parents 927a8a97330f
children 2912cdc2730a
files babel/messages/frontend.py babel/messages/plurals.py
diffstat 2 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/babel/messages/frontend.py
+++ b/babel/messages/frontend.py
@@ -19,6 +19,7 @@
 from distutils import log
 from distutils.cmd import Command
 from distutils.errors import DistutilsOptionError, DistutilsSetupError
+from locale import getpreferredencoding
 import logging
 from optparse import OptionParser
 import os
@@ -632,7 +633,9 @@
             for identifier in localedata.list():
                 locale = Locale.parse(identifier)
                 output = format % (identifier, locale.english_name)
-                print output.encode(sys.stdout.encoding or 'ascii', 'replace')
+                print output.encode(sys.stdout.encoding or
+                                    getpreferredencoding() or
+                                    'ascii', 'replace')
             return 0
 
         if not args:
--- a/babel/messages/plurals.py
+++ b/babel/messages/plurals.py
@@ -22,6 +22,8 @@
     'bg': (2, '(n != 1)'),
     # Bengali - From Pootle's PO's
     'bn': (2, '(n != 1)'),
+    # Tibetan - as discussed in private with Andrew West
+    'bo': (1, '0'),
     # Catalan - From Pootle's PO's
     'ca': (2, '(n != 1)'),
     # Czech
@@ -48,11 +50,11 @@
     'fi': (2, '(n != 1)'),
     # French
     'fr': (2, '(n > 1)'),
-    # Furlan - From Pootle's PO's
+    # Friulian - From Pootle's PO's
     'fur': (2, '(n > 1)'),
     # Irish
     'ga': (3, 'n==1 ? 0 : n==2 ? 1 : 2'),
-    # Galego - From Pootle's PO's
+    # Galician - From Pootle's PO's
     'gl': (2, '(n != 1)'),
     # Hausa - From Pootle's PO's
     'ha': (2, '(n != 1)'), 
@@ -80,7 +82,7 @@
     'km': (1, '0'),
     # Korean
     'ko': (1, '0'),
-    # Kurdî - From Pootle's PO's
+    # Kurdish - From Pootle's PO's
     'ku': (2, '(n != 1)'),
     # Lithuanian
     'lt': (3, '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2)'),
@@ -88,7 +90,7 @@
     'lv': (3, '(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2)'),
     # Maltese - From Pootle's PO's
     'mt': (4, '(n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3)'),
-    # Norwegian Bokmal
+    # Norwegian Bokmål
     'nb': (2, '(n != 1)'),
     # Dutch
     'nl': (2, '(n != 1)'),
@@ -114,10 +116,12 @@
     'sl': (4, '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)'),
     # Serbian - From Pootle's PO's
     'sr': (3, '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10< =4 && (n%100<10 || n%100>=20) ? 1 : 2)'),
-    # Sesotho - From Pootle's PO's
+    # Southern Sotho - From Pootle's PO's
     'st': (2, '(n != 1)'),
     # Swedish
     'sv': (2, '(n != 1)'),
+    # Thai
+    'th': (1, '0'),
     # Turkish
     'tr': (1, '0'),
     # Ukrainian
Copyright (C) 2012-2017 Edgewall Software