Fixed translation of misc module

This commit is contained in:
Frisk 2019-05-20 21:01:45 +02:00
parent 8f8db6297d
commit b4f821cd3f
No known key found for this signature in database
GPG key ID: 0E9A7D3C0A01586C
2 changed files with 8 additions and 5 deletions

View file

@ -19,6 +19,11 @@
import json, logging, sys, re import json, logging, sys, re
from html.parser import HTMLParser from html.parser import HTMLParser
from configloader import settings from configloader import settings
import gettext
# Initialize translation
t = gettext.translation('misc', localedir='locale', languages=[settings["lang"]])
_ = t.gettext
# Create a custom logger # Create a custom logger

View file

@ -21,11 +21,14 @@
# You have been warned # You have been warned
import time, logging.config, json, requests, datetime, re, gettext, math, random, os.path, schedule, sys, ipaddress import time, logging.config, json, requests, datetime, re, gettext, math, random, os.path, schedule, sys, ipaddress
import misc
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
from collections import defaultdict, Counter from collections import defaultdict, Counter
from urllib.parse import quote_plus from urllib.parse import quote_plus
from html.parser import HTMLParser from html.parser import HTMLParser
from configloader import settings from configloader import settings
from misc import link_formatter
from misc import ContentParser
if __name__ != "__main__": # return if called as a module 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.") 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() lang.install()
ngettext = lang.ngettext ngettext = lang.ngettext
import misc
from misc import link_formatter
from misc import ContentParser
storage = misc.load_datafile() storage = misc.load_datafile()
# Remove previous data holding file if exists and limitfetch allows # Remove previous data holding file if exists and limitfetch allows