You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When switching to Simplified Chinese, clicking 'Show me Details' throws an error: 'list' object has no attribute 'split', which prevents opening the info.
#212
Open
MatthewHA233 opened this issue
Oct 17, 2024
· 1 comment
I modified the init.py file and made changes to the def get_pokemon_descriptions(species_id) function, successfully resolving the issue: 'Error occurred in Pokemon Details Button: 'list' object has no attribute 'split'. init .py.txt def get_pokemon_descriptions(species_id): global language descriptions = [] # Initialize an empty list to store matching descriptions with open(pokedesc_lang_path, mode='r', encoding='utf-8') as csv_file: csv_reader = csv.DictReader(csv_file) for row in csv_reader: if int(row['species_id']) == species_id and int(row['language_id']) == language: # Replace control characters for readability, if necessary flavor_text = row['flavor_text'].replace('\x0c', ' ') descriptions.append(flavor_text) # Add the matching description to the list if descriptions: if len(descriptions) > 1: return random.choice(descriptions) # Return a random choice else: return descriptions[0] # Return the single description as a string else: return "Description not found." # Return a string directly
The text was updated successfully, but these errors were encountered:
I modified the init.py file and made changes to the def get_pokemon_descriptions(species_id) function, successfully resolving the issue: 'Error occurred in Pokemon Details Button: 'list' object has no attribute 'split'.
init .py.txt
def get_pokemon_descriptions(species_id): global language descriptions = [] # Initialize an empty list to store matching descriptions with open(pokedesc_lang_path, mode='r', encoding='utf-8') as csv_file: csv_reader = csv.DictReader(csv_file) for row in csv_reader: if int(row['species_id']) == species_id and int(row['language_id']) == language: # Replace control characters for readability, if necessary flavor_text = row['flavor_text'].replace('\x0c', ' ') descriptions.append(flavor_text) # Add the matching description to the list if descriptions: if len(descriptions) > 1: return random.choice(descriptions) # Return a random choice else: return descriptions[0] # Return the single description as a string else: return "Description not found." # Return a string directly
The text was updated successfully, but these errors were encountered: