diff --git a/linkcheck/__init__.py b/linkcheck/__init__.py index 573d6bcf..b342f80a 100644 --- a/linkcheck/__init__.py +++ b/linkcheck/__init__.py @@ -74,7 +74,7 @@ def get_link_pat(arg, strict=False): @rtype: dict @raises: re.error on invalid regular expressions """ - log.debug(LOG_CHECK, "Link pattern %r strict=%s", arg, strict) + log.debug(LOG_CHECK, _("Link pattern %r strict=%s"), arg, strict) if arg.startswith('!'): pattern = arg[1:] negate = True @@ -84,7 +84,7 @@ def get_link_pat(arg, strict=False): try: regex = re.compile(pattern) except re.error as msg: - log.warn(LOG_CHECK, "invalid regular expression %r: %s" % (pattern, msg)) + log.warn(LOG_CHECK, _("invalid regular expression %r: %s"), pattern, msg) raise return { "pattern": regex, diff --git a/linkcheck/lc_cgi.py b/linkcheck/lc_cgi.py index 5cc88b66..a3820f16 100644 --- a/linkcheck/lc_cgi.py +++ b/linkcheck/lc_cgi.py @@ -212,7 +212,7 @@ def checkform(form, env): locale.setlocale(locale.LC_ALL, localestr) init_i18n() except locale.Error as errmsg: - log(env, "could not set locale %r: %s" % (localestr, errmsg)) + log(env, _("could not set locale %r: %s") % (localestr, errmsg)) else: raise LCFormError(_("unsupported language %r") % lang) # check url syntax diff --git a/linkcheck/loader.py b/linkcheck/loader.py index 02f52ac7..ecf5853e 100644 --- a/linkcheck/loader.py +++ b/linkcheck/loader.py @@ -37,7 +37,7 @@ def get_package_modules(packagename, packagepath): name = "..%s.%s" % (packagename, mod.name) yield importlib.import_module(name, __name__) except ImportError as msg: - print("WARN: could not load module %s: %s" % (mod.name, msg)) + print(_("WARN: could not load module %s: %s") % (mod.name, msg)) def get_folder_modules(folder, parentpackage): @@ -54,7 +54,7 @@ def get_folder_modules(folder, parentpackage): spec.loader.exec_module(module) yield module except ImportError as msg: - print("WARN: could not load file %s: %s" % (fullname, msg)) + print(_("WARN: could not load file %s: %s") % (fullname, msg)) def get_importable_files(folder): diff --git a/linkcheck/plugins/markdowncheck.py b/linkcheck/plugins/markdowncheck.py index 7c01f054..0a05415b 100644 --- a/linkcheck/plugins/markdowncheck.py +++ b/linkcheck/plugins/markdowncheck.py @@ -85,7 +85,7 @@ class MarkdownCheck(_ContentPlugin): try: self.filename_re = re.compile(pattern) except re.error as msg: - log.warn(LOG_PLUGIN, "Invalid regex pattern %r: %s" % (pattern, msg)) + log.warn(LOG_PLUGIN, _("Invalid regex pattern %r: %s"), pattern, msg) @classmethod def read_config(cls, configparser): diff --git a/linkcheck/plugins/regexcheck.py b/linkcheck/plugins/regexcheck.py index 6b0dc3d6..43ef498b 100644 --- a/linkcheck/plugins/regexcheck.py +++ b/linkcheck/plugins/regexcheck.py @@ -42,7 +42,7 @@ class RegexCheck(_ContentPlugin): try: self.warningregex = re.compile(pattern) except re.error as msg: - log.warn(LOG_PLUGIN, "Invalid regex pattern %r: %s" % (pattern, msg)) + log.warn(LOG_PLUGIN, _("Invalid regex pattern %r: %s"), pattern, msg) def applies_to(self, url_data): """Check for warningregex, extern flag and parseability."""