gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r7992 - in GNUnet: contrib src/include src/setup/lib src/se


From: gnunet
Subject: [GNUnet-SVN] r7992 - in GNUnet: contrib src/include src/setup/lib src/setup/ncurses src/setup/text
Date: Sun, 7 Dec 2008 02:02:18 -0700 (MST)

Author: holindho
Date: 2008-12-07 02:02:18 -0700 (Sun, 07 Dec 2008)
New Revision: 7992

Modified:
   GNUnet/contrib/config-client.scm
   GNUnet/contrib/config-daemon.scm
   GNUnet/src/include/gnunet_setup_lib.h
   GNUnet/src/setup/lib/gns.c
   GNUnet/src/setup/lib/tree.c
   GNUnet/src/setup/ncurses/mconf.c
   GNUnet/src/setup/text/conf.c
Log:
move gettext from guile to setup lib


Modified: GNUnet/contrib/config-client.scm
===================================================================
--- GNUnet/contrib/config-client.scm    2008-12-07 05:29:14 UTC (rev 7991)
+++ GNUnet/contrib/config-client.scm    2008-12-07 09:02:18 UTC (rev 7992)
@@ -33,7 +33,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; for GNU gettext
-(define (_ msg) (gettext msg "GNUnet"))
+(define (_ msg) msg)
 
 ;; common string
 (define (nohelp) 

Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm    2008-12-07 05:29:14 UTC (rev 7991)
+++ GNUnet/contrib/config-daemon.scm    2008-12-07 09:02:18 UTC (rev 7992)
@@ -32,7 +32,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 ;; for GNU gettext
-(define (_ msg) (gettext msg "GNUnet"))
+(define (_ msg) msg)
 
 ;; common string
 (define (nohelp) 

Modified: GNUnet/src/include/gnunet_setup_lib.h
===================================================================
--- GNUnet/src/include/gnunet_setup_lib.h       2008-12-07 05:29:14 UTC (rev 
7991)
+++ GNUnet/src/include/gnunet_setup_lib.h       2008-12-07 09:02:18 UTC (rev 
7992)
@@ -166,13 +166,23 @@
   char *option;
 
   /**
-   * Description for this node (never NULL)
+   * Description for this node, original from SCM (never NULL)
    */
+  char *untranslatedDescription;
+
+  /**
+   * Description for this node, localized (never NULL)
+   */
   char *description;
 
   /**
-   * Helptext for this node (never NULL)
+   * Helptext for this node, original from SCM (never NULL)
    */
+  char *untranslatedHelp;
+
+  /**
+   * Helptext for this node, localized (never NULL)
+   */
   char *help;
 
   /**

Modified: GNUnet/src/setup/lib/gns.c
===================================================================
--- GNUnet/src/setup/lib/gns.c  2008-12-07 05:29:14 UTC (rev 7991)
+++ GNUnet/src/setup/lib/gns.c  2008-12-07 09:02:18 UTC (rev 7992)
@@ -256,8 +256,8 @@
       GNUNET_GE_BREAK (NULL, 0);
       break;
     }
-  GNUNET_free (t->description);
-  GNUNET_free (t->help);
+  GNUNET_free (t->untranslatedDescription);
+  GNUNET_free (t->untranslatedHelp);
   GNUNET_free (t->children);
   GNUNET_free (t);
 }

Modified: GNUnet/src/setup/lib/tree.c
===================================================================
--- GNUnet/src/setup/lib/tree.c 2008-12-07 05:29:14 UTC (rev 7991)
+++ GNUnet/src/setup/lib/tree.c 2008-12-07 09:02:18 UTC (rev 7992)
@@ -235,8 +235,9 @@
 static SCM
 build_tree_node (SCM section,
                  SCM option,
-                 SCM description,
-                 SCM help, SCM children, SCM visible, SCM value, SCM range)
+                 SCM untranslatedDescription,
+                 SCM untranslatedHelp,
+                 SCM children, SCM visible, SCM value, SCM range)
 {
   struct GNUNET_GNS_TreeNode *tree;
   SCM child;
@@ -248,9 +249,10 @@
   /* verify arguments */
   SCM_ASSERT (scm_string_p (section), section, SCM_ARG1, "build_tree_node");
   SCM_ASSERT (scm_string_p (option), option, SCM_ARG2, "build_tree_node");
-  SCM_ASSERT (scm_string_p (description), description, SCM_ARG3,
-              "build_tree_node");
-  SCM_ASSERT (scm_string_p (help), help, SCM_ARG4, "build_tree_node");
+  SCM_ASSERT (scm_string_p (untranslatedDescription), untranslatedDescription,
+              SCM_ARG3, "build_tree_node");
+  SCM_ASSERT (scm_string_p (untranslatedHelp), untranslatedHelp,
+              SCM_ARG4, "build_tree_node");
   SCM_ASSERT (scm_list_p (children), children, SCM_ARG5, "build_tree_node");
   clen = scm_to_int (scm_length (children));
   for (i = 0; i < clen; i++)
@@ -294,8 +296,10 @@
   tree = GNUNET_malloc (sizeof (struct GNUNET_GNS_TreeNode));
   tree->section = scm_to_locale_string (section);
   tree->option = scm_to_locale_string (option);
-  tree->description = scm_to_locale_string (description);
-  tree->help = scm_to_locale_string (help);
+  tree->untranslatedDescription = scm_to_locale_string 
(untranslatedDescription);
+  tree->description = _ (tree->untranslatedDescription);
+  tree->untranslatedHelp = scm_to_locale_string (untranslatedHelp);
+  tree->help = _ (tree->untranslatedHelp);
   tree->children =
     GNUNET_malloc (sizeof (struct GNUNET_GNS_TreeNode *) * (clen + 1));
   for (i = 0; i < clen; i++)

Modified: GNUnet/src/setup/ncurses/mconf.c
===================================================================
--- GNUnet/src/setup/ncurses/mconf.c    2008-12-07 05:29:14 UTC (rev 7991)
+++ GNUnet/src/setup/ncurses/mconf.c    2008-12-07 09:02:18 UTC (rev 7992)
@@ -54,7 +54,7 @@
 show_help (const char *option, const char *helptext)
 {
   dialog_vars.help_button = 0;
-  dialog_msgbox (option, gettext (helptext), 20, 70, TRUE);
+  dialog_msgbox (option, helptext, 20, 70, TRUE);
   dialog_vars.help_button = 1;
 }
 
@@ -125,8 +125,8 @@
               if (pos->children[i]->visible)
                 {
                   items[st].name = pos->children[i]->option;
-                  items[st].text = gettext (pos->children[i]->description);
-                  items[st].help = gettext (pos->children[i]->help);
+                  items[st].text = pos->children[i]->description;
+                  items[st].help = pos->children[i]->help;
                   if (st == msel)
                     items[st].state = 1;
                   else
@@ -135,7 +135,7 @@
                 }
               i++;
             }
-          st = dlg_menu (gettext (pos->description),
+          st = dlg_menu (pos->description,
                          "Select configuration option to change",
                          20, 70, 13, st, items, &msel, NULL);
           GNUNET_free (items);
@@ -172,7 +172,7 @@
             {
             case GNUNET_GNS_TYPE_BOOLEAN:
               st = dialog_yesno (pos->option,
-                                 gettext (pos->description), 5, 60);
+                                 pos->description, 5, 60);
               switch (st)
                 {
                 case DLG_EXIT_OK:
@@ -187,8 +187,7 @@
                                                                      "NO"))
                     {
                       show_help (pos->option,
-                                 gettext_noop
-                                 ("Internal error! (Choice invalid?)"));
+                                 _("Internal error! (Choice invalid?)"));
                       break;
                     }
                   return;
@@ -220,8 +219,7 @@
                                                                      
fitem.text))
                     {
                       show_help (pos->option,
-                                 gettext_noop
-                                 ("Internal error! (Value invalid?)"));
+                                 _("Internal error! (Value invalid?)"));
                       break;
                     }
                   GNUNET_free (fitem.text);
@@ -269,8 +267,8 @@
                     msel = i;
                   i++;
                 }
-              st = dlg_checklist (gettext (pos->option),
-                                  gettext (pos->description),
+              st = dlg_checklist (pos->option,
+                                  pos->description,
                                   20,
                                   70, 13, i, items, " *", FLAG_RADIO, &msel);
               GNUNET_free (items);
@@ -285,8 +283,7 @@
                                                                      [msel]))
                     {
                       show_help (pos->option,
-                                 gettext_noop
-                                 ("Internal error! (Choice invalid?)"));
+                                 _("Internal error! (Choice invalid?)"));
                       break;
                     }
                   return;
@@ -337,8 +334,8 @@
                     }
                   i++;
                 }
-              st = dlg_checklist (gettext (pos->option),
-                                  gettext (pos->description),
+              st = dlg_checklist (pos->option,
+                                  pos->description,
                                   20,
                                   70, 13, i, items, " *", FLAG_CHECK, &msel);
               switch (st)
@@ -366,8 +363,7 @@
                     {
                       GNUNET_free (tmp);
                       show_help (pos->option,
-                                 gettext_noop
-                                 ("Internal error! (Choice invalid?)"));
+                                 _("Internal error! (Choice invalid?)"));
                       break;
                     }
                   GNUNET_free (tmp);
@@ -399,8 +395,7 @@
                   if (1 != sscanf (fitem.text, "%lf", &dval))
                     {
                       show_help (pos->option,
-                                 gettext_noop
-                                 ("Invalid input, expecting floating point 
value."));
+                                 _("Invalid input, expecting floating point 
value."));
                       break;
                     }
                   if (0 != GNUNET_GC_set_configuration_value_string (cfg,
@@ -410,8 +405,7 @@
                                                                      
fitem.text))
                     {
                       show_help (pos->option,
-                                 gettext_noop
-                                 ("Internal error! (Value invalid?)"));
+                                 _("Internal error! (Value invalid?)"));
                       break;
                     }
                   GNUNET_free (fitem.text);
@@ -442,16 +436,14 @@
                       if (1 != sscanf (fitem.text, "%llu", &lval))
                         {
                           show_help (pos->option,
-                                     gettext_noop
-                                     ("Invalid input, expecting integer."));
+                                     _("Invalid input, expecting integer."));
                           continue;
                         }
                       if ((lval < pos->value.UInt64.min) ||
                           (lval > pos->value.UInt64.max))
                         {
                           show_help (pos->option,
-                                     gettext_noop
-                                     ("Value is not in legal range."));
+                                     _("Value is not in legal range."));
                           continue;
                         }
                       if (0 != GNUNET_GC_set_configuration_value_number (cfg,
@@ -461,8 +453,7 @@
                                                                          lval))
                         {
                           show_help (pos->option,
-                                     gettext_noop
-                                     ("Internal error! (Choice invalid?)"));
+                                     _("Internal error! (Choice invalid?)"));
                           continue;
                         }
                       break;

Modified: GNUnet/src/setup/text/conf.c
===================================================================
--- GNUnet/src/setup/text/conf.c        2008-12-07 05:29:14 UTC (rev 7991)
+++ GNUnet/src/setup/text/conf.c        2008-12-07 09:02:18 UTC (rev 7992)
@@ -446,7 +446,7 @@
         {
           iprintf (indent,
                    "[%s] %s = \"%s\"\n", tree->section, tree->option, ovalue);
-          iprintf (indent, "%s\n", gettext (tree->description));
+          iprintf (indent, "%s\n", tree->description);
           printChoice (indent, tree->type, &tree->value);
           i = readValue (tree->type, &tree->value);
           if (i == GNUNET_SYSERR)
@@ -457,7 +457,7 @@
           if (i == GNUNET_OK)
             break;
           printf ("\n\n");
-          iprintf (0, "%s\n", gettext (tree->help));
+          iprintf (0, "%s\n", tree->help);
           printf ("\n");
         }
       value = getValueAsString (tree->type, &tree->value);
@@ -479,7 +479,7 @@
       choice = '\0';
       while (choice == '\0')
         {
-          iprintf (indent, "%s\n", gettext (tree->description));
+          iprintf (indent, "%s\n", tree->description);
           iprintf (indent, _(   /* do not translate y/n/? */
                               "\tDescend? (y/n/?) "));
           choice = rd ();
@@ -494,7 +494,7 @@
               return GNUNET_SYSERR;     /* escape */
             case '?':
               iprintf (indent, "%c\n", choice);
-              iprintf (indent, "%s\n", gettext (tree->help));
+              iprintf (indent, "%s\n", tree->help);
               choice = '\0';
               break;
             case 'Y':





reply via email to

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