Skip to content

This is a basic example of implementing dynamic language switching when running an application in PySide and QML.

License

Notifications You must be signed in to change notification settings

AndreAugustoDev/Python-QML-Dynamic-Language-Switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python QtQuick Dynamic Language Switch

This is a basic example of implementing dynamic language switching when running an application in PySide and QML. It was only tested with PySide6, but I believe it can be adapted to PyQt5/6 and PySide2 without complications.

[English | Portuguese]

Requirements

Tips

Here are tips on how to get the texts and compile them

Extract translatable texts:

lupdate .\main.qml -ts .\locale\en-US.ts .\locale\fr-FR.ts .\locale\zh-CN.ts

In this example, the texts are extracted from the main.qml file and exported in .ts format in the locale folder according to the specified names.

At this point translate these files using the translation software.

Compiling translated texts: If you want to compile all languages ​​at once

lrelease .\locale\*.ts

Or if you just want a specific one:

lrelease .\locale\fr-FR.ts

License

MIT