theNicelander / ck3_ml_translator

5 stars 4 forks source link

I can't translate #2

Open MikelGi opened 2 years ago

MikelGi commented 2 years ago

I get stuck at this point and can't get it to start translating, what am I doing wrong?

C:\Users\Admin\Desktop\ck3_ml_translator-main>python app.py Translating localization/english.gitkeep -> localization/french.gitkeep Traceback (most recent call last): File "C:\Users\Admin\Desktop\ck3_ml_translator-main\app.py", line 8, in ck3_translator.translate_folder("localization/english", language) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 90, in translate_folder self.translate_document(file_path, target_lang) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 80, in translate_document translated = self._translate_yaml(my_yaml, target_lang) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 34, in _translate_yaml source = totranslate[f"l{self.source_lang}"] TypeError: 'NoneType' object is not subscriptable

MikelGi commented 2 years ago

It Works! thank u Nicelander! must remove .gitkeep archive python3 -m venv venv in windows i have to use --> venv\Scripts\activate pip install -r requirements.txt

thanks again!

MikelGi commented 2 years ago

43%|███████████████████████████████████████ | 92/214 [03:56<05:14, 2.57s/it] Traceback (most recent call last): File "C:\Users\Admin\Desktop\ck3_ml_translator-main\app.py", line 8, in ck3_translator.translate_folder("localization/english", language) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 90, in translate_folder self.translate_document(file_path, target_lang) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 80, in translate_document translated = self._translate_yaml(my_yaml, target_lang) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 39, in _translate_yaml translation = self._translate_text(cleaned_text, target_lang) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\ck3_translator\ck3_translator.py", line 30, in _translate_text trans = self.translator.translate(text, src=self.source_lang, dest=target_lang) File "C:\Users\Admin\Desktop\ck3_ml_translator-main\venv\lib\site-packages\googletrans\client.py", line 222, in translate translated_parts = list(map(lambda part: TranslatedPart(part[0], part[1] if len(part) >= 2 else []), parsed[1][0][0][5])) TypeError: 'NoneType' object is not iterable

:(