Re: Translating the menu items of a GNOME applet.
- From: Osmo Maatta <osmoma gmail com>
- Cc: gtk-list gnome org
- Subject: Re: Translating the menu items of a GNOME applet.
- Date: Sat, 21 Aug 2010 09:38:00 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Re-hello,
The translation seems to work now. The code is pretty much the same.
static const char right_click_menu_xml[] =
"<popup name=\"button3\">\n"
" <menuitem name=\"Start Recording\" "
" verb=\"StartRecording\" "
" _label=\"_Start Recording\"/>\n"
" <menuitem name=\"Stop Recording\" "
" verb=\"StopRecording\" "
" _label=\"Sto_p Recording\"/>\n"
" <separator/>\n"
" <menuitem name=\"About Item\" "
" verb=\"MenuAbout\" "
" _label=\"_About\"\n"
" pixtype=\"stock\" "
" pixname=\"gtk-about\"/>\n"
"</popup>\n";
// Setup menu
panel_applet_setup_menu(PANEL_APPLET(applet), right_click_menu_xml,
applet_menu_verbs, NULL);
BonoboUIComponent *popup_component;
popup_component = panel_applet_get_popup_component(applet);
bonobo_ui_component_set_translate(popup_component, "/",
right_click_menu_xml, NULL);
// Accessibility support
AtkObject *atk_widget = gtk_widget_get_accessible(applet);
if (GTK_IS_ACCESSIBLE(atk_widget)) {
atk_object_set_name (atk_widget, _("Audio Recorder Application"));
atk_object_set_description(atk_widget, _("Easy-to-use audio
recording tool"));
}
I also re-started my VirtualBox VM before testing.
Thanks anyway.
// Osmo (Moma) Antero
On 08/21/2010 09:20 AM, Osmo Maatta wrote:
> Hello,
>
> I have a nice "Audio Recorder Applet" for the GNOME-desktop.
> The problem is that I cannot get the right-click-menu translated to
> other languages than english.
>
> In the applet's main.c I have:
> http://bazaar.launchpad.net/~osmoma/rec-applet/trunk/annotate/head:/src/main.c
>
> // Popup menu on right-click
> static const char Context_menu_xml [] =
> "<popup name=\"button3\">\n"
> " <menuitem name=\"Start Recording\" "
> " verb=\"StartRecording\" "
> " _label=\"_Start Recording\"/>\n"
> " <menuitem name=\"Stop Recording\" "
> " verb=\"StopRecording\" "
> " _label=\"Sto_p Recording\"/>\n"
> " <separator/>\n"
> " <menuitem name=\"About Item\" "
> " verb=\"MenuAbout\" "
> " _label=\"_About\"\n"
> " pixtype=\"stock\" "
> " pixname=\"gtk-about\"/>\n"
> "</popup>\n";
>
> static const BonoboUIVerb applet_menu_verbs [] = {
> BONOBO_UI_VERB ("MenuAbout", applet_about_dialog_cb),
> BONOBO_UI_VERB ("StartRecording", applet_start_recording_cb),
> BONOBO_UI_VERB ("StopRecordin_menu_verbsg", applet_stop_recording_cb),
> BONOBO_UI_VERB_END
> };
>
> panel_applet_setup_menu(PANEL_APPLET(applet), Context_menu_xml,
> applet_menu_verbs, NULL);
>
> This applet has already been translated to fi_FI, nb_NO and pt_BR.
> But when run, the panel-applet's right-click-menu is always in english,
> it never loads the translated strings.
>
> I have also tried with a separate menu.xml file. I can see that
> $ cd po
> $ make update
>
> commands find the menu labels (_label="xxxx") and puts them all in the
> po/rec-applet.pot file. But under runtime, right-click-menu is in
> english. However the panel-applet's window (the GUI) is translated and
> is OK.
>
> Rec-applet source: https://launchpad.net/rec-applet
> Packages: https://launchpad.net/~osmoma/+archive/rec-applet
>
> Kindly
> Osmo Antero
> Applet maker.
>
>
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJMb4JXAAoJEGfwUONUm43RVPUH/jDQPpTtxWmVN/ppBzCng2Xg
VJx6DRygenqHFsFDTwPXOodn5gyroLwcsLJbTCip3+wYN4gcePaxPPV/jjEBci8d
//tss6Y6YrSngEXDabAu9nkL9qMWslKKLDvxo/vSO5kKyt0E4nVPwC1NQFknGPNy
asu8AcJe27RpGENYz8zvPS4Xo4l3fjYe7uw+Scu7GM9FoXP7Dc+hAda9fBcJKdOZ
TSNoK/Wo1Sny25nMDzBDDKA1bL630IyyF28jC3ZaMZtJBlPdt0QB9JMDEze9Tx3r
lFP0Xqnnj+EFRIn4nqSmwLNjJmm/PlMCSmGqsurrSpQR3A1FjnGN69NRcNo+cFQ=
=Mecx
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]