From b4f821cd3f155dc16dbd8aeab0329574fca26813 Mon Sep 17 00:00:00 2001 From: Frisk Date: Mon, 20 May 2019 21:01:45 +0200 Subject: [PATCH] Fixed translation of misc module --- misc.py | 5 +++++ rcgcdw.py | 8 +++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/misc.py b/misc.py index 4ec2511..6fd1c66 100644 --- a/misc.py +++ b/misc.py @@ -19,6 +19,11 @@ import json, logging, sys, re from html.parser import HTMLParser from configloader import settings +import gettext + +# Initialize translation +t = gettext.translation('misc', localedir='locale', languages=[settings["lang"]]) +_ = t.gettext # Create a custom logger diff --git a/rcgcdw.py b/rcgcdw.py index c5e295b..682975f 100644 --- a/rcgcdw.py +++ b/rcgcdw.py @@ -21,11 +21,14 @@ # You have been warned import time, logging.config, json, requests, datetime, re, gettext, math, random, os.path, schedule, sys, ipaddress +import misc from bs4 import BeautifulSoup from collections import defaultdict, Counter from urllib.parse import quote_plus from html.parser import HTMLParser from configloader import settings +from misc import link_formatter +from misc import ContentParser if __name__ != "__main__": # return if called as a module logging.critical("The file is being executed as a module. Please execute the script using the console.") @@ -50,11 +53,6 @@ except FileNotFoundError: lang.install() ngettext = lang.ngettext -import misc - -from misc import link_formatter -from misc import ContentParser - storage = misc.load_datafile() # Remove previous data holding file if exists and limitfetch allows