bugDenemo - Bugs: bug #23883, menu items are not translated...

 
 

bug #23883: menu items are not translated though message catalog exists

Submitter:  None
Submitted:  Fri 18 Jul 2008 02:57:12 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 07 Sep 2008 08:30:10 PM UTC, comment #9: 

I've looked at the other files, and the answer is obviously yes, so I've pushed them to git.
Thank you for your contribution.

Richard Shann <rshann>
Group administrator
Sun 07 Sep 2008 06:17:35 PM UTC, comment #8: 

I've pushed your patch to git. The other files - are they straight replacements?

Richard Shann <rshann>
Group administrator
Sat 06 Sep 2008 06:35:28 PM UTC, comment #7: 

Comment #6: Sorry, I forgot that Rich Markup uses underscores for italics. The macros are

_()
N_()



Files in attachment:

  • de.po: German translation
  • POTFILES.in: I included print.c, scoreops.c and transpose.c.
  • denemo.pot: rebuilt, now includes 283 new message ids for translation



(file #16437)

Stefan Osswald <sosswald>
Sat 06 Sep 2008 06:23:20 PM UTC, comment #6: 

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)

Stefan Osswald <sosswald>
Fri 05 Sep 2008 09:53:32 AM UTC, comment #5: 

Thank you for this explanation - it means that as we don't provide po/Makefile in the git repository, that the bug is correctly closed. (Correct me if I am still not understanding, otherwise, it is ok).
I have noticed in the Denemo source that N_() is missing in some places - I have always assumed that this is for internationalization, but no-one knowledgeable has yet commented about this. If you understand this part of the system, please comment on this. It would be annoying to fix something that was not broken, yet no-one has complained of untranslatable strings.

Richard Shann <rshann>
Group administrator
Thu 04 Sep 2008 05:29:27 PM UTC, comment #4: 

I tested Denemo using the French locale. It works for me, the menus appear in French now.

Sorry for being imprecise about how to update the message catalog. I meant that the message catalog template po/denemo.pot in the git repository is outdated (about 260 message strings are missing). For efficiency reasons, make never updates .pot files during regular builds. You have to update .pot files manually:

  • Call ./configure to include the changes in po/POTFILES.in to po/Makefile.
  • Force make to update the message catalog:
    • cd po/
    • make denemo.pot-update
  • Call make without arguments to do a regular build.


Make merges the new message template with the existing .po files, so translators can continue to translate their language files without having to rebuild the entire message catalog first.


Stefan Osswald <sosswald>
Tue 02 Sep 2008 08:12:26 AM UTC, comment #3: 

I've pushed the suggested changes to git. I am guessing that "update/recompile the message catalog" is what happens when you build Denemo (that is, that the changes pushed to git are sufficient to close this bug).

Richard Shann <rshann>
Group administrator
Mon 01 Sep 2008 01:18:21 PM UTC, comment #2: 

You have to set the translation domain for each ActionGroup to the system default value. Call
   gtk_action_group_set_translation_domain (action_group, NULL); immediately after calling gtk_action_group_new().

The menu strings in denemoui.xml are not included in the message catalog. You could add src/entries.h to po/POTFILES.in and update/recompile the message catalog.


Stefan Osswald <sosswald>
Sat 26 Jul 2008 04:44:02 PM UTC, comment #1: 

We have no one on yet who has expertise in this area, but as Denemo is now rapidly growing, we hope someone will help soon.

Richard Shann <rshann>
Group administrator
Fri 18 Jul 2008 02:57:12 PM UTC, original submission:  

I can't use translated menu though message catalog exists.
They all appears in English. File, Edit ,..., Help and so on.
Why does this happen?
Other applications e.g. bluefish don't show such a trouble.
I can see menu in Japanese.

I added ja.po for denemo-0.7.8/po/ directory and added ja into the line in LINGUAS so it appears like this now:

# Set of available languages.
es fr sv it ja

compile and install proceeded without any problem and now
/usr/local/share/locale/ja/LC_MESSAGES/denemo.mo exists.

This is same when I set other locale such as LC_ALL=fr_FR.UTF-8 .
Menu shows in English, not specified language.

Does anyone know how to resolve this problem?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #16437:  patch2.tar.gz added by sosswald (31KiB - application/x-gzip)
file #16436:  patch1 added by sosswald (6KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sosswald (Posted a comment)
  • -email is unavailable- added by rshann (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-12-31 rshann Open/ClosedOpen Closed
    2008-09-06 sosswald Attached File- Added patch2.tar.gz, #16437
    2008-09-06 sosswald Attached File- Added patch1, #16436
    2008-09-02 rshann StatusPostponed Fixed
    2008-07-26 rshann StatusNone Postponed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code