diff --git a/manga_translator/__main__.py b/manga_translator/__main__.py index 43a5ca863..552c6935d 100644 --- a/manga_translator/__main__.py +++ b/manga_translator/__main__.py @@ -52,19 +52,16 @@ async def dispatch(args: Namespace): else: # batch dest = args.dest for path in natural_sort(args.input): - try : # Apply pre-translation dictionaries - await translator.translate_path(path, dest, args_dict) - for textline in translator.textlines: - textline.text = translator.apply_dictionary(textline.text, pre_dict) - logger.info(f'Pre-translation dictionary applied: {textline.text}') + await translator.translate_path(path, dest, args_dict) + for textline in translator.textlines: + textline.text = apply_dictionary(textline.text, pre_dict) + logger.info(f'Pre-translation dictionary applied: {textline.text}') # Apply post-translation dictionaries - for textline in translator.textlines: - textline.translation = translator.apply_dictionary(textline.translation, post_dict) - logger.info(f'Post-translation dictionary applied: {textline.translation}') - except Exception : - pass + for textline in translator.textlines: + textline.translation = apply_dictionary(textline.translation, post_dict) + logger.info(f'Post-translation dictionary applied: {textline.translation}') elif args.mode == 'ws': from manga_translator.mode.ws import MangaTranslatorWS diff --git a/manga_translator/mode/local.py b/manga_translator/mode/local.py index 384e7f1fe..12d2bd460 100644 --- a/manga_translator/mode/local.py +++ b/manga_translator/mode/local.py @@ -16,6 +16,7 @@ class MangaTranslatorLocal(MangaTranslator): def __init__(self, params: dict = None): super().__init__(params) + self.textlines = [] self.attempts = params.get('attempts', None) self.skip_no_text = params.get('skip_no_text', False) self.text_output_file = params.get('text_output_file', None)