fix: icon store page(s) showing error by axolotlmaid · Pull Request #179 · StreamController/StreamController · GitHub
Skip to content

fix: icon store page(s) showing error#179

Merged
Core447 merged 5 commits into
StreamController:mainfrom
axolotlmaid:patch-1
Jul 19, 2024
Merged

fix: icon store page(s) showing error#179
Core447 merged 5 commits into
StreamController:mainfrom
axolotlmaid:patch-1

Conversation

@axolotlmaid

Copy link
Copy Markdown
Contributor

The description variable is returning a dict type. An example of the dict is below:

{'en_US': 'Unofficial - Material Icons designed by Google.'}

This pull request changes the code to set the label to the user's locale from the dictionary, if it is found.

I also added a fallback because in the plugins tab of the store it returns a string instead of a dict.

@Core447

Core447 commented Jul 19, 2024

Copy link
Copy Markdown
Member

@axolotlmaid

Copy link
Copy Markdown
Contributor Author

Thank you! However, the description should already get translated by the following lines:

translated_description = gl.lm.get_custom_translation(manifest.get("descriptions", {}))
translated_short_description = gl.lm.get_custom_translation(manifest.get("short-descriptions", {}))

and

self.plugin_page.info_page.set_description(gl.lm.get_custom_translation(self.plugin_data.descriptions))

Maybe I'm overlooking something, if so, please let me know

self.icon_page.info_page.set_description(self.icon_data.descriptions)

It seems like you forgot to update this for IconPage.py. This actually makes the fix a lot more easier by changing only one line which you can find in the new commit.

@axolotlmaid axolotlmaid changed the title fix: store info page(s) showing error fix: icon store page(s) showing error Jul 19, 2024
@Core447

Core447 commented Jul 19, 2024

Copy link
Copy Markdown
Member

We can even use the pre-translated variable description of the data (see d2be101 and 5881840).

@Core447 Core447 merged commit 2c6eee8 into StreamController:main Jul 19, 2024
@Core447

Core447 commented Jul 19, 2024

Copy link
Copy Markdown
Member

@axolotlmaid axolotlmaid deleted the patch-1 branch July 19, 2024 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

2 participants