Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conpoment props`s value show not correct in pages when the value is not in English #626

Merged
merged 2 commits into from Mar 4, 2023

Conversation

DeathShort
Copy link
Contributor

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

a. Give a descriptive title to your PR.
Fix issue #282 .This issue is caused by pynecone.components.tags.tag ,when format the props, the json.dumps function use ascii encode as default. 

b. Describe your changes.
The solution is add 'ensure_ascii=False' in every case of json.dumps uses.
c. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

…,when format the props, the json.dumps function use ascii encode as default. The solution is add 'ensure_ascii=False' in every case of json.dumps uses.
@DeathShort DeathShort changed the title Fix #282.The bug is caused by pynecone.components.tags.tag ,when form… Fix #282.The issue is caused by pynecone.components.tags.tag ,when form… Mar 3, 2023
@DeathShort DeathShort changed the title Fix #282.The issue is caused by pynecone.components.tags.tag ,when form… Fix conpoment props`s value show not correct in pages when not in English Mar 3, 2023
@DeathShort DeathShort changed the title Fix conpoment props`s value show not correct in pages when not in English Fix conpoment props`s value show not correct in pages when the value is not in English Mar 3, 2023
Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! You need to run the linter. See the bottom here: https://github.com/pynecone-io/pynecone/blob/main/CONTRIBUTING.md

@@ -62,20 +63,21 @@ def format_prop(
if not prop.is_local or prop.is_string:
return str(prop)
if issubclass(prop.type_, str):
return json.dumps(prop.full_name)
return json.dumps(prop.full_name, ensure_ascii=False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth it to add a helper function in utils.py so we never forget to add this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok,I ran the linter as the doc said and commit again , please review the code.
And by the way , your guys did a fantastic job, I love this project and wish it goes well!

Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

@picklelo picklelo merged commit e132821 into reflex-dev:main Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants