denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] [bug #23883] menu items are not translated though message


From: Stefan Osswald
Subject: [Denemo-devel] [bug #23883] menu items are not translated though message catalog exists
Date: Sat, 06 Sep 2008 18:23:22 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.1) Gecko/2008070206 Firefox/3.0.1

Follow-up Comment #6, bug #23883 (project denemo):

You're right, some strings are not marked for translation in the Denemo
source, especially messages used in warning dialogs and status bar messages.
But you might need _() instead of N_().

* _("message") marks a string for translation, calls gettext() and returns
the translated string.
* N_("message") marks a string for translation, but does not call gettext()
and returns the original (English) string.

Usually, _("message") is used. This macro calls the gettext() method. In some
contexts, C++ does not allow methods to be called. So using this macro in
array initializers will lead to compile time errors. In array initializers,
you have to use 
 ... my_array[] = {N_("message")}; 
instead. N_() does not translate strings, so you have to call gettext() or
_() before writing the array's content to the UI:
 warningdialog(_(my_array[0])); 

For action groups, GTK calls _() automatically given that the language domain
is set as in Comment #2. Most other objects and methods do not call _().


In the Denemo source, N_() is used in some places without _() being called
afterwards. These strings appear in the message catalog, but appear in English
in the UI as described in this bug report. I patched the lines I found, see
attachment. 



(file #16436)
    _______________________________________________________

Additional Item Attachment:

File name: patch1                         Size:5 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?23883>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]