Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Qt has a great facility for <a href="http://doc.trolltech.com/4.5/linguist-manual.html" rel="nofollow noreferrer">localization</a>. The first step is to use their string class QString. </p> <p>Next, you simply wrap any string literals in the tr() macro. The great thing about this method is that you don't have to waste time maintaining constants or defines. Just type the string you want, where you want it.</p> <p>Later, you use a Qt utility to search all of your code units for translatable strings and creates a .ts file. This file is xml so you don't have to worry about your data being trapped in some proprietary format.</p> <p>Now that you have a .ts file, Qt provides a translation editor called linguist. This is a very nice program that presents the strings to a translator (person) and provides some simple tools for managing the whole process. The program looks for common mistakes (differing punctuation), tracks the state of each string such as whether it has been tranlated or not, and whether the source string has changed or has been deleted. The program will also show context information for each string which the developer can include in the tr() macro. </p> <p>When the translation is finished, the .ts file is compiled into smaller binary that is distributed with the application and loaded at runtime. Translations can be switched on the fly.</p> <p>There is more to it than I can explain fully here. It is really a great system that is worth investigating.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload