Giter Club home page Giter Club logo

df-translation-client's People

Contributors

annipak avatar dependabot[bot] avatar insolor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

df-translation-client's Issues

Encoding error in tab "Translate external text files"

Hi,
Win 10 Pro.
pip 21.0.1 from c:\users\Gotrek\appdata\local\programs\python\python38-32\lib\site-packages\pip (python 3.8)

I got another error and I am not sure if it is program bug or I have somehow corrupted/broken python

  1. start program
  2. on 3rd tab choose required fields
  3. download files from transifex (Czech lang but I got same error with English files also)
  4. Search button works perfectly but Translate button throw error. See screens and details. I got error for both encoding. cp852 and cp1250

cp852

e:\NET\__DwarfFotress_translate\translate_client\df-translation-client-develop>python df-translate.pyw
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Gotrek\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "e:\NET\__DwarfFotress_translate\translate_client\df-translation-client-develop\frames\frame_translate_external_files.py", line 189, in <lambda>
    ttk.Button(self, text='Translate', command=lambda: self.bt_search(translate=True)).grid(row=5, column=1)
  File "e:\NET\__DwarfFotress_translate\translate_client\df-translation-client-develop\frames\frame_translate_external_files.py", line 129, in bt_search
    for filename in func(po_file_path, cur_dir, self.combo_encoding.get()):
  File "C:\Users\Gotrek\AppData\Local\Programs\Python\Python38-32\lib\site-packages\df_gettext_toolkit\translate_plain_text.py", line 34, in translate_plain_text
    print(translation, file=dest)
  File "C:\Users\Gotrek\AppData\Local\Programs\Python\Python38-32\lib\encodings\cp852.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 61-62: character maps to <undefined>

image

Here is my cp852.py file. Just rename it. I couldn't upload directly python file:
cp852.txt


Same error for second available encoding
cp1250

e:\NET\__DwarfFotress_translate\translate_client\df-translation-client-develop>python df-translate.pyw
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Gotrek\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883, in __call__
    return self.func(*args)
  File "e:\NET\__DwarfFotress_translate\translate_client\df-translation-client-develop\frames\frame_translate_external_files.py", line 189, in <lambda>
    ttk.Button(self, text='Translate', command=lambda: self.bt_search(translate=True)).grid(row=5, column=1)
  File "e:\NET\__DwarfFotress_translate\translate_client\df-translation-client-develop\frames\frame_translate_external_files.py", line 129, in bt_search
    for filename in func(po_file_path, cur_dir, self.combo_encoding.get()):
  File "C:\Users\Gotrek\AppData\Local\Programs\Python\Python38-32\lib\site-packages\df_gettext_toolkit\translate_plain_text.py", line 34, in translate_plain_text
    print(translation, file=dest)
  File "C:\Users\Gotrek\AppData\Local\Programs\Python\Python38-32\lib\encodings\cp1250.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 61-62: character maps to <undefined>

image

My cp1250.py file, rename from txt to .py
cp1250.txt

No Transifex login anymore

Hey ho, the newest Update broke the Login to Transifex. It does not show up anymore in the Client.
image

You cant select Transifex anymore.

Thank you in advance.

Reuse code from df_gettext_toolkit/translate_raws_batch

The following code from frame_translate_external_files.py

for cur_dir in base_path.rglob("*"):
if cur_dir.is_dir():
for pattern in patterns:
if cur_dir.match("*/" + pattern):
self.listbox_found_directories.append(f"Matched {pattern!r} pattern")
base_name = patterns[pattern]["po_filename"]
postfix = self.combo_language.text
po_filename = f"{base_name}_{postfix}.po"
po_file_path = po_directory / po_filename
if not po_file_path.exists() or po_file_path.is_dir():
messagebox.showerror(title="error",
message=f"File {po_filename} doesn't exist or it is a directory")
return
if translate:
func = patterns[pattern]["func"]
for filename in func(po_file_path, cur_dir, self.combo_encoding.get()):
# print(filename, file=sys.stderr)
self.listbox_found_directories.append(filename)

is nearly identical to the code from https://github.com/dfint/df-gettext-toolkit/blob/develop/df_gettext_toolkit/translate_raws_batch.py.:

https://github.com/dfint/df-gettext-toolkit/blob/28857f52f7d7c6bb7e035d69b67ea9cee142a104/df_gettext_toolkit/translate_raws_batch.py#L32-L49

We need to reuse the code from translate_raws_batch.py instead

Translation is corrupted or incorrect

Hey, maybe my friend and me are to stupid to translate the game correctly.
Some words are translated and most of it not.
Do you have any idea why that happens and how to fix that?

Steps we do.

We tried to use the 64 and 32Bit Version of the game V47_05 also tried older versions 43_05...

  1. Download latest .po file from Transifex manualy. I change a translation for some words and want to see them translated ingame.
  2. Replace the for example "hardcoded_de.po" file with the new manualy download from Transifex.
  3. Patch the Game with the Codec cp850
  4. Translate the Game with the same codec.
    image
  5. Press search and Translate
  6. Start the game go ingame and see that the words we translated on transifex are not tranlated. Some words are some not.
    Do you have any idea why that happens and how to fix that?
    image

Can't run df-translate

Run df-translate.pwy from python:

Traceback (most recent call last):
  File ".\df-translate.pyw", line 76, in <module>
    App(noconfig='--noconfig' in sys.argv, debug='--debug' in sys.argv).mainloop()
  File ".\df-translate.pyw", line 66, in __init__
    notebook.add(TranslateExternalFiles(notebook, self.config),
  File "D:\Documents\DF\df-translation-client\frame_translate_external_files.py", line 156, in __init__
    self.update_combo_encoding()
  File "D:\Documents\DF\df-translation-client\frame_translate_external_files.py", line 72, in update_combo_encoding
    self.combo_encoding.current(0)
  File "C:\Users\User.ARX-MAD-D014\AppData\Local\Programs\Python\Python37-32\lib\tkinter\ttk.py", line 719, in current
    return self.tk.call(self._w, "current", newindex)
_tkinter.TclError: Index 0 out of range

AttributeError: 'WindowsPath' object has no attribute 'is_relative_to'

Win 10 Pro.
pip 21.0.1 from c:\users\User\appdata\local\programs\python\python38-32\lib\site-packages\pip (python 3.8)

Just start program. Set paths and press search or translate.

E:\NET_DwarfFotress_translate\translate_client\df-translation-client-develop>python df-translate.pyw
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python38-32\lib\tkinter_init
.py", line 1883, in call
return self.func(*args)
File "E:\NET__DwarfFotress_translate\translate_client\df-translation-client-develop\frames\frame_translate_external_files.py", line 189, in
ttk.Button(self, text='Translate', command=lambda: self.bt_search(translate=True)).grid(row=5, column=1)
File "E:\NET__DwarfFotress_translate\translate_client\df-translation-client-develop\frames\frame_translate_external_files.py", line 108, in bt_search
if cur_dir.is_dir() and not cur_dir.is_relative_to(f'{base_path}/Lib'):
AttributeError: 'WindowsPath' object has no attribute 'is_relative_to'

error line:
if cur_dir.is_dir() and not cur_dir.is_relative_to(f'{base_path}/Lib'):

it was enough to delete and not cur_dir.is_relative_to(f'{base_path}/Lib') for me but I don't think that it is correct fix :-)

error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.