From 489aec0a4ba7626fbe7dbc7b63cfb327dc2bd8f2 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Wed, 3 Oct 2018 18:59:17 +0200 Subject: [PATCH] help translation support --- lib/globals.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/globals.py b/lib/globals.py index 879ea3a..41eca29 100644 --- a/lib/globals.py +++ b/lib/globals.py @@ -17,6 +17,9 @@ BLACKLIST = os.path.join( MYDIR, "share/blacklist" ) HELP_FILE = os.path.join( MYDIR, 'share/help.txt' ) BASH_FUNCTION_FILE = os.path.join( MYDIR, 'share/bash-function.txt' ) TRANSLATION_FILE = os.path.join( MYDIR, 'share/translation.txt' ) +TEST_FILE = os.path.join( MYDIR, 'share/test-NAME.txt' ) + +IATA_CODES_FILE = os.path.join(MYDIR, 'share/list-of-iata-codes.txt') LOG_FILE = os.path.join( MYDIR, 'log/main.log' ) TEMPLATES = os.path.join( MYDIR, 'share/templates' ) @@ -38,4 +41,11 @@ def log(text): print text logging.info(text) +def get_help_file(lang): + help_file = os.path.join(MYDIR, 'share/translations/%s-help.txt' % lang) + print ">>>", help_file + if os.path.exists(help_file): + return help_file + else: + return HELP_FILE