Book Image

QT5 Blueprints

By : Symeon Huang
Book Image

QT5 Blueprints

By: Symeon Huang

Overview of this book

Table of Contents (17 chapters)
Qt 5 Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Translating Qt Widgets applications


First, let's create a new Qt Widget project, whose name is Internationalization. Then, edit mainwindow.ui in the Design mode.

  1. As usual, remove the status bar, menu bar, and tool bar.

  2. Add Label into centralWidget and change its object name to nonTransLabel. Then, change its text to This is a non-translatable label and uncheck translatable under text in Property Editor.

  3. Drag a Push Button just beneath nonTransLabel with transButton as its object name. Change its text to This is a translatable button.

  4. Change Lay out to Lay Out Vertically in MainWindow.

  5. Resize the frame to a comfortable size.

Go back to editing the Internationalization.pro project file in the Edit mode. Add a line indicating the translation source file, which is shown as follows:

TRANSLATIONS = Internationalization_de.ts

The _de suffix is a locale code, indicating that this is a German translation source file. The locale codes are defined by Internet Engineering Task Force in the BCP 47 document series...