diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 12:06:34 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2015-02-02 12:06:34 +0100 |
| commit | fe02dbcfb22bef26c0490d826ed29b49551a3cdf (patch) | |
| tree | 656c1a6ed4b68ab8f1425340602a1a6aa0948bc5 | |
| parent | 54ac8c440b6191f09a46544ca7c5b0b09d5c7ecd (diff) | |
| download | jasper-client-fe02dbcfb22bef26c0490d826ed29b49551a3cdf.tar.gz jasper-client-fe02dbcfb22bef26c0490d826ed29b49551a3cdf.zip | |
add language config option
| -rwxr-xr-x | jasper.py | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1,6 +1,9 @@ #!/usr/bin/env python2 # -*- coding: utf-8-*- +# add additional translations here +LANGUAGES = ['de_DE'] + import os import sys import shutil @@ -11,9 +14,6 @@ import argparse import locale import gettext -locale.setlocale(locale.LC_ALL, '') -langs = gettext.translation('messages', localedir='./languages', languages=['de_DE']) -langs.install() from client import tts, stt, jasperpath, diagnose @@ -86,6 +86,13 @@ class Jasper(object): self._logger.error("Can't open config file: '%s'", new_configfile) raise + if 'lang' in self.config: + locale.setlocale(locale.LC_ALL, self.config['lang']) + else: + locale.setlocale(locale.LC_ALL, '') + _langs = gettext.translation('messages', localedir='./languages', languages=LANGUAGES) + _langs.install() + try: stt_engine_slug = self.config['stt_engine'] except KeyError: |
