olimorris / pyscoutfm

:telescope: Use the power of Python to traverse the cosmos and scout for players within the Football Manager game
MIT License
17 stars 1 forks source link

Issues with other Languagers then English #9

Open Shazgul opened 1 month ago

Shazgul commented 1 month ago

Hey Guys!

What about Multi-Language Support? I saw it struggles with finding the right coloumns if you don't use English as Game Language.

│ │ │ C:\Users\kevin\AppData\Local\Programs\Python\Python312\Lib\site-packages\pandas\core\indexes\bas │ │ e.py:3812 in get_loc │ │ │ │ 3809 │ │ │ │ and any(isinstance(x, slice) for x in casted_key) │ │ 3810 │ │ │ ): │ │ 3811 │ │ │ │ raise InvalidIndexError(key) │ │ ❱ 3812 │ │ │ raise KeyError(key) from err │ │ 3813 │ │ except TypeError: │ │ 3814 │ │ │ # If we have a listlike key, _check_indexing_error will raise │ │ 3815 │ │ │ # InvalidIndexError. Otherwise we fall through and re-raise │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ casted_key = 'Left Foot' │ │ │ │ key = 'Left Foot' │ │ │ │ self = Index(['Mel', 'Info', 'Name', 'Alter', 'Gehalt', 'Transferwert', 'Nation', │ │ │ │ │ '2. Nation', 'Position', 'Persönlichkeit', 'Medienumgang', 'Ø Note', │ │ │ │ │ 'Linker Fuß', 'Rechter Fuß', 'Größe', 'Eck', 'Fla', 'Dri', 'Abs', 'Ann', │ │ │ │ │ 'Fre', 'Kpf', 'WS', 'Einw', 'Dck', 'Pas', 'Tck', 'Elf', 'Tec', 'Agg', │ │ │ │ │ 'Azp', 'Mut', 'Ner', 'Kon', 'Ent', 'Zie', 'Flr', 'Füh', 'Ohn', 'Ste', │ │ │ │ │ 'Tea', 'Übs', 'Esf', 'Ant', 'Bew', 'Bal', 'Spr', 'Gft', 'Sch', 'Aus', │ │ │ │ │ 'Kra', 'HB', 'StK', 'Kom', 'Exz', 'Hal', 'Abs.1', '1v1', 'Fau', 'Ref', │ │ │ │ │ 'TzH', 'Abw', 'EID', 'Verein'], │ │ │ │ │ dtype='object') │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ KeyError: 'Left Foot'

olimorris commented 1 month ago

Yep I suspect this is a shortcoming. Totally up for a PR to fix this.

I don't plan on playing FM24 and am expecting to rewrite this before I pick up FM25