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

Add zh-CN & zh-TW support when server down. #4324

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Yuerchu
Copy link
Contributor

@Yuerchu Yuerchu commented Feb 8, 2025

When the client fails to connect to NiceGUI, a prompt will appear in the lower left corner of the client: Connection Lost. Trying to reconnect.... This is not difficult to understand for those who know English. However, for those who do not understand English, it undoubtedly reduces the user experience.

This pull request adds support for Simplified Chinese and Traditional Chinese. After using ui.run(language='zh-CN') and the browser is fully loaded, if the server is closed, the correct display on the user's browser will be 连接丢失 instead of Connection Lost. If an undefined language is set, the default English prompt message will be displayed. I am still thinking of a better way for developers to customize this content.

ui.run(language='zh-CN')
zh-CN

ui.run(language='zh-TW')
zh-TW

ui.run() # Specify another language or do not specify any language
en-US

Add zh-CN & zh-TW support when server down.
Add traditional Chinese
Add ja-JP, ko-KR, fr-FR, de-DE, it-IT, es-ES, ru-RU language support.
@Yuerchu
Copy link
Contributor Author

Yuerchu commented Feb 10, 2025

I have added languages from other countries/regions as well, such as Japanese ja-JP:
image

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.

1 participant