3030 from babel .messages .frontend import compile_catalog as _compile_catalog
3131 from babel .messages .frontend import extract_messages
3232
33- translations_dir = os .path .join (package_dir , 'translations' )
33+ translations_dir = os .path .join (package_dir , 'translations' , '' )
3434
3535 class compile_catalog (_compile_catalog ):
3636 def initialize_options (self ):
@@ -59,6 +59,23 @@ def initialize_options(self):
5959 cmdclass ['compile_catalog' ] = compile_catalog
6060 cmdclass ['extract_messages' ] = extract_messages
6161
62+ data_files = [
63+ # man pages
64+ (os .path .join (man_dir , 'man1' ), ['doc/bpython.1' ]),
65+ (os .path .join (man_dir , 'man5' ), ['doc/bpython-config.5' ]),
66+ # desktop shorcut
67+ (os .path .join ('share' , 'applications' ), ['data/bpython.desktop' ])]
68+ # translations
69+ if using_translations :
70+ for language in os .listdir (translations_dir ):
71+ if not (fnmatch (language , '[a-z][a-z]_[A-Z][A-Z]' ) or
72+ fnmatch (language , '[a-z][a-z' ) or
73+ os .path .isdir (language )):
74+ continue
75+ data_files .append (('bpython/translations/' + language + '/LC_MESSAGES/' ,
76+ ['bpython/translations/' + language + '/LC_MESSAGES/' + 'bpython.mo' ]))
77+
78+
6279setup (
6380 name = "bpython" ,
6481 version = __version__ ,
@@ -73,15 +90,9 @@ def initialize_options(self):
7390 'pygments'
7491 ],
7592 packages = ["bpython" , "bpython.translations" , "bpdb" ],
76- data_files = [
77- # man pages
78- (os .path .join (man_dir , 'man1' ), ['doc/bpython.1' ]),
79- (os .path .join (man_dir , 'man5' ), ['doc/bpython-config.5' ]),
80- # desktop shorcut
81- (os .path .join ('share' , 'applications' ), ['data/bpython.desktop' ])],
93+ data_files = data_files ,
8294 package_data = {
83- 'bpython' : ['logo.png' ],
84- 'bpython.translations' : ['bpython/transaltions/*.mo' ]},
95+ 'bpython' : ['logo.png' ]},
8596 entry_points = {
8697 'console_scripts' : [
8798 'bpython = bpython.cli:main' ,
0 commit comments