_(...) -> _b_(...)
authorx2000habouzit <x2000habouzit>
Sun, 2 Jan 2005 15:53:35 +0000 (15:53 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 2 Jan 2005 15:53:35 +0000 (15:53 +0000)
article.php
disconnect.php
include/misc.inc.php
index.php
install.d/error.inc.php
install.d/format.inc.php
install.d/profile_form.inc.php
post.php
subscribe.php
thread.php

index f5564a2..2c7faeb 100644 (file)
@@ -50,21 +50,21 @@ $ndx = $spool->getndx($id);
 
 ?>
 <h1>
-  <?php echo _('Message'); ?>
+  <?php echo _b_('Message'); ?>
 </h1>
 
 <?php
 if (isset($_GET['type']) && ($_GET['type']=='cancel') && (checkcancel($post->headers))) {
 ?>
 <p class="<?php echo $css['error']?>">
-  <?php echo _('Voulez-vous vraiment annuler ce message ?'); ?>
+  <?php echo _b_('Voulez-vous vraiment annuler ce message ?'); ?>
 </p>
 <form action="thread.php" method="post">
   <input type="hidden" name="group" value="<?php echo $group;?>" />
   <input type="hidden" name="id" value="<?php 
     echo $id;?>" />
   <input type="hidden" name="type" value="cancel" />
-  <input type="submit" name="action" value="<?php echo _('OK'); ?>" />
+  <input type="submit" name="action" value="<?php echo _b_('OK'); ?>" />
 </form>
 <?
 }
@@ -73,10 +73,10 @@ displayshortcuts();
 ?>
 
 <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" 
-summary="<?php echo _('Contenu du message'); ?>">
+summary="<?php echo _b_('Contenu du message'); ?>">
   <tr>
     <th colspan="2">
-      <?php echo _('En-têtes'); ?>
+      <?php echo _b_('En-têtes'); ?>
     </th>
   </tr>
 <?php
@@ -89,7 +89,7 @@ foreach ($news['headdisp'] as $nick) {
 ?>
   <tr>
     <th colspan="2">
-      <?php echo _('Corps'); ?>
+      <?php echo _b_('Corps'); ?>
     </th>
   </tr> 
   <tr>
@@ -99,7 +99,7 @@ foreach ($news['headdisp'] as $nick) {
   </tr>
   <tr>
     <th colspan="2">
-      <?php echo _('Aperçu'); ?>
+      <?php echo _b_('Aperçu'); ?>
     </th>
   </tr> 
   <tr>
index f3fe78c..ad08ba7 100644 (file)
@@ -8,6 +8,7 @@
 ********************************************************************************/
 
 require_once("include/session.inc.php");
+require_once("include/misc.inc.php");
 require_once("include/profile.inc.php");
 require_once("include/error.inc.php");
 
@@ -18,10 +19,10 @@ session_destroy();
 require_once("include/header.inc.php");
 ?>
 <div class="title">
-  <?php echo _('Déconnexion effectuée !'); ?>
+  <?php echo _b_('Déconnexion effectuée !'); ?>
 </div>
 <p class="normal">
-  <?php echo _('Retour au <a href="index.php">profil</a>'); ?>
+  <?php echo _b_('Retour au <a href="index.php">profil</a>'); ?>
 </p>
 <?php
 require_once("include/footer.inc.php");
index 8eb5af7..f74803c 100644 (file)
@@ -7,6 +7,8 @@
 * Copyright: See COPYING files that comes with this distribution
 ********************************************************************************/
 
+function _b_($str) { return dgettext('banana', $str); }
+
 function _headerdecode($charset, $c, $str) {
     $s = ($c == 'Q') ? quoted_printable_decode($str) : base64_decode($str);
     $s = iconv($charset, 'iso-8859-15', $s);
@@ -20,14 +22,14 @@ function headerDecode($value) {
 
 function header_translate($hdr) {
     switch (strtolower($hdr)) {
-        case 'from':            return _('De');
-        case 'subject':         return _('Sujet');
-        case 'newsgroups':      return _('Forums');
-        case 'followup':        return _('Suivi-à');
-        case 'date':            return _('Date');
-        case 'organization':    return _('Organisation');
-        case 'references':      return _('Références');
-        case 'xface':           return _('Image');
+        case 'from':            return _b_('De');
+        case 'subject':         return _b_('Sujet');
+        case 'newsgroups':      return _b_('Forums');
+        case 'followup':        return _b_('Suivi-à');
+        case 'date':            return _b_('Date');
+        case 'organization':    return _b_('Organisation');
+        case 'references':      return _b_('Références');
+        case 'xface':           return _b_('Image');
         default:
             return $hdr;
     }
@@ -44,7 +46,7 @@ function fancyDate($stamp) {
     if ($today == $dday) {
         $format = "%H:%M";
     } elseif ($today == 1 + $dday) {
-        $format = _('hier')." %H:%M";
+        $format = _b_('hier')." %H:%M";
     } elseif ($today < 7 + $dday) {
         $format = '%A %H:%M';
     } else {
index 736cf27..82ead51 100644 (file)
--- a/index.php
+++ b/index.php
@@ -8,6 +8,7 @@
 ********************************************************************************/
 
 require_once("include/session.inc.php");
+require_once("include/misc.inc.php");
 require_once("include/password.inc.php");
 require_once("include/NetNNTP.inc.php");
 require_once("include/groups.inc.php");
@@ -32,7 +33,7 @@ $newgroups = new groups($nntp,1);
 ?>
 
 <h1>
-  <?php echo _('Les forums de Banana'); ?>
+  <?php echo _b_('Les forums de Banana'); ?>
 </h1>
 
 <?php
@@ -44,16 +45,16 @@ displayshortcuts();
 <table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2">
   <tr>
     <th>
-      <?php echo _('Total'); ?>
+      <?php echo _b_('Total'); ?>
     </th>
     <th>
-      <?php echo _('Nouveaux'); ?>
+      <?php echo _b_('Nouveaux'); ?>
     </th>
     <th>
-      <?php echo _('Nom'); ?>
+      <?php echo _b_('Nom'); ?>
     </th>
     <th>
-      <?php echo _('Description'); ?>
+      <?php echo _b_('Description'); ?>
     </th>
   </tr>
 <?php
@@ -85,18 +86,18 @@ foreach ($groups->overview as $g => $d) {
 if (count($newgroups->overview) and count($profile['subscribe'])) {
 ?>
 <p class="normal">
-<?php echo _('Les forums suivants ont été créés depuis ton dernier passage :'); ?>
+<?php echo _b_('Les forums suivants ont été créés depuis ton dernier passage :'); ?>
 </p>
 <table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2">
   <tr>
     <th>
-      <?php echo _('Total'); ?>
+      <?php echo _b_('Total'); ?>
     </th>
     <th>
-      <?php echo _('Nom'); ?>
+      <?php echo _b_('Nom'); ?>
     </th>
     <th>
-      <?php echo _('Description'); ?>
+      <?php echo _b_('Description'); ?>
     </th>
   </tr>
 <?php
index 702295e..2c66ba0 100644 (file)
@@ -14,18 +14,18 @@ function error($_type) {
     global $css, $group;
     switch ($_type) {
         case "nntpsock":
-            echo '<p class="error">'._('Impossible de se connecter au serveur de forums').'</p>';
+            echo '<p class="error">'._b_('Impossible de se connecter au serveur de forums').'</p>';
             require_once("include/footer.inc.php");
             exit;
 
         case "nntpauth":
-            echo '<p class="error">'._('L\'authentification sur le serveur de forums a échoué').'</p>';
+            echo '<p class="error">'._b_('L\'authentification sur le serveur de forums a échoué').'</p>';
             require_once("include/footer.inc.php");
             exit;
 
         case "nntpgroups":
             echo "<p class=\"{$css['normal']}\">";
-            echo _('Il n\'y a pas de forum sur ce serveur').'</p>';
+            echo _b_('Il n\'y a pas de forum sur ce serveur').'</p>';
             require_once("include/footer.inc.php");
             exit;
 
@@ -33,7 +33,7 @@ function error($_type) {
             echo "<div class=\"{$css['bananashortcuts']}\">\n";
             echo "[<a href=\"index.php\">Liste des forums</a>]\n";
             echo "</div>\n";
-            echo '<p class="error">'._('Impossible d\'accéder au forum').'</p>';
+            echo '<p class="error">'._b_('Impossible d\'accéder au forum').'</p>';
             require_once("footer.inc.php");
             exit;
 
@@ -42,7 +42,7 @@ function error($_type) {
             echo "[<a href=\"index.php\">Liste des forums</a>] \n";
             echo "[<a href=\"thread.php?group=$group\">$group</a>] \n";
             echo "</div>\n";
-            echo '<p class="error">'._('Impossible d\'accéder au message.  Le message a peut-être été annulé').'</p>';
+            echo '<p class="error">'._b_('Impossible d\'accéder au message.  Le message a peut-être été annulé').'</p>';
             require_once("footer.inc.php");
             exit;
     }
index 36b7be7..7c28242 100644 (file)
@@ -64,12 +64,12 @@ function displayshortcuts() {
     $sname = basename($_SERVER['SCRIPT_NAME']);
 
     echo '<div class="shortcuts">';
-    echo '[<a href="disconnect.php">'._('Déconnexion').'</a>] ';
+    echo '[<a href="disconnect.php">'._b_('Déconnexion').'</a>] ';
 
     switch ($sname) {
         case 'thread.php' :
-            echo '[<a href="index.php">'._('Liste des forums').'</a>] ';
-            echo "[<a href=\"post.php?group=$group\">"._('Nouveau message')."</a>] ";
+            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
+            echo "[<a href=\"post.php?group=$group\">"._b_('Nouveau message')."</a>] ";
             if (sizeof($spool->overview)>$news['max']) {
                 for ($ndx=1; $ndx<=sizeof($spool->overview); $ndx += $news['max']) {
                     if ($first==$ndx) {
@@ -83,15 +83,15 @@ function displayshortcuts() {
             }
             break;
         case 'article.php' :
-            echo '[<a href="index.php">'._('Liste des forums').'</a>] ';
+            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
             echo "[<a href=\"thread.php?group=$group\">$group</a>] ";
-            echo "[<a href=\"post.php?group=$group&amp;id=$id&amp;type=followup\">"._('Répondre')."</a>] ";
+            echo "[<a href=\"post.php?group=$group&amp;id=$id&amp;type=followup\">"._b_('Répondre')."</a>] ";
             if (checkcancel($post->headers)) {
-                echo "[<a href=\"article.php?group=$group&amp;id=$id&amp;type=cancel\">"._('Annuler ce message')."</a>] ";
+                echo "[<a href=\"article.php?group=$group&amp;id=$id&amp;type=cancel\">"._b_('Annuler ce message')."</a>] ";
             }
             break;
         case 'post.php' :
-            echo '[<a href="index.php">'._('Liste des forums').'</a>] ';
+            echo '[<a href="index.php">'._b_('Liste des forums').'</a>] ';
             echo "[<a href=\"thread.php?group=$group\">$group</a>]";
             break;
     }
index cc3b18e..b700b96 100644 (file)
@@ -8,7 +8,7 @@
 ********************************************************************************/
 ?>
 <div class="title">
-  <?php echo _('Bienvenue sur Banana !'); ?>
+  <?php echo _b_('Bienvenue sur Banana !'); ?>
 </div>
 
 <form action="<?php echo $_SERVER['REQUEST_URI']?>" method="POST">
   summary="Profile">
     <tr class="pair">
       <th colspan="2">
-        <?php echo _('Définis tes paramètres'); ?>
+        <?php echo _b_('Définis tes paramètres'); ?>
       </th>
     </tr>
     <tr class="impair">
       <td>
-        <?php echo _('Nom (par exemple Jean Dupont)'; ?>
+        <?php echo _b_('Nom (par exemple Jean Dupont)'; ?>
       </td>
       <td>
         <input type="text" name="profile_name" value="">
@@ -29,7 +29,7 @@
     </tr>
     <tr class="pair">
       <td>
-        <?php echo _('Adresse mail'); ?>
+        <?php echo _b_('Adresse mail'); ?>
       </td>
       <td>
         <input type="text" name="profile_mail" value="">
@@ -37,7 +37,7 @@
     </tr>
     <tr class="impair">
       <td>
-        <?php echo _('Organisation'); ?>
+        <?php echo _b_('Organisation'); ?>
       </td>
       <td>
         <input type="text" name="profile_org" value="">
@@ -45,7 +45,7 @@
     </tr>
     <tr class="pair">
       <td>
-        <?php echo _('Signature'); ?>
+        <?php echo _b_('Signature'); ?>
       </td>
       <td>
         <textarea name="profile_sig" rows="7" cols="50"></textarea>
     </tr>
     <tr class="pair">
       <th colspan="2">
-        <?php echo _('Affichage'); ?>
+        <?php echo _b_('Affichage'); ?>
       </th>
     </tr>
     <tr class="impair">
       <td colspan="2">
         <input type="radio" name="displaytype" value="0" checked> 
-          <?php echo _('Tous les messages'); ?>
+          <?php echo _b_('Tous les messages'); ?>
       </td>
     </tr>
     <tr class="pair">
       <td colspan="2">
         <input type="radio" name="displaytype" value="1"> 
-          <?php echo _('Seulement les fils de discussion comportant des messages non lus'); ?>
+          <?php echo _b_('Seulement les fils de discussion comportant des messages non lus'); ?>
       </td>
     </tr>
     <tr class="pair">
       <th colspan="2">
-        <?php echo _('Authentification sur le serveur NNTP'); ?>
+        <?php echo _b_('Authentification sur le serveur NNTP'); ?>
       </th>
     </tr>
     <tr class="impair">
       <td>
-        <?php echo _('Login (laisser anonyme pour un login en anonyme)'); ?>
+        <?php echo _b_('Login (laisser anonyme pour un login en anonyme)'); ?>
       </td>
       <td>
         <input type="text" name="profile_login" value="anonymous">
@@ -83,7 +83,7 @@
     </tr>
     <tr class="pair">
       <td>
-        <?php echo _('Mot de passe'); ?>
+        <?php echo _b_('Mot de passe'); ?>
       </td>
       <td>
         <input type="password" name="profile_passwd" value="">
index a3273ce..4dfbf06 100644 (file)
--- a/post.php
+++ b/post.php
@@ -66,7 +66,7 @@ if (isset($group) && isset($id) && isset($_REQUEST['type']) &&
 $nntp->quit();
 ?>
 <h1>
-  <?php echo _('Nouveau message'); ?>
+  <?php echo _b_('Nouveau message'); ?>
 </h1>
 <?php
 
@@ -78,12 +78,12 @@ displayshortcuts();
 <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" border="0">
   <tr>
     <th colspan="2">
-      <?php echo _('En-têtes'); ?>
+      <?php echo _b_('En-têtes'); ?>
     </th>
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo _('Nom'); ?>
+      <?php echo _b_('Nom'); ?>
     </td>
     <td>
       <?php echo htmlentities($profile['name']); ?>
@@ -91,7 +91,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo _('Sujet'); ?>
+      <?php echo _b_('Sujet'); ?>
     </td>
     <td>
       <input type="text" name="subject" value="<?php echo 
@@ -100,7 +100,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo _('Forums'); ?>
+      <?php echo _b_('Forums'); ?>
     </td>
     <td>
       <input type="text" name="newsgroups" value="<?php echo
@@ -109,7 +109,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo _('Suivi-à'); ?>
+      <?php echo _b_('Suivi-à'); ?>
     </td>
     <td>
       <input type="text" name="followup" value="" />
@@ -117,7 +117,7 @@ displayshortcuts();
   </tr>
   <tr>
     <td class="<?php echo $css['bicoltitre'];?>">
-      <?php echo _('Organisation'); ?>
+      <?php echo _b_('Organisation'); ?>
     </td>
     <td>
       <?php echo $profile['org']; ?>
@@ -125,7 +125,7 @@ displayshortcuts();
   </tr>
   <tr>
     <th colspan="2">
-      <?php echo _('Corps'); ?>
+      <?php echo _b_('Corps'); ?>
     </th>
   </tr>
   <tr>
index 95f1fb2..36be609 100644 (file)
@@ -8,6 +8,7 @@
 ********************************************************************************/
 
 require_once("include/session.inc.php");
+require_once("include/misc.inc.php");
 require_once("include/password.inc.php");
 require_once("include/NetNNTP.inc.php");
 require_once("include/groups.inc.php");
@@ -30,7 +31,7 @@ $groups = new groups($nntp,2);
 ?>
 
 <h1>
-  <?php echo _('Abonnements'); ?>
+  <?php echo _b_('Abonnements'); ?>
 </h1>
 
 <?php
@@ -50,16 +51,16 @@ displayshortcuts();
 <table class="<?php echo $css["bicol"];?>" cellspacing="0" cellpadding="2">
   <tr>
     <th>
-      <?php echo _('Total'); ?>
+      <?php echo _b_('Total'); ?>
     </th>
     <th>
-      <?php echo _('Abonné'); ?>
+      <?php echo _b_('Abonné'); ?>
     </th>
     <th>
-      <?php echo _('Nom'); ?>
+      <?php echo _b_('Nom'); ?>
     </th>
     <th>
-      <?php echo _('Description'); ?>
+      <?php echo _b_('Description'); ?>
     </th>
   </tr>
 <?php
index 82dc241..ba1efe0 100644 (file)
@@ -68,12 +68,12 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
         $result = $nntp->post($message);
         if ($result) {
           $spool->delid($id);
-          $text = "<p class=\"normal\">"._('Message annulé')."</p>";
+          $text = "<p class=\"normal\">"._b_('Message annulé')."</p>";
         } else {
-          $text = "<p class=\"error\">"._('Impossible d\'annuler le message')."</p>";
+          $text = "<p class=\"error\">"._b_('Impossible d\'annuler le message')."</p>";
         }
       } else {
-        $text="<p class=\"error\">\n\t"._('Vous n\'avez pas les permissions pour annuler ce message')."\n</p>";
+        $text="<p class=\"error\">\n\t"._b_('Vous n\'avez pas les permissions pour annuler ce message')."\n</p>";
       }
       break;
     case 'new':
@@ -90,9 +90,9 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
         .wrap($body,"",$news['wrap']);
       $result = $nntp->post($message);
       if ($result) {
-        $text="<p class=\"normal\">"._('Message posté')."</p>";
+        $text="<p class=\"normal\">"._b_('Message posté')."</p>";
       } else {
-        $text="<p class=\"error\">"._('Impossible de poster le message')."</p>";
+        $text="<p class=\"error\">"._b_('Impossible de poster le message')."</p>";
       }
       break;
     case 'followupok':
@@ -117,9 +117,9 @@ if (isset($_REQUEST['action']) && (isset($_REQUEST['type'])) &&
         .wrap($body,"",$news['wrap']);
       $result = $nntp->post($message);
       if ($result) {
-        $text="<p class=\"normal\">"._('Message posté')."</p>";
+        $text="<p class=\"normal\">"._b_('Message posté')."</p>";
       } else {
-        $text="<p class=\"error\">"._('Impossible de poster le message')."</p>";
+        $text="<p class=\"error\">"._b_('Impossible de poster le message')."</p>";
       }
       break;
   }
@@ -145,13 +145,13 @@ displayshortcuts();
 <table class="<?php echo $css['bicol']?>" cellpadding="0" cellspacing="0" border="0">
   <tr>
     <th class="<?php echo $css['date']?>">
-      <?php echo _('Date'); ?>
+      <?php echo _b_('Date'); ?>
     </th>
     <th class="<?php echo $css['subject']?>">
-      <?php echo _('Sujet'); ?>
+      <?php echo _b_('Sujet'); ?>
     </th>
     <th class="<?php echo $css['from']?>">
-      <?php echo _('Auteur'); ?>
+      <?php echo _b_('Auteur'); ?>
     </th>
   </tr>
 <?php