Add Simplified Chinese Documentation #4025
Replies: 6 comments 26 replies
-
Beta Was this translation helpful? Give feedback.
-
I have acquired the domain nicegui.cn and built an official counterpart website using this repository. The site is hosted on servers in Hong Kong, China, optimized for fast access from mainland China. While currently working to localize it into Simplified Chinese, most content remains in English. I'm exploring a more sustainable translation strategy, as directly modifying the source code for translations complicates synchronization with upstream updates of NiceGUI. 我购买了一个域名:nicegui.cn ,并使用此仓库搭建起了一个官方同款的网站。部署的服务器在中国香港,在中国大陆的朋友能很快地访问这个网站。我正在尝试把它翻译成简体中文,虽然目前来看,大部分内容依旧是 English. 但我仍旧在探索一种更好的翻译方案,因为目前我直接修改相关代码来完成翻译,这使得NiceGUI在更新时,此文档的更新也是灾难级的。 |
Beta Was this translation helpful? Give feedback.
-
Directly modifying the source code of the NiceGUI repository still seems problematic. Especially when rendering the documentation for NiceGUI methods, it directly reads the docstrings from elements rather than storing them in separate documentation files. This means it can only support a single language. If we forcibly change these docstrings to another language (like Simplified Chinese), then everyone would only see the Simplified Chinese documentation on the official website, and even get only Chinese syntax hints in newer IDEs 😅. Unless we create a separate branch and aggressively modify NiceGUI's source code, I can't find another way to achieve this. |
Beta Was this translation helpful? Give feedback.
-
As you have noticed, NiceGUI's documentation is based on a custom framework that allows to create documentation pages with very little overhead. Take https://github.com/zauberzeug/nicegui/blob/main/website/documentation/content/label_documentation.py for example. There's a decorator A disadvantage of this system is that there is no separate content management system other that the Python code itself - docstrings and *_documentation.py files. To add more languages, we would somehow need to replace docstrings with translations, or replace the whole system altogether. But I think there's so much value in having a low-threshold documentation where you can easily add a documentation page after implementing a new UI element. An i18n solution shouldn't come at a too high cost in this regard. Which brings me to a rather fundamental question: I know that popular libraries like FastAPI take translation very seriously. And I know that not everyone is speaking English (about 70-80%). Maybe Chinese (20-25%) already covers most of the non-english speaking developers. A next step could be Spanish, Japanese and Russian. But we might not need 20 or so languages. Let me cite some pros and cons from Claude.ai:
So when thinking about translation for nicegui.io, we might want to focus on a 2-language solution. In contrast to supporting many languages, we could squeeze two languages into a docstring, for example, and let the For two languages we could also further explore the idea of a second repository. What about some Git tooling that displays the diff of individual English pages since the corresponding Chinese page has been updates? I guess we could find a similar solution for docstrings. |
Beta Was this translation helpful? Give feedback.
-
@falkoschindler Are you fine with having special tags (like hashtags) in the docstring? If so, we can have a tag (Think: Meanwhile, about #4530, we can also have such tags (Think: Otherwise, I totally don't see how to work around the fact that NiceGUI uses docstring. A string is a string, and it can only do so much... |
Beta Was this translation helpful? Give feedback.
-
After thinking about a translation management system for humans, automatic text extraction and AI-based translation: What if we auto-generate an AI-based translation every time we deploy a new release? We could checkout the repository and ask an AI agent to translate every docstring and every text snippet of the documentation. Additional instructions could give context and steer the agent towards the desired result. It might not be perfect, but requires much less maintenance in the long run. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I noticed that the documentation currently lacks support for Simplified Chinese (zh-CN). As a Simplified Chinese speaker, I would love to help translate the documentation into Simplified Chinese to make this project more accessible to users and contributors from China and other regions where Simplified Chinese is widely used.
I have already translated some content, such as:
NiceGUI 文本元素 NiceGUI Text Elements
NiceGUI ui.label
This is a translation of what was written on my personal blog. Since my blog is based on WordPress, it is not easy to preview the interactive components of NiceGUI.
I hope to upload my translated documentation to the repository in the form of a Pull Request, so that users can choose between Simplified Chinese or English on the official NiceGUI website.
Beta Was this translation helpful? Give feedback.
All reactions