|
10 | 10 | from setuptools.command.install import install as _install |
11 | 11 |
|
12 | 12 | try: |
13 | | - from babel.messages.frontend import compile_catalog as _compile_catalog |
14 | | - from babel.messages.frontend import extract_messages as _extract_messages |
15 | | - from babel.messages.frontend import update_catalog as _update_catalog |
16 | | - from babel.messages.frontend import init_catalog as _init_catalog |
| 13 | + from babel.messages import frontend as babel |
17 | 14 |
|
18 | 15 | using_translations = True |
19 | 16 | except ImportError: |
@@ -136,52 +133,12 @@ def run(self): |
136 | 133 |
|
137 | 134 | # localization options |
138 | 135 | if using_translations: |
139 | | - |
140 | | - class compile_catalog(_compile_catalog): |
141 | | - def initialize_options(self): |
142 | | - """Simply set default domain and directory attributes to the |
143 | | - correct path for bpython.""" |
144 | | - _compile_catalog.initialize_options(self) |
145 | | - |
146 | | - self.domain = "bpython" |
147 | | - self.directory = translations_dir |
148 | | - self.use_fuzzy = True |
149 | | - |
150 | | - class update_catalog(_update_catalog): |
151 | | - def initialize_options(self): |
152 | | - """Simply set default domain and directory attributes to the |
153 | | - correct path for bpython.""" |
154 | | - _update_catalog.initialize_options(self) |
155 | | - |
156 | | - self.domain = "bpython" |
157 | | - self.output_dir = translations_dir |
158 | | - self.input_file = os.path.join(translations_dir, "bpython.pot") |
159 | | - |
160 | | - class extract_messages(_extract_messages): |
161 | | - def initialize_options(self): |
162 | | - """Simply set default domain and output file attributes to the |
163 | | - correct values for bpython.""" |
164 | | - _extract_messages.initialize_options(self) |
165 | | - |
166 | | - self.domain = "bpython" |
167 | | - self.output_file = os.path.join(translations_dir, "bpython.pot") |
168 | | - |
169 | | - class init_catalog(_init_catalog): |
170 | | - def initialize_options(self): |
171 | | - """Simply set default domain, input file and output directory |
172 | | - attributes to the correct values for bpython.""" |
173 | | - _init_catalog.initialize_options(self) |
174 | | - |
175 | | - self.domain = "bpython" |
176 | | - self.output_dir = translations_dir |
177 | | - self.input_file = os.path.join(translations_dir, "bpython.pot") |
178 | | - |
179 | 136 | build.sub_commands.insert(0, ("compile_catalog", None)) |
180 | 137 |
|
181 | | - cmdclass["compile_catalog"] = compile_catalog |
182 | | - cmdclass["extract_messages"] = extract_messages |
183 | | - cmdclass["update_catalog"] = update_catalog |
184 | | - cmdclass["init_catalog"] = init_catalog |
| 138 | + cmdclass["compile_catalog"] = babel.compile_catalog |
| 139 | + cmdclass["extract_messages"] = babel.extract_messages |
| 140 | + cmdclass["update_catalog"] = babel.update_catalog |
| 141 | + cmdclass["init_catalog"] = babel.init_catalog |
185 | 142 |
|
186 | 143 | if using_sphinx: |
187 | 144 |
|
|
0 commit comments