[uim-commit] r2962 - in trunk: helper qt

yamaken at freedesktop.org yamaken at freedesktop.org
Fri Jan 20 23:15:54 PST 2006


Author: yamaken
Date: 2006-01-20 23:15:50 -0800 (Fri, 20 Jan 2006)
New Revision: 2962

Modified:
   trunk/helper/pref-gtk-custom-widgets.c
   trunk/qt/pref-customwidgets.cpp
   trunk/qt/qtgettext.h
Log:
* qt/qtgettext.h
  - (mygettext): New macro copied from _()
  - (_): Simplify with mygettext()
  - (N_): Stop converting to QString to be similar to original N_()
* qt/pref-customwidgets.cpp
  - (CustomPathnameEdit::CustomPathnameEdit):
    * Fix runtime translation and xgettext handling
    * Change button labels
    * Describe the reason for labels
* helper/pref-gtk-custom-widgets.c
  - (add_custom_type_pathname): Ditto


Modified: trunk/helper/pref-gtk-custom-widgets.c
===================================================================
--- trunk/helper/pref-gtk-custom-widgets.c	2006-01-21 05:27:09 UTC (rev 2961)
+++ trunk/helper/pref-gtk-custom-widgets.c	2006-01-21 07:15:50 UTC (rev 2962)
@@ -479,16 +479,23 @@
   UIMPREF_FILE_ENTRY(entry)->type = custom->value->as_pathname->type;
   gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
 
+  /* Since both pathname type opens the file dialog to select an item
+   * rather than open it, the label should always be "Select..." here.
+   * The type is obvious for uses even if the button label does not
+   * indicate it. Information about the action the button causes is
+   * more important. Even if a better label has been found, it should
+   * not contain the term 'directory' since GNOME uses 'folder' for
+   * it.  -- YamaKen 2006-01-21 */
   switch (custom->value->as_pathname->type) {
     case UCustomPathnameType_Directory:
-      button_label = "Directory...";
+      button_label = N_("Select...");
       break;
     case UCustomPathnameType_RegularFile:
     default:
-      button_label = "File...";
+      button_label = N_("Select...");
       break;
   }
-  button = gtk_button_new_with_label(_(button_label));
+  button = gtk_button_new_with_label(dgettext(GETTEXT_PACKAGE, button_label));
   gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0);
 
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);

Modified: trunk/qt/pref-customwidgets.cpp
===================================================================
--- trunk/qt/pref-customwidgets.cpp	2006-01-21 05:27:09 UTC (rev 2961)
+++ trunk/qt/pref-customwidgets.cpp	2006-01-21 07:15:50 UTC (rev 2962)
@@ -171,16 +171,21 @@
                       this, SLOT(slotCustomTextChanged(const QString &)) );
 
     m_fileButton = new QPushButton( this );
+    /* Since both pathname type opens the file dialog to select an item rather
+     * than open it, the label should always be "Select..." here.  The type is
+     * obvious for uses even if the button label does not indicate
+     * it. Information about the action the button causes is more important.
+     *   -- YamaKen 2006-01-21 */
     switch (m_custom->value->as_pathname->type) {
     case UCustomPathnameType_Directory:
-        button = "Directory";
+        button = N_( "Select..." );
         break;
     case UCustomPathnameType_RegularFile:
     default:
-        button = "File";
+        button = N_( "Select..." );
         break;
     }
-    m_fileButton->setText( _(button) );
+    m_fileButton->setText( mygettext(button) );
     QObject::connect( m_fileButton, SIGNAL(clicked()),
                       this, SLOT(slotPathnameButtonClicked()) );
 

Modified: trunk/qt/qtgettext.h
===================================================================
--- trunk/qt/qtgettext.h	2006-01-21 05:27:09 UTC (rev 2961)
+++ trunk/qt/qtgettext.h	2006-01-21 07:15:50 UTC (rev 2962)
@@ -39,17 +39,20 @@
 /* NLS can be disabled through the configure --disable-nls option.  */
 #if ENABLE_NLS
 
+/* translation without being the tag for xgettext(1) */
+#define mygettext(String) QString::fromUtf8( dgettext(GETTEXT_PACKAGE,String) )
+
 /* undef original _(String) macro for handling encoding */
 #ifdef _
 #undef _
 #endif
-#define _(String) QString::fromUtf8( dgettext(GETTEXT_PACKAGE,String) )
+#define _(String) mygettext(String)
 /* undef original N_(String) macro for handling encoding */
 #ifdef N_
 #undef N_
 #endif
 #ifdef gettext_noop
-#define N_(String) QString::fromUtf8( gettext_noop(String) )
+#define N_(String) gettext_noop(String)
 #else
 #define N_(String) (String)
 #endif /* gettext_noop */



More information about the uim-commit mailing list