Add gettext hooks in the templates
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Fri, 12 Jan 2007 16:08:44 +0000 (16:08 +0000)
committerx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Fri, 12 Jan 2007 16:08:44 +0000 (16:08 +0000)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@159 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/page.inc.php
banana/templates/banana-base.tpl
banana/templates/banana-boxlist.inc.tpl
banana/templates/banana-message.inc.tpl
banana/templates/banana-newmessage.inc.tpl
banana/templates/banana-thread.inc.tpl

index 4b24f4c..d4f13e9 100644 (file)
@@ -144,6 +144,7 @@ class BananaPage extends Smarty
         $this->register_function('link',    array($this, 'makeLink'));
         $this->register_function('imglink', array($this, 'makeImgLink'));
         $this->register_function('img',     array($this, 'makeImg'));
+        $this->register_modifier('b',       '_b_');
 
         $this->assign('errors',    $this->error);
         $this->assign('page',      $this->page);
index b74f786..d1f9cc6 100644 (file)
@@ -34,7 +34,7 @@
       {if $page eq 'forums'}
         {include file="banana-boxlist.inc.tpl" grouplist=$groups withstats=true}
         {if $newgroups|@count}
-        <p>Les nouveaux groupes suivants ont été créés depuis votre dernière visite</p>
+        <p>{"Les nouveaux groupes suivants ont été créés depuis votre dernière visite"|b}</p>
         {include file="banana-boxlist.inc.tpl" grouplist=$newgroups withstats=true}
         {/if}
       {elseif $page eq 'subscribe'}
       {elseif $page eq 'new'}
         {include file="banana-newmessage.inc.tpl"}
       {elseif $page eq 'cancel'}
-        <p class="error">Voulez-vous vraiment annuler ce message ?</p>
+        <p class="error">{"Voulez-vous vraiment annuler ce message ?"|b}</p>
         <form action="{url group=$group artid=$artid action=cancel}" method="post">
           <p class="center">
-            <input type="submit" name="cancel" value="Annuler !" />
+            <input type="submit" name="cancel" value="{"Annuler !"|b}" />
           </p>
         </form>
         {include file="banana-message.inc.tpl" noactions=true}
index 7c12488..bd5d073 100644 (file)
@@ -2,7 +2,7 @@
 {if $withsubs}
 <form action="{url action=subscribe}" method="post">
 <p style="text-align: center">
-  <input type="submit" name="validsubs" value="Valider" />
+  <input type="submit" name="validsubs" value="{"Valider"|b}" />
 </p>
 {/if}
 <table class="bicol">
     <th></th>
     {/if}
     {if $withstats}
-    <th>Total</th>
-    <th>Nouveaux</th>
+    <th>{"Total"|b}</th>
+    <th>{"Nouveaux"|b}</th>
     {/if}
-    <th>Nom</th>
-    <th>Description</th>
+    <th>{"Nom"|b}</th>
+    <th>{"Description"|b}</th>
   </tr>
   {foreach from=$groups key=name item=grp}
   <tr class="{cycle values="impair,pair"}">
@@ -35,7 +35,7 @@
 </table>
 {if $withsubs}
 <p style="text-align: center">
-  <input type="submit" name="validsubs" value="Valider" />
+  <input type="submit" name="validsubs" value="{"Valider"|b}" />
 </p>
 </form>
 {/if}
index 1c14cd2..2924c6c 100644 (file)
@@ -4,23 +4,23 @@
       {if !$noactions}
       <div class="menu">
         {if $spool->nextUnread($artid)}
-        {imglink group=$group artid=$spool->nextUnread($artid) img=next_unread alt="Message non-lu suivant" accesskey=u}{/if}
+        {imglink group=$group artid=$spool->nextUnread($artid) img=next_unread alt="Message non-lu suivant"|b accesskey=u}{/if}
         {if $spool->prevPost($artid)}
-        {imglink group=$group artid=$spool->prevPost($artid) img=prev alt="Message précédent" accesskey=a}{/if}
+        {imglink group=$group artid=$spool->prevPost($artid) img=prev alt="Message précédent"|b accesskey=a}{/if}
         {if $spool->nextPost($artid)}
-        {imglink group=$group artid=$spool->nextPost($artid) img=next alt="Message suivant" accesskey=z}{/if}
+        {imglink group=$group artid=$spool->nextPost($artid) img=next alt="Message suivant"|b accesskey=z}{/if}
         {if $spool->prevThread($artid)}
-        {imglink group=$group artid=$spool->prevThread($artid) img=prev_thread alt="Discussion précédente" accesskey=q}{/if}
+        {imglink group=$group artid=$spool->prevThread($artid) img=prev_thread alt="Discussion précédente"|b accesskey=q}{/if}
         {if $spool->nextThread($artid)}
-        {imglink group=$group artid=$spool->nextThread($artid) img=next_thread alt="Discussion suivante" accesskey=s}{/if}
+        {imglink group=$group artid=$spool->nextThread($artid) img=next_thread alt="Discussion suivante"|b accesskey=s}{/if}
       </div>
       <div class="action">
         {if $message->canSend()}
-        {imglink group=$group action="new" img=post alt="Nouveau messasge" accesskey=p}
-        {imglink group=$group artid=$artid action="new" img=reply alt="Répondre" accesskey=r}
+        {imglink group=$group action="new" img=post alt="Nouveau message"|b accesskey=p}
+        {imglink group=$group artid=$artid action="new" img=reply alt="Répondre"|b accesskey=r}
         {/if}
         {if $message->canCancel()}
-        {imglink group=$group artid=$artid action="cancel" img=cancel alt="Annuler" accesskey=c}
+        {imglink group=$group artid=$artid action="cancel" img=cancel alt="Annuler"|b accesskey=c}
         {/if}
       </div>
       {/if}
@@ -46,7 +46,7 @@
     <td class="hdr">Fichiers joints</td>
     <td colspan="2">
       {foreach from=$files item=file name=attachs}
-      {imglink img=save alt="Enregistrer" group=$group artid=$artid part=$file->getFilename() text=$file->getFilename()}{if !$smarty.foreach.attachs.last}, {/if}
+      {imglink img=save alt="Enregistrer"|b group=$group artid=$artid part=$file->getFilename() text=$file->getFilename()}{if !$smarty.foreach.attachs.last}, {/if}
       {/foreach}
     </td>
   </tr>
index 668592b..5ad87f4 100644 (file)
@@ -1,7 +1,7 @@
 <form {if $can_attach}enctype="multipart/form-data"{/if} action="{url group=$group artid=$artid action=new}" method="post" accept-charset="utf-8">
   <table class="bicol">
     <tr>
-      <th colspan="2">Composer un nouveau message</th>
+      <th colspan="2">{"Composer un nouveau message"|b}</th>
     </tr>
     {foreach from=$headers key=header item=values}
     <tr>
@@ -22,7 +22,7 @@
     </tr>
     {if $can_attach}
     <tr class="pair">
-      <td>Fichier joint</td>
+      <td>{"Fichier joint"|b}</td>
       <td>
         {if $maxfilesize}
         <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}" />
@@ -33,7 +33,7 @@
     {/if}
     <tr class="pair">
       <td colspan="2" class="center">
-        <input type="submit" name="sendmessage" value="Envoyer le message" />
+        <input type="submit" name="sendmessage" value="{"Envoyer le message"|b}" />
       </td>
     </tr>
   </table>
index 9265250..e555ea3 100644 (file)
     <th>
       {if $spool->nextUnread()}
       <div class="menu">
-        {imglink group=$group artid=$spool->nextUnread() img=next_unread alt="Message non-lu suivant" accesskey=u}
+        {imglink group=$group artid=$spool->nextUnread() img=next_unread alt="Message non-lu suivant"|b accesskey=u}
       </div>
       {/if}
-      Date
+      {"Date"|b}
     </th>
-    <th>Sujet</th>
+    <th>{"Sujet"|b}</th>
     <th>
       {if $protocole->canSend()}
       <div class="action">
-        {imglink group=$group action=new img=post alt="Nouveau message" accesskey=p}
+        {imglink group=$group action=new img=post alt="Nouveau message"|b accesskey=p}
       </div>
       {/if}
-      Auteur
+      {"Auteur"|b}
     </th>
     {else}
     <th colspan="3">
-      {link group=$group text=$group}
+      {"Aperçu de "|b}{link group=$group text=$group}
     </th>
     {/if}
   </tr>
@@ -42,7 +42,7 @@
   {else}
   <tr>
     <td colspan="3">
-      Aucun message dans ce forum
+      {"Aucun message dans ce forum"|b}
     </td>
   </tr>
   {/if}