From 520c05ef06ce203ad32470730f68402bc7719157 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 27 Feb 2012 02:13:42 -0600 Subject: Automated update from qt3 --- doc/html/linguist-manual-4.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/html/linguist-manual-4.html') diff --git a/doc/html/linguist-manual-4.html b/doc/html/linguist-manual-4.html index 97645ddf5..8a5e52c57 100644 --- a/doc/html/linguist-manual-4.html +++ b/doc/html/linguist-manual-4.html @@ -102,7 +102,7 @@ body { background: #ffffff; color: black; } rbh = new TQRadioButton( tr("Enabled", "Hue frame"), this );

Ctrl key accelerators are also translatable:

-
        file->insertItem( tr("E&xit"), qApp, SLOT(quit()),
+
        file->insertItem( tr("E&xit"), tqApp, SLOT(quit()),
                           tr("Ctrl+Q", "Quit") );
 

It is strongly recommended that the two argument form of tr() is used for Ctrl key accelerators. The second argument is the only clue the translator has as to the function performed by the accelerator.

@@ -136,7 +136,7 @@ body { background: #ffffff; color: black; } void same_global_function( LoginWidget *logwid ) { TQLabel *label = new TQLabel( - qApp->translate("LoginWidget", "Password:"), + tqApp->translate("LoginWidget", "Password:"), logwid ); }
@@ -167,7 +167,7 @@ body { background: #ffffff; color: black; } TQString global_greeting( int greet_type ) { - return qApp->translate( "FriendlyConversation", + return tqApp->translate( "FriendlyConversation", greeting_strings[greet_type] ); } @@ -317,7 +317,7 @@ TRANSLATIONS = tt2_fr.ts \

When lupdate is run it not only extracts the source texts but it also groups them into contexts. A context is the name of the class in which the source text appears. Thus, in this example, "ArrowPad" is a context: it is the context of the texts in the ArrowPad class. The TQ_OBJECT macro defines tr(x) in ArrowPad like this

-    qApp->translate( "ArrowPad", x )
+    tqApp->translate( "ArrowPad", x )
 

Knowing which class each source text appears in enables TQt Linguist to group texts that are logically related together, e.g. all the text in a dialog will have the context of the dialog's class name and will be shown together. This provides useful information for the translator since the context in which text appears may influence how it should be translated. For some translations keyboard accelerators may need to be changed and having all the source texts in a particular context (class) grouped together makes it easier for the translator to perform any accelerator changes without introducing conflicts.

In arrowpad.cpp we implement the ArrowPad class.

@@ -336,7 +336,7 @@ TRANSLATIONS = tt2_fr.ts \
        ArrowPad *ap = new ArrowPad( this, "arrow pad" );
 

We also call MainWindow::tr() twice, once for the menu item and once for the accelerator.

-
        file->insertItem( tr("E&xit"), qApp, SLOT(quit()),
+
        file->insertItem( tr("E&xit"), tqApp, SLOT(quit()),
                           tr("Ctrl+Q", "Quit") );
 

Note the use of tr() to support different keys in other languages. "Ctrl+Q" is a good choice for Quit in English, but a Dutch translator might want to use "Ctrl+A" (for Afsluiten) and a German translator "Strg+E" (for Beenden). When using tr() for Ctrl key accelerators, the two argument form should be used with the second argument describing the function that the accelerator performs.

@@ -452,7 +452,7 @@ TRANSLATIONS = tt3_pt.ts
        setCaption( tr("Troll Print 1.0") );
 

We must translate the window's caption.

-
        file->insertItem( tr("E&xit"), qApp, SLOT(quit()),
+
        file->insertItem( tr("E&xit"), tqApp, SLOT(quit()),
                           tr("Ctrl+Q", "Quit") );
         TQPopupMenu *help = new TQPopupMenu( this );
         help->insertItem( tr("&About"), this, SLOT(about()), Key_F1 );
-- 
cgit v1.2.1