Author: jdsn
Date: Thu Jul 3 17:42:37 2008
New Revision: 48851
URL: http://svn.opensuse.org/viewcvs/yast?rev=48851&view=rev
Log:
i18n support
Added:
branches/tmp/jdsn/registration/src/Reg_i18n.cc
Modified:
branches/tmp/jdsn/registration/src/RegMain.cc
branches/tmp/jdsn/registration/src/RegRegistrationPage.cc
branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc
branches/tmp/jdsn/registration/src/RegWizard.cc
branches/tmp/jdsn/registration/src/Reg_i18n.h
Modified: branches/tmp/jdsn/registration/src/RegMain.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegMain.cc?rev=48851&r1=48850&r2=48851&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegMain.cc (original)
+++ branches/tmp/jdsn/registration/src/RegMain.cc Thu Jul 3 17:42:37 2008
@@ -25,6 +25,7 @@
int main( int argc, char **argv )
{
+ setTextdomain(TEXTDOMAIN);
YUILog::setLogFileName( "/tmp/registration.log" );
YUILog::enableDebugLogging();
YUI::app()->setIconBasePath( THEMEDIR "/icons/22x22/apps/" ); // from Makefile.am
Modified: branches/tmp/jdsn/registration/src/RegRegistrationPage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegRegistrationPage.cc?rev=48851&r1=48850&r2=48851&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegRegistrationPage.cc (original)
+++ branches/tmp/jdsn/registration/src/RegRegistrationPage.cc Thu Jul 3 17:42:37 2008
@@ -1,5 +1,6 @@
// Wizard page for "Registration"
+// Textdomain "registration"
#define YUILogComponent "reg"
#include
Modified: branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc?rev=48851&r1=48850&r2=48851&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc (original)
+++ branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc Thu Jul 3 17:42:37 2008
@@ -1,5 +1,6 @@
// Wizard page for "Update Repository"
+// Textdomain "registration"
#define YUILogComponent "reg"
#include
Modified: branches/tmp/jdsn/registration/src/RegWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegWizard.cc?rev=48851&r1=48850&r2=48851&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegWizard.cc (original)
+++ branches/tmp/jdsn/registration/src/RegWizard.cc Thu Jul 3 17:42:37 2008
@@ -1,6 +1,8 @@
// Wizard for registration
+// Textdomain "wizard"
+#define TEXTDOMAIN "wizard"
#define YUILogComponent "reg"
#include
Added: branches/tmp/jdsn/registration/src/Reg_i18n.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/Reg_i18n.cc?rev=48851&view=auto
==============================================================================
--- branches/tmp/jdsn/registration/src/Reg_i18n.cc (added)
+++ branches/tmp/jdsn/registration/src/Reg_i18n.cc Thu Jul 3 17:42:37 2008
@@ -0,0 +1,19 @@
+// i18n support for the registration
+
+
+#include
+#define TEXTDOMAINPATH "/usr/share/YaST2/"
+
+
+void setTextdomain( const char * domain )
+{
+ bindtextdomain( domain, TEXTDOMAINPATH );
+ bind_textdomain_codeset( domain, "utf8" );
+ textdomain( domain );
+
+ // Make change known.
+ {
+ extern int _nl_msg_cat_cntr;
+ ++_nl_msg_cat_cntr;
+ }
+}
Modified: branches/tmp/jdsn/registration/src/Reg_i18n.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/Reg_i18n.h?rev=48851&r1=48850&r2=48851&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/Reg_i18n.h (original)
+++ branches/tmp/jdsn/registration/src/Reg_i18n.h Thu Jul 3 17:42:37 2008
@@ -1,9 +1,20 @@
// Internationalization for registration module
+#ifndef reg_i18n_h
+# define reg_i18n_h
+
#ifndef TEXTDOMAIN
-# define TEXTDOMAIN "registration"
+# define TEXTDOMAIN "registration"
#endif
-// FIXME: use dgettext() with TEXTDOMAIN here
-#define _(MSG) (MSG)
+#define _(MSG) dgettext(TEXTDOMAIN, (MSG))
+
+
+/**
+ * Sets the textdomain for dgettext usage.
+ **/
+void setTextdomain( const char * domain );
+
+
+#endif
\ No newline at end of file
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org