From 281f66c7c1d5fb8154f1e909bba0cb1d13a31d73 Mon Sep 17 00:00:00 2001 From: A_D Date: Tue, 5 Jan 2021 17:42:13 +0200 Subject: [PATCH] Stringified plugin_dir for len check --- l10n.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n.py b/l10n.py index 404dfc69..6b9b1494 100755 --- a/l10n.py +++ b/l10n.py @@ -159,7 +159,8 @@ class _Translations: :return: The translated string """ if context: - context = context[len(config.plugin_dir)+1:].split(os.sep)[0] + # TODO: There is probably a better way to go about this now. + context = context[len(str(config.plugin_dir))+1:].split(os.sep)[0] if self.translations[None] and context not in self.translations: logger.debug(f'No translations for {context!r}')