]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Apply translation function on all labels
authorArthurHoaro <arthur@hoa.ro>
Sun, 7 Aug 2016 11:00:10 +0000 (13:00 +0200)
committerArthurHoaro <arthur@hoa.ro>
Sun, 7 Aug 2016 11:00:10 +0000 (13:00 +0200)
tpl/default/404.html
tpl/default/addlink.html
tpl/default/editlink.html
tpl/default/linklist.html
tpl/default/linklist.paging.html
tpl/default/loginform.html
tpl/default/page.header.html
tpl/default/tools.html

index a9738160e761bc4a03aa26120940c4e82bc86449..edc5ac4bd6c0c465eabf1c40dab8deb4445d9feb 100644 (file)
@@ -8,7 +8,7 @@
   {include="page.header"}
 </div>
 <div class="center" id="page404">
-  <h2>Sorry, nothing to see here.</h2>
+  <h2>{'Sorry, nothing to see here.'|t}</h2>
   <img src="img/sad_star.png">
   <p>{$error_message}</p>
 </div>
index 13adeb49d2f2f63374263bb1ca07b943f92c0e2a..8e64064f6c2204fbaa70d8103c8fbb3e6d75182a 100644 (file)
@@ -8,13 +8,13 @@
 <div class="pure-g">
   <div class="pure-u-lg-1-3 pure-u-1-8"></div>
   <div id="addlink-form" class="page-form pure-u-lg-1-3 pure-u-3-4">
-    <h2>Shaare a new link</h2>
+    <h2>{"Shaare a new link"|t}</h2>
     <form method="GET" action="" name="addform" class="addform">
       <div>
-        <input type="text" name="post">
+        <input type="text" name="post" placeholder="{'URL or leave empty to post a note'|t}">
       </div>
       <div>
-        <input type="submit" value="Add link">
+        <input type="submit" value="{'Add link'|t}">
       </div>
     </form>
   </div>
index 0630b4f158ac18f76a63ea7539aca5c27d7fec48..a0ea91b20bfbaf5e01dcb28e523c33f0e7e0ab08 100644 (file)
   <div id="editlinkform" class="pure-g">
     <div class="pure-u-lg-1-5 pure-u-1-8"></div>
     <form method="post" name="linkform" class="page-form pure-u-lg-3-5 pure-u-3-4" >
-      <h2>Shaare</h2>
+      <h2>{'Shaare'|t}</h2>
       <input type="hidden" name="lf_linkdate" value="{$link.linkdate}">
       <div>
-        <label for="lf_url">URL</label>
+        <label for="lf_url">{'URL'|t}</label>
       </div>
       <div>
         <input type="text" name="lf_url" id="lf_url" value="{$link.url}" class="lf_input">
       </div>
       <div>
-      <label for="lf_title">Title</label>
+      <label for="lf_title">{'Title'|t}</label>
       </div>
       <div>
         <input type="text" name="lf_title" id="lf_title" value="{$link.title}" class="lf_input">
       </div>
       <div>
-        <label for="lf_description">Description</label>
+        <label for="lf_description">{'Description'|t}</label>
       </div>
       <div>
         <textarea name="lf_description" id="lf_description">{$link.description}</textarea>
       </div>
       <div>
-        <label for="lf_tags">Tags</label>
+        <label for="lf_tags">{'Tags'|t}</label>
       </div>
       <div>
         <input type="text" name="lf_tags" id="lf_tags" value="{$link.tags}" class="lf_input"
@@ -43,7 +43,7 @@
         {if="($link_is_new && $default_private_links) || $link.private == true"}
           checked="checked"
         {/if}>
-        &nbsp;<label for="lf_private">Private</label>
+        &nbsp;<label for="lf_private">{'Private'|t}</label>
       </div>
 
       <div id="editlink-plugins">
@@ -53,9 +53,9 @@
       </div>
 
       <div>
-        <input type="submit" value="Save" name="save_edit">
+        <input type="submit" value="{'Save'|t}" name="save_edit">
         {if="!$link_is_new"}
-          <input type="submit" value="Delete" name="delete_link" class="delete-link">
+          <input type="submit" value="{'Delete'|t}" name="delete_link" class="delete-link">
         {/if}
       </div>
 
index 19a0c3c75b645ba06b22779903a16f41d3cd4c2e..0a46c8761e92192231f1bb5e765abd9cb71ebf8d 100644 (file)
     <div class="pure-g pure-alert pure-alert-error search-result">
       <div class="pure-u-2-24"></div>
       <div class="pure-u-20-24">
-        <div id="searchcriteria">Nothing found.</div>
+        <div id="searchcriteria">{'Nothing found.'|t}</div>
       </div>
     </div>
   {elseif="!empty($search_term) or !empty($search_tags)"}
     <div class="pure-g pure-alert pure-alert-success search-result">
       <div class="pure-u-2-24"></div>
       <div class="pure-u-20-24">
-        {$result_count} results
+        {function="t('%s result', '%s results', $result_count)"}
         {if="!empty($search_term)"}
-          for <em><strong>{$search_term}</strong></em>
+          {'for'|t} <em><strong>{$search_term}</strong></em>
         {/if}
         {if="!empty($search_tags)"}
           {$exploded_tags=explode(' ', $search_tags)}
-          tagged
+          {'tagged'|t}
           {loop="$exploded_tags"}
-              <span class="label label-tag" title="Remove tag">
+              <span class="label label-tag" title="{'Remove tag'|t}">
                 <a href="?removetag={function="urlencode($value)"}">{$value}<span class="remove"><i class="fa fa-times"></i></span></a>
               </span>
           {/loop}
           <div class="linklist-item-title">
             {if="isLoggedIn()"}
               <div class="linklist-item-editbuttons">
-                <a href="#" title="Fold" class="fold-button"><i class="fa fa-chevron-up"></i></a>
-                <a href="?edit_link={$value.linkdate}" title="Edit"><i class="fa fa-pencil-square-o"></i></a>
-                <a href="?delete_link={$value.linkdate}&amp;token={$token}" title="Delete" class="delete-link">
+                <!-- FIXME! JS translation -->
+                <a href="#" title="{'Fold'|t}" class="fold-button"><i class="fa fa-chevron-up"></i></a>
+                <a href="?edit_link={$value.linkdate}" title="{'Edit'|t}"><i class="fa fa-pencil-square-o"></i></a>
+                <a href="?delete_link={$value.linkdate}&amp;token={$token}" title="{'Delete'|t}" class="delete-link">
                   <i class="fa fa-trash"></i>
                 </a>
               </div>
@@ -74,7 +75,7 @@
                 {/if}
 
                 {if="$value.private"}
-                  <span class="label label-private">Private</span>
+                  <span class="label label-private">{'Private'|t}</span>
                 {/if}
 
                 {$value.title}
 
             <div class="pure-g">
               <div class="linklist-item-infos-dateblock pure-u-lg-3-8 pure-u-1">
-                <a href="?{$value.shorturl}" title="Permalink">
+                <a href="?{$value.shorturl}" title="{'Permalink'|t}">
                   {if="!$hide_timestamps || isLoggedIn()"}
                     <span class="linkdate">
                       <i class="fa fa-clock-o"></i>
                       {function="strftime('%d %B %Y %H:%M', $value.timestamp)"} &middot;
                     </span>
                   {/if}
-                  permalink &middot;
+                  {'permalink'|t} &middot;
                 </a>
 
                 {$link_plugin_counter=count($value.link_plugin)}
index 9a3fd7a883655fa1b23b8d74c0c1da8c7bd360e6..3e5a58688ae0459eec016d579c1df316d46c00fe 100644 (file)
@@ -6,10 +6,10 @@
         <div class="linklist-filters pure-u-1-3">
           {if="isLoggedIn() or !empty($action_plugin)"}
             <span class="linklist-filters-text">
-              Filters
+              {'Filters'|t}
             </span>
             {if="isLoggedIn()"}
-              <a href="?privateonly" title="Click to see all links"
+              <a href="?privateonly" title="{'Filter private links'|t}"
                  class={if="$privateonly"}"filter-on"{else}"filter-off"{/if}
               ><i class="fa fa-key"></i></a>
             {/if}
@@ -43,7 +43,7 @@
         </div>
 
         <div class="linksperpage pure-u-1-3">
-          <div class="pure-u-0 pure-u-lg-visible">Links per page</div>
+          <div class="pure-u-0 pure-u-lg-visible">{'Links per page'|t}</div>
           <a href="?linksperpage=20">20</a>
           <a href="?linksperpage=50">50</a>
           <a href="?linksperpage=100">100</a>
index e6d7dea59796c6cd9c2029df504f7ea21ca86967..f28e6a47d498ffd1a1acf4b1245be6b270bc017d 100644 (file)
@@ -9,7 +9,7 @@
 <div class="pure-g pure-alert pure-alert-error pure-alert-closable center">
   <div class="pure-u-2-24"></div>
   <div class="pure-u-20-24">
-    You have been banned after too many failed login attempts. Try again later.
+    {'You have been banned after too many failed login attempts. Try again later.'|t}
   </div>
   <div class="pure-u-2-24">
     <i class="fa fa-times pure-alert-close"></i>
     <div class="pure-u-lg-1-3 pure-u-1-8"></div>
     <div id="login-form" class="page-form pure-u-lg-1-3 pure-u-3-4">
       <form method="post" name="loginform">
-        <h2>Login</h2>
+        <h2>{'Login'|t}</h2>
         <div>
-          <input type="text" name="login" placeholder="Username" tabindex="3">
+          <input type="text" name="login" placeholder="{'Username'|t}" tabindex="20">
         </div>
         <div>
-          <input type="password" name="password" placeholder="Password" tabindex="4">
+          <input type="password" name="password" placeholder="{'Password'|t}" tabindex="21">
         </div>
         <div class="remember-me">
-          <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="5">
-          <label for="longlastingsession">Remember me</label>
+          <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="22">
+          <label for="longlastingsession">{'Remember me'|t}</label>
         </div>
         <div>
-          <input type="submit" value="Login" class="bigbutton" tabindex="6">
+          <input type="submit" value="{'Login'|t}" class="bigbutton" tabindex="23">
         </div>
         <input type="hidden" name="token" value="{$token}">
         {if="$returnurl"}<input type="hidden" name="returnurl" value="{$returnurl}">{/if}
index bf5a65e8a51d4dd5b0f7b958f863d99a4125fcf3..335ef686c23eaa8fe07f2de5e946d44b16b59e09 100644 (file)
             <i class="fa fa-home"></i>
           </a>
         </li>
-        {if="isLoggedIn()"}
-          <li class="pure-menu-item">
-            <a href="?do=addlink" class="pure-menu-link">Shaare</a>
-          </li>
-          <li class="pure-menu-item">
-            <a href="?do=tools" class="pure-menu-link">Tools</a>
-          </li>
-
-        {elseif="$openshaarli"}
+        {if="isLoggedIn() || $openshaarli"}
           <li class="pure-menu-item">
-            <a href="?do=addlink" class="pure-menu-link">Shaare</a>
+            <a href="?do=addlink" class="pure-menu-link">{'Shaare'|t}</a>
           </li>
           <li class="pure-menu-item">
-            <a href="?do=tools" class="pure-menu-link">Tools</a>
+            <a href="?do=tools" class="pure-menu-link">{'Tools'|t}</a>
           </li>
         {/if}
         <li class="pure-menu-item pure-u-lg-0">
-          <a href="?do=atom{$searchcrits}" class="pure-menu-link">RSS Feed</a>
+          <a href="?do=atom{$searchcrits}" class="pure-menu-link">{'RSS Feed'|t}</a>
         </li>
         <li class="pure-menu-item">
-          <a href="?do=tagcloud" class="pure-menu-link">Tag cloud</a>
+          <a href="?do=tagcloud" class="pure-menu-link">{'Tag cloud'|t}</a>
         </li>
         <li class="pure-menu-item">
-          <a href="?do=picwall{$searchcrits}" class="pure-menu-link">Picture wall</a>
+          <a href="?do=picwall{$searchcrits}" class="pure-menu-link">{'Picture wall'|t}</a>
         </li>
         <li class="pure-menu-item">
-          <a href="?do=daily" class="pure-menu-link">Daily</a>
+          <a href="?do=daily" class="pure-menu-link">{'Daily'|t}</a>
         </li>
         <!-- FIXME! update plugin system to handle this -->
         {loop="$plugins_header.buttons_toolbar"}
         {/loop}
         {if="isLoggedIn()"}
           <li class="pure-menu-item">
-            <a href="?do=logout" class="pure-menu-link">Logout</a>
+            <a href="?do=logout" class="pure-menu-link">{'Logout'|t}</a>
           </li>
         {else}
           <li class="pure-menu-item">
-            <a href="?do=login" class="pure-menu-link">Login</a>
+            <a href="?do=login" class="pure-menu-link">{'Login'|t}</a>
           </li>
         {/if}
       </ul>
         <ul class="pure-menu-list">
           {if="!isLoggedIn()"}
             <li class="pure-menu-item">
-              <a href="?do=login" class="pure-menu-link" id="login-button" title="Login">
+              <a href="?do=login" class="pure-menu-link" id="login-button" title="{'Login'|t}">
                 <i class="fa fa-user"></i>
               </a>
             </li>
           {else}
             <li class="pure-menu-item">
-              <a href="?do=logout" class="pure-menu-link" title="Logout">
+              <a href="?do=logout" class="pure-menu-link" title="{'Logout'|t}">
                 <i class="fa fa-sign-out"></i>
               </a>
             </li>
           {/if}
           <li class="pure-menu-item">
-            <a href="?do=atom{$searchcrits}" class="pure-menu-link" title="ATOM Feed">
+            <a href="?do=atom{$searchcrits}" class="pure-menu-link" title="{'RSS Feed'|t}">
               <i class="fa fa-rss"></i>
             </a>
           </li>
   </h1>
   <div id="linkcount">
     {if="!empty($linkcount)"}
-      <span class="strong">{$linkcount}</span> shaares
+      <span class="strong">{$linkcount}</span> {function="t('shaare', 'shaares', $linkcount)"}
       {if="$privateLinkcount>0"}
-        - <span class="strong">{$privateLinkcount}</span> private links
+        - <span class="strong">{$privateLinkcount}</span> {function="t('private link', 'private links', $privateLinkcount)"}
       {/if}
     {/if}
   </div>
 
   <div id="search">
     <form method="GET" class="searchform" name="searchform">
-      <input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="Search text"
+      <input type="text" tabindex="1" id="searchform_value" name="searchterm" placeholder="{'Search text'|t}"
         {if="!empty($search_term)"}
              value="{$search_term}"
         {/if}
       <button type="submit" class="search-button"><i class="fa fa-search"></i></button>
     </form>
     <form method="GET" class="tagfilter" name="tagfilter">
-      <input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="Filter by tag"
+      <input type="text" tabindex="2" name="searchtags" id="tagfilter_value" placeholder="{'Filter by tag'|t}"
         {if="!empty($search_tags)"}
           value="{$search_tags}"
         {/if}
 <div id="content">
   <form method="post" name="loginform">
     <div id="header-login-form">
-      <input type="text" name="login" placeholder="Username" tabindex="3">
-      <input type="password" name="password" placeholder="Password" tabindex="5">
+      <input type="text" name="login" placeholder="{'Username'|t}" tabindex="3">
+      <input type="password" name="password" placeholder="{'Password'|t}" tabindex="5">
       <div class="remember-me">
         <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="6">
-        <label for="longlastingsession">Remember me</label>
+        <label for="longlastingsession">{'Remember me'|t}</label>
       </div>
       <input type="hidden" name="token" value="{$token}">
       <input type="hidden" name="returnurl">
     <div class="pure-u-2-24"></div>
     {if="$newVersion"}
       <div class="pure-u-20-24">
-        Shaarli {$newVersion} is
-        <a href="https://github.com/shaarli/Shaarli/releases">available</a>.
+        Shaarli {$newVersion}
+        <a href="https://github.com/shaarli/Shaarli/releases">{'is available'|t}</a>.
       </div>
     {/if}
     {if="$versionError"}
       <div class="pure-u-20-24">
-        Error: {$versionError}
+        {'Error'|t}: {$versionError}
       </div>
     {/if}
     <div class="pure-u-2-24">
   </div>
 {/if}
 
-
-{if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}
-    {ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
-{else}
-
-{/if}
-
-
 {if="!empty($plugin_errors) && isLoggedIn()"}
     <ul class="errors">
         {loop="plugin_errors"}
index f5e8321b029890c704acd466f9a64fce539c2a78..a2132bd5c32cb7f1894a69da4c9554d0fb8a7355 100644 (file)
   <div class="pure-u-lg-1-3 pure-u-3-4 page-form">
     <h2>Settings</h2>
     <div class="tools-item">
-      <a href="?do=configure" title="Change Shaarli settings: title, timezone, etc.">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Configure your Shaarli</span>
+      <a href="?do=configure" title="{'Change Shaarli settings: title, timezone, etc.'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Configure your Shaarli'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="?do=pluginadmin" title="Enable, disable and configure plugins">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Plugin administration</span>
+      <a href="?do=pluginadmin" title="{'Enable, disable and configure plugins'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Plugin administration'|t}</span>
       </a>
     </div>
     {if="!$openshaarli"}
       <div class="tools-item">
-        <a href="?do=changepasswd" title="Change your password">
-          <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Change password</span>
+        <a href="?do=changepasswd" title="{'Change your password'|t}">
+          <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Change password'|t}</span>
         </a>
       </div>
     {/if}
     <div class="tools-item">
-      <a href="?do=changetag" title="Rename or delete a tag in all links">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Manage tags</span>
+      <a href="?do=changetag" title="{'Rename or delete a tag in all links'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Manage tags'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="?do=import" title="Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, delicious...)">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Import links</span>
+      <a href="?do=import"
+         title="{'Import Netscape HTML bookmarks (as exported from Firefox, Chrome, Opera, delicious...)'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Import links'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a href="?do=export" title="<!--Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)-->">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Export database</span>
+      <a href="?do=export"
+         title="{'Export Netscape HTML bookmarks (which can be imported in Firefox, Chrome, Opera, delicious...)'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Export database'|t}</span>
       </a>
     </div>
 
   <div class="pure-u-lg-1-3 pure-u-3-4 page-form">
     <h2>Bookmarklets</h2>
     <p>
-      Drag one of these button to your bookmarks toolbar or right-click it and "Bookmark This Link",
-      then click on the bookmarklet in any page you want to share.
+      {'Drag one of these button to your bookmarks toolbar or right-click it and "Bookmark This Link"'|t},
+      {'then click on the bookmarklet in any page you want to share.'|t}
     </p>
     <div class="tools-item">
-      <a title="Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link,
-                then click ✚Shaare link button in any page you want to share"
+      <a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t},
+                {'then click ✚Shaare link button in any page you want to share'|t}"
          onclick="return alertBookmarklet();"
          href="javascript:(
           function(){
             );
           }
         )();">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ Shaare link</span>
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Shaare link'|t}</span>
       </a>
     </div>
     <div class="tools-item">
-      <a title="Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link,
-                Then click ✚Add Note button anytime to start composing a private Note (text post) to your Shaarli"
+      <a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t},
+                {'Then click ✚Add Note button anytime to start composing a private Note (text post) to your Shaarli'|t}"
          onclick="return alertBookmarklet();"
          href="?private=1&amp;post=">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ Add Note</span>
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add Note'|t}</span>
       </a>
     </div>
   </div>
   <div class="pure-u-lg-1-3 pure-u-1-8"></div>
   <div class="pure-u-lg-1-3 pure-u-3-4 page-form">
     <h2>Firefox Social API</h2>
-    <p>You need to browse your Shaarli over <strong>HTTPS</strong> to use this functionality.</p>
+    <p>{'You need to browse your Shaarli over <strong>HTTPS</strong> to use this functionality.'|t}</p>
 
     <div class="tools-item">
-      <a title="Click on this button to add Shaarli to the 'Share this page' button in Firefox"
+      <a title="{'Click on this button to add Shaarli to the 'Share this page' button in Firefox"
          onclick="activateFirefoxSocial(this)">
-      <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ Add to Firefox social</span>
+      <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add to'|t} Firefox Social</span>
       </a>
     </div>
   </div>
 <div class="pure-g">
   <div class="pure-u-lg-1-3 pure-u-1-8"></div>
   <div class="pure-u-lg-1-3 pure-u-3-4 page-form">
-    <h2>3rd party</h2>
+    <h2>{'3rd party'|t}</h2>
     <div class="tools-item">
-      <a href="https://addons.mozilla.org/fr/firefox/addon/shaarli/" title="Firefox Plugin">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Firefox plugin</span>
+      <a href="https://addons.mozilla.org/fr/firefox/addon/shaarli/" title="Firefox {'Plugin'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Firefox {'plugin'|t}</span>
       </a>
     </div>
     <div class="tools-item">
       <a href="https://chrome.google.com/webstore/detail/shiny-shaarli/hajdfkmbdmadjmmpkkbbcnllepomekin"
-         title="Chrome Plugin">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Chrome plugin</span>
+         title="Chrome {'Plugin'|t}">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Chrome {'plugin'|t}</span>
       </a>
     </div>
   </div>
     // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
     var data = {
       name: "{$shaarlititle}",
-      description: "The personal, minimalist, super-fast, no-database delicious clone.",
+      description: "The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community.",
       author: "Shaarli",
       version: "1.0.0",
 
   }
 
   function alertBookmarklet() {
-    alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');
+    alert({"'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link'"|t});
     return false;
   }
 </script>