Mailinglist Archive: yast-commit (723 mails)

< Previous Next >
[yast-commit] r47436 - in /trunk/gtk: ChangeLog src/Makefile.am src/Y2CCGtk.cc src/YGPackageSelector.cc src/YGUI.cc src/YGUI.h src/YGi18n.h src/pkg-selector-help.h
  • From: michael_meeks@xxxxxxxxxxxxxxxx
  • Date: Mon, 12 May 2008 09:16:33 -0000
  • Message-id: <20080512091633.E8436299E6@xxxxxxxxxxxxxxxx>
Author: michael_meeks
Date: Mon May 12 11:16:33 2008
New Revision: 47436

URL: http://svn.opensuse.org/viewcvs/yast?rev=47436&view=rev
Log:
2008-05-12 Michael Meeks <michael.meeks@xxxxxxxxxx>

* src/pkg-selector-help.h, src/YGPackageSelector.cc
(Ypp::PkgListener): translate later when we have the
textdomain setup correctly.

* src/YGUI.cc (YGUI::setTextdomain): impl.
* src/YGi18n.h: add TEXTDOMAIN / dgettext / dngettext
to the calls.


Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/Makefile.am
trunk/gtk/src/Y2CCGtk.cc
trunk/gtk/src/YGPackageSelector.cc
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUI.h
trunk/gtk/src/YGi18n.h
trunk/gtk/src/pkg-selector-help.h

Modified: trunk/gtk/ChangeLog
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Mon May 12 11:16:33 2008
@@ -1,5 +1,13 @@
2008-05-12 Michael Meeks <michael.meeks@xxxxxxxxxx>

+ * src/pkg-selector-help.h, src/YGPackageSelector.cc
+ (Ypp::PkgListener): translate later when we have the
+ textdomain setup correctly.
+
+ * src/YGUI.cc (YGUI::setTextdomain): impl.
+ * src/YGi18n.h: add TEXTDOMAIN / dgettext / dngettext
+ to the calls.
+
* POTFILES: add missing files-to-be-translated.

2008-05-09 Michael Meeks <michael.meeks@xxxxxxxxxx>

Modified: trunk/gtk/src/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/Makefile.am?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/Makefile.am (original)
+++ trunk/gtk/src/Makefile.am Mon May 12 11:16:33 2008
@@ -1,8 +1,8 @@
AM_CFLAGS = $(GTK_CFLAGS) \
- -DTHEMEDIR=\"${themedir}/current\"
-AM_CXXFLAGS = $(GTK_CFLAGS) \
-DY2LOG=\"ui-gtk\" \
- -DTHEMEDIR=\"${themedir}/current\"
+ -DTHEMEDIR=\"${themedir}/current\" \
+ -DLOCALEDIR=\"${localedir}\"
+AM_CXXFLAGS = $(AM_CFLAGS)

noinst_HEADERS = $(wildcard *.h)


Modified: trunk/gtk/src/Y2CCGtk.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/Y2CCGtk.cc?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/Y2CCGtk.cc (original)
+++ trunk/gtk/src/Y2CCGtk.cc Mon May 12 11:16:33 2008
@@ -4,11 +4,12 @@

#include <config.h>
#include <YGUI.h>
+#include <YGi18n.h>

YUI * createUI( bool withThreads )
{
static YGUI *_ui = 0;
-
+
if ( ! _ui )
{
_ui = new YGUI( withThreads );

Modified: trunk/gtk/src/YGPackageSelector.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGPackageSelector.cc?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/YGPackageSelector.cc (original)
+++ trunk/gtk/src/YGPackageSelector.cc Mon May 12 11:16:33 2008
@@ -42,8 +42,8 @@
{ YGUI::ui()->normalCursor(); }

const char *lock_tooltip =
- _("<b>Package lock:</b> prevents the package status from being modified
by "
- "the solver (that is, it won't honour dependencies or collections
ties.)");
+ "<b>Package lock:</b> prevents the package status from being modified
by "
+ "the solver (that is, it won't honour dependencies or collections ties.)";

struct PkgList
{
@@ -346,10 +346,10 @@
inner::appendItem (menu, _("_Undo"), 0,
GTK_STOCK_UNDO, 0,
true, inner::undo_cb, this),
empty = false;
if (packages.locked())
- inner::appendItem (menu, _("_Unlock"),
lock_tooltip, 0, pkg_unlocked_xpm,
+ inner::appendItem (menu, _("_Unlock"),
_(lock_tooltip), 0, pkg_unlocked_xpm,
true, inner::unlock_cb,
this), empty = false;
if (unlocked)
- inner::appendItem (menu, _("_Lock"),
lock_tooltip, 0, pkg_locked_xpm,
+ inner::appendItem (menu, _("_Lock"),
_(lock_tooltip), 0, pkg_locked_xpm,
true, inner::lock_cb, this),
empty = false;
if (!empty)
gtk_menu_shell_append (GTK_MENU_SHELL (menu),
gtk_separator_menu_item_new());
@@ -1550,7 +1550,7 @@

#ifdef SHOW_LOCK_UNDO_BUTTON
m_lock_button = gtk_toggle_button_new();
- gtk_widget_set_tooltip_markup (m_lock_button, lock_tooltip);
+ gtk_widget_set_tooltip_markup (m_lock_button, _(lock_tooltip));
g_signal_connect (G_OBJECT (m_lock_button), "toggled",
G_CALLBACK (locked_toggled_cb), this);
m_locked_image = createImageFromXPM (pkg_locked_xpm);
@@ -2367,7 +2367,7 @@
G_CALLBACK (wizard_action_cb), this);

busyCursor();
- ygtk_wizard_set_help_text (wizard, onlineUpdateMode() ?
patch_help : pkg_help);
+ ygtk_wizard_set_help_text (wizard, onlineUpdateMode() ?
_(patch_help) : _(pkg_help));
createToolsButton();

YGDialog *dialog = YGDialog::currentDialog();

Modified: trunk/gtk/src/YGUI.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Mon May 12 11:16:33 2008
@@ -11,6 +11,7 @@
#include <YMacro.h>
#include <YCommandLine.h>
#include "YGUI.h"
+#include "YGi18n.h"
#include "YGUtils.h"
#include "YGDialog.h"
#include <glib/gthread.h>
@@ -38,10 +39,25 @@
m_no_border = m_fullscreen = false;
m_default_size.width = m_default_size.height = 0;

+ YGUI::setTextdomain( TEXTDOMAIN );
+
// without this none of the (default) threading action works ...
topmostConstructorHasFinished();
}

+void YGUI::setTextdomain( const char * domain )
+{
+ bindtextdomain( domain, LOCALEDIR );
+ bind_textdomain_codeset( domain, "utf8" );
+ textdomain( domain );
+
+ // Make change known.
+ {
+ extern int _nl_msg_cat_cntr;
+ ++_nl_msg_cat_cntr;
+ }
+}
+
void YGUI::checkInit()
{
if (m_done_init)

Modified: trunk/gtk/src/YGUI.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.h?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.h (original)
+++ trunk/gtk/src/YGUI.h Mon May 12 11:16:33 2008
@@ -55,6 +55,8 @@
virtual YApplication *createApplication();

public:
+ static void setTextdomain( const char * domain );
+
virtual void idleLoop (int fd_ycp);
// called by YDialog::waitInput() / pollEvent()...
YEvent *waitInput (unsigned long timeout_ms, bool block);

Modified: trunk/gtk/src/YGi18n.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGi18n.h?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/YGi18n.h (original)
+++ trunk/gtk/src/YGi18n.h Mon May 12 11:16:33 2008
@@ -23,15 +23,16 @@

#include <libintl.h>

+#define TEXTDOMAIN "yast2-gtk"

inline const char * _( const char * msgid )
{
- return ( !msgid || !*msgid ) ? "" : gettext(msgid );
+ return ( !msgid || !*msgid ) ? "" : dgettext( TEXTDOMAIN, msgid );
}

inline const char * _( const char * msgid1, const char * msgid2, unsigned long
int n )
{
- return ngettext(msgid1, msgid2, n );
+ return dngettext( TEXTDOMAIN, msgid1, msgid2, n );
}



Modified: trunk/gtk/src/pkg-selector-help.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/pkg-selector-help.h?rev=47436&r1=47435&r2=47436&view=diff
==============================================================================
--- trunk/gtk/src/pkg-selector-help.h (original)
+++ trunk/gtk/src/pkg-selector-help.h Mon May 12 11:16:33 2008
@@ -1,4 +1,4 @@
-static const char *pkg_help = _(
+static const char *pkg_help =
"<h1>Purpose</h1>"
"<p>This tool lets you manage software, as in 'install, remove, update
applications'.</p>"
"<p>openSUSE's software management is also called 'package management'. A
package is "
@@ -64,10 +64,9 @@
"without performing any changes, simply press the button labeled 'Abort'.</p>"
""
"<blockquote><i>Developed by Ricardo Cruz
&lt;rpmcruz@xxxxxxxxxxxxxxxxxxx&gt;<br>"
-"Thanks to Christian Jäger for co-designing this tool.</i></blockquote>"
-);
+"Thanks to Christian Jäger for co-designing this tool.</i></blockquote>";

-static const char *patch_help = _(
+static const char *patch_help =
"<h1>Purpose</h1>"
"<p>This tool gives you control on overviewing and picking patches. You may
also "
"reverse patches that have been applied to the system.</p>"
@@ -86,6 +85,5 @@
"are very restrained in pushing patches; you can be sure that all patches are "
"of signficant severity.</p>"
"<p>If you are looking for applications enhancements, you should check for
Upgrades "
-"on the Software Manager.</p>"
-);
+"on the Software Manager.</p>";


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages