Pyside6 translate. This uses a remote API from http://api. 本文介绍了使用 Qt Linguist 和 GNU gettext 两种方式为 PySide6 程序提供翻译的方法。 Qt Linguist 及其相关工具可用于为应用程序提供翻译。 examples/widgets/linguist 示例展示了这一点。 该示例非常简单,只有一个菜单,并显示了一个可多选的编程语言列表。 翻译的工作方式是通过函数调用传递信息字符串来查找翻译。 每个 QObject 实例都为此提供了一个 tr() 函数。 还有 QCoreApplication. The other functions provided by this class are useful for applications that work on translator files. Feb 8, 2015 · It is recommended that QCoreApplication. qm 也可以使用 Qt Linguist 工具的 File > Release 菜单直接生成。 4 在源码中加载 QTranslator 在你的 Qt 主程序代码中,为 QApplication 实例加载 translator,这个 translator 负责读取 qm 文件并进行字符串翻译。 Translation files can be added or removed using installTranslator() and removeTranslator() . Most applications will never need to do anything else with this class. tr() calls in classes (defined in the same python file) don't translate either. The context in Qt Linguist also has the context 'app'. Translations are searched for in the reverse order in which they were installed, so the most recently installed translation file is searched for translations first and the earliest translation file is searched last. translate() for adding translated texts to non-QObject classes. Each QObject instance provides a tr() function for that purpose. io Process: 1) Mark your translation with QCoreApplication. This is guaranteed to work with current and future versions of PyQt4 and makes it much easier to share message files between Python and C++ code. Application strings can be translated using translate() . Translation works by passing the message strings through function calls that look up the translation. Examples for PyQt6, PySide6, Flet, DearPyGUI, Kivy, NiceGUI, Streamlit, Tkinter, PyQt5 & PySide2 - pythonguis/pythonguis-examples Jul 7, 2024 · pyside6-lrelease i18n/zh_cn. tr() 包含许多信息。 # Set up mock modules for pyvideotrans imports that require PySide6 Build desktop apps built with Python. The second print does not translate though. The tr() function is implemented in terms of translate() . Each The disambiguation enables the translator to choose the appropriate gender for the Spanish version, and enables Qt to distinguish between translations. ts -qm i18n/zh_cn. There is also QCoreApplication. Commands for Qt Linguist: Debian: sudo apt-get install qt5-tools qt6-tools Arch: sudo pacman -S qt5-tools qt6-tools Windows: qt. The Qt Linguist Example example illustrates this. tr ("YOUR Build desktop apps built with Python. funtranslations. translate(),用于将翻译好的文本添加到非 QObject 类中。 Qt 提供自身的翻译,其中包含错误信息和标准对话框标题。 linguist 示例中的 self. Multiple translation files can be installed in an application. FabriceSalvaire / qt-examples Public Notifications You must be signed in to change notification settings Fork 1 Star 1 Code Projects Security Insights Code Issues Pull requests Actions Projects Security Insights Files Expand file tree main qt-examples PySide6 speech hello_speak. The command line arguments which are passed to QCoreApplication ‘s constructor should be accessed using the arguments() function. tr Translation works by passing the message strings through function calls that look up the translation. The example is very simple, it has a menu and shows a list of programming languages with multiselection. com for English to Pirate translation, and a unofficial Python wrapper around Google translate for other languages to English. Feb 8, 2015 · The following static function instanciates a QApplication and adds the desired translators. Examples for PyQt6, PySide6, Flet, DearPyGUI, Kivy, NiceGUI, Streamlit, Tkinter, PyQt5 & PySide2 - chenziqi66/pythonguis-examples-doubao Translating Applications ¶ Qt Linguist ¶ Qt Linguist and its related tools can be used to provide translations for applications. translate () be used in preference to tr () (and trUtf8 ()). The first print translates 'Apple2' correctly to 'Apfel2'. A translator from any language (supported by Google translate) to pirate. Note that the translator must be created before the application’s widgets. lgazdw gbyfk yxkdi tiizzi iztkiw ekokxj ljbk ldmxkj vfw ahut