Ticket #62: i18n_withJs.6.patch

File i18n_withJs.6.patch, 97.2 KB (added by mauser, 4 years ago)

TranslateException, translation strings for exceptions in plugins/

  • lang/en.php

     
    22$translations = array( 
    33        'General_Unknown' => 'Unknown', 
    44        'General_Required' => '%s required', 
    5  
    6         'Login_LoginPasswordNotCorrect' => 'Username & Password not correct', 
    7         'Login_Login' => 'Username', 
    8         'Login_Password' => 'Password', 
    9         'Login_LogIn' => 'Log in', 
    10          
    11 ); 
    12  brakuje znaku końca linii na końcu pliku  
     5        'General_Error' => 'Error', 
     6        'General_Warning' => 'Warning', 
     7        'General_BackToHomepage' => 'Back to Piwik homepage', 
     8        'General_Yes' => 'Yes', 
     9        'General_No' => 'No', 
     10        'General_Delete' => 'Delete', 
     11        'General_Edit' => 'Edit', 
     12        'General_Ok' => 'Ok', 
     13        'General_Close' => 'Close', 
     14        'General_Logout' => 'Logout', 
     15        'General_Done' => 'Done', 
     16        'General_LoadingData' => 'Loading data...', 
     17        'General_ErrorRequest' => 'Oops… problem during the request, please try again.', 
     18        'General_Next' => 'Next', 
     19        'General_Previous' => 'Previous', 
     20        'General_Table' => 'Table', 
     21        'General_Piechart' => 'Piechart', 
     22        'General_TagCloud' => 'Tag Cloud', 
     23        'General_VBarGraph' => 'Vertial bar graph', 
     24        'General_GraphData' => 'Graph data', 
     25        'General_Refresh' => 'Refresh the page', 
     26); 
  • lang/fr.php

     
    22$translations = array( 
    33        'General_Unknown' => 'Inconnu', 
    44        'General_Required' => '%s requis', 
    5  
    6         'Login_LoginPasswordNotCorrect' => 'Utilisateur & Mot de passe not correct', 
    7         'Login_Login' => 'Utilisateur', 
    8         'Login_Password' => 'Mot de passe', 
    9         'Login_LogIn' => 'Log in', 
    10          
    115); 
  • plugins/VisitFrequency/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'VisitFrequency_Evolution' => 'Evolution over the period', 
     4        'VisitFrequency_ReturnVisits' => '%s returning visits', 
     5        'VisitFrequency_ReturnActions' => '%s actions by the returning visits', 
     6        'VisitFrequency_ReturnMaxActions' => '%s maximum actions by a returning visit', 
     7        'VisitFrequency_ReturnTotalTime' => '%s total time spent by returning visits', 
     8        'VisitFrequency_ReturnBounces' => '%s times that a returning visit has bounced (left the site after one page)', 
     9 
     10); 
     11 
  • plugins/VisitFrequency/index.tpl

     
    22<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script> 
    33 
    44<a name="evolutionGraph" graphId="VisitFrequencygetLastVisitsReturningGraph"></a> 
    5 <h2>Evolution over the period</h2> 
     5<h2>{'VisitFrequency_Evolution'|translate}</h2> 
    66{$graphEvolutionVisitFrequency} 
    77 
    88{include file=VisitFrequency/sparklines.tpl} 
    99         
    10 {postEvent name="template_footerVisitsFrequency"} 
    11  brakuje znaku końca linii na końcu pliku  
     10{postEvent name="template_footerVisitsFrequency"} 
  • plugins/VisitFrequency/VisitFrequency.php

     
    1818        public function getInformation() 
    1919        { 
    2020                $info = array( 
    21                         'name' => 'VisitorFrequency', 
     21                        'name' => 'VisitFrequency', 
    2222                        'description' => 'VisitorFrequency', 
    2323                        'author' => 'Piwik', 
    2424                        'homepage' => 'http://piwik.org/', 
    2525                        'version' => '0.1', 
     26                        'translationAvailable' => true 
    2627                ); 
    2728                 
    2829                return $info; 
  • plugins/VisitFrequency/sparklines.tpl

     
    11 
    2         <p><img class="sparkline" src="{$urlSparklineNbVisitsReturning}" /> <span><strong>{$nbVisitsReturning} </strong> returning visits</span></p> 
    3         <p><img class="sparkline" src="{$urlSparklineNbActionsReturning}" /> <span><strong>{$nbActionsReturning} </strong> actions by the returning visits</span></p> 
    4         <p><img class="sparkline" src="{$urlSparklineMaxActionsReturning}" /> <span><strong>{$maxActionsReturning} </strong> maximum actions by a returning visit</span></p> 
    5         <p><img class="sparkline" src="{$urlSparklineSumVisitLengthReturning}" /> <span><strong>{$sumVisitLengthReturning|sumtime} </strong> total time spent by returning visits</span></p> 
    6         <p><img class="sparkline" src="{$urlSparklineBounceCountReturning}" /> <span><strong>{$bounceCountReturning} </strong> times that a returning visit has bounced (left the site after one page) </span></p> 
     2        <p><img class="sparkline" src="{$urlSparklineNbVisitsReturning}" /> <span> 
     3        {'VisitFrequency_ReturnVisits'|translate:"<strong>$nbVisitsReturning</strong>"}</span></p> 
     4        <p><img class="sparkline" src="{$urlSparklineNbActionsReturning}" /> <span> 
     5        {'VisitFrequency_ReturnActions'|translate:"<strong>$nbActionsReturning</strong>"}</span></p> 
     6        <p><img class="sparkline" src="{$urlSparklineMaxActionsReturning}" /> <span> 
     7         {'VisitFrequency_ReturnMaxActions'|translate:"<strong>$maxActionsReturning</strong>"}</span></p> 
     8        <p><img class="sparkline" src="{$urlSparklineSumVisitLengthReturning}" /> <span> 
     9         {assign var=sumtimeVisitLengthReturning value=$sumVisitLengthReturning|sumtime} 
     10         {'VisitFrequency_ReturnTotalTime'|translate:"<strong>$sumtimeVisitLengthReturning</strong>"}</span></p> 
     11        <p><img class="sparkline" src="{$urlSparklineBounceCountReturning}" /> <span> 
     12         {'VisitFrequency_ReturnBounces'|translate:"<strong>$bounceCountReturning</strong>"} </span></p> 
  • plugins/SitesManager/API.php

     
    270270 
    271271                if($nbSites == 1) 
    272272                { 
    273                         throw new Exception("It is not possible to delete this website as it is the only registered website.  
    274                         Add a new website first, then delete this one."); 
     273                        throw new Exception(Piwik_TranslateException("SitesManager_ExceptionDeleteSite")); 
    275274                } 
    276275                 
    277276                $db = Zend_Registry::get('db'); 
     
    300299                if(!is_array($urls) 
    301300                        || count($urls) == 0) 
    302301                { 
    303                         throw new Exception("You must specify at least one URL for the site."); 
     302                        throw new Exception(Piwik_TranslateException("SitesManager_ExceptionNoUrl")); 
    304303                } 
    305304        } 
    306305 
     
    477476        { 
    478477                if(empty($siteName)) 
    479478                { 
    480                         throw new Exception("The site name can't be empty."); 
     479                        throw new Exception(Piwik_TranslateException("SitesManager_ExceptionEmptyName")); 
    481480                } 
    482481        } 
    483482 
     
    493492                {                        
    494493                        if(!self::isValidUrl($url)) 
    495494                        { 
    496                                 throw new Exception("The url '$url' is not a valid URL."); 
     495                                throw new Exception(sprintf(Piwik_TranslateException("SitesManager_ExceptionInvalidUrl"),$url)); 
    497496                        } 
    498497                } 
    499498        } 
  • plugins/SitesManager/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'SitesManager_Sites' => 'Sites', 
     4        'SitesManager_JsCode' => 'Javascript code', 
     5        'SitesManager_JsCodeHelp' => 'Here is the javascript code to include on all your pages', 
     6        'SitesManager_ShowJsCode' => 'show code', 
     7        'SitesManager_NoWebsites' => 'You don\'t have any website to administrate.', 
     8        'SitesManager_AddSite' => 'Add a new Site', 
     9        'SitesManager_Id' => 'Id', 
     10        'SitesManager_Name' => 'Name', 
     11        'SitesManager_Urls' => 'URLs', 
     12 
     13        'SitesManager_DeleteConfirm_js' => 'Are you sure you want to delete the website %s?', 
     14         
     15        'SitesManager_ExceptionDeleteSite' => 'It is not possible to delete this website as it is the only registered website. Add a new website first, then delete this one.', 
     16        'SitesManager_ExceptionNoUrl' => 'You must specify at least one URL for the site.', 
     17        'SitesManager_ExceptionEmptyName' => 'The site name can\'t be empty.', 
     18        'SitesManager_ExceptionInvalidUrl' => 'The url \'%s\' is not a valid URL.', 
     19); 
  • plugins/SitesManager/SitesManager.php

     
    2424                        'author' => 'Piwik', 
    2525                        'homepage' => 'http://piwik.org/', 
    2626                        'version' => '0.1', 
    27                         'translationAvailable' => false, 
     27                        'translationAvailable' => true, 
    2828                ); 
    2929                 
    3030                return $info; 
  • plugins/SitesManager/Controller.php

     
    3939                 
    4040                echo $view->render(); 
    4141        } 
    42 } 
    43  brakuje znaku końca linii na końcu pliku  
     42} 
  • plugins/SitesManager/templates/SitesManager.tpl

     
     1{loadJavascriptTranslations modules='SitesManager'} 
     2 
    13<script type="text/javascript" src="plugins/SitesManager/templates/SitesManager.js"></script> 
    24 
    3 <h2>Sites</h2> 
     5<h2>{'SitesManager_Sites'|translate}</h2> 
    46<div id="ajaxError" style="display:none"></div> 
    5 <div id="ajaxLoading" style="display:none">Loading... <img src="themes/default/loading.gif"></div> 
     7<div id="ajaxLoading" style="display:none">{'General_LoadingData'|translate} <img src="themes/default/loading.gif"></div> 
    68 
    79{if $sites|@count == 0} 
    8         You don't have any website to administrate. 
     10        {'SitesManager_NoWebsites'|translate} 
    911{else} 
    1012        <table id="editSites" border=1 cellpadding="10"> 
    1113                <thead> 
    1214                        <tr> 
    13                         <th>Id</th> 
    14                         <th>Name</th> 
    15                         <th>URLs</th> 
     15                        <th>{'SitesManager_Id'|translate}</th> 
     16                        <th>{'SitesManager_Name'|translate}</th> 
     17                        <th>{'SitesManager_Urls'|translate}</th> 
    1618                        <th> </th> 
    1719                        <th> </th> 
    18                         <th> Javascript code </th> 
     20                        <th> {'SitesManager_JsCode'|translate} </th> 
    1921                        </tr> 
    2022                </thead> 
    2123                <tbody> 
     
    2527                                <td id="siteName" class="editableSite">{$site.name}</td> 
    2628                                <td id="urls" class="editableSite">{foreach from=$site.alias_urls item=url}{$url}<br>{/foreach}</td>        
    2729                                <td><img src='plugins/UsersManager/images/edit.png' class="editSite" id="row{$i}" href='#'></td> 
    28                                 <td><img src='plugins/UsersManager/images/remove.png' class="deleteSite" id="row{$i}" value="Delete"></td> 
    29                                 <td><a href='{url actionToLoad=displayJavascriptCode idsite=$site.idsite}'>Show Code</a></td> 
     30                                <td><img src='plugins/UsersManager/images/remove.png' class="deleteSite" id="row{$i}" value="{'General_Delete'|translate}"></td> 
     31                                <td><a href='{url actionToLoad=displayJavascriptCode idsite=$site.idsite}'>{'SitesManager_ShowJsCode'|translate}</a></td> 
    3032                        </tr> 
    3133                        {/foreach} 
    3234                         
    3335                </tbody> 
    3436        </table> 
    35         <div id="addRowSite"><img src='plugins/UsersManager/images/add.png'> <a href="#">Add a new Site</a></div> 
     37        <div id="addRowSite"><img src='plugins/UsersManager/images/add.png'> <a href="#">{'SitesManager_AddSite'|translate}</a></div> 
    3638{/if} 
    3739 
  • plugins/SitesManager/templates/DisplayJavascriptCode.tpl

     
    1 <p>Here is the javascript code to include on all your pages:</p> 
     1<p>{'SitesManager_JsCodeHelp'|translate}:</p> 
    22 
    33<code> 
    44{$jsTag} 
  • plugins/SitesManager/templates/SitesManager.js

     
    108108                        var idRow = $(this).attr('id'); 
    109109                        var nameToDelete = $(this).parent().parent().find('#siteName').html(); 
    110110                        var idsiteToDelete = $(this).parent().parent().find('#idSite').html(); 
    111                         if(confirm('Are you sure you want to delete the website "'+nameToDelete+'" (idSite = '+idsiteToDelete+')?')) 
     111                        if(confirm(_pk_translate('SitesManager_DeleteConfirm','Are you sure you want to delete the website %s','"'+nameToDelete+'" (idSite = '+idsiteToDelete+')')) ) 
    112112                        { 
    113113                                $.ajax( getDeleteSiteAJAX( idsiteToDelete ) ); 
    114114                        } 
  • plugins/Dashboard/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'Dashboard_AddWidget' => 'Add a widget...', 
     4        'Dashboard_DeleteWidgetConfirm' => 'Are you sure you want to delete this widget from the dashboard?', 
     5        'Dashboard_SelectWidget' => 'Select the widget to add in the dashboard', 
     6        'Dashboard_AddPreviewedWidget' => 'Add previewed widget to the dashboard', 
     7        'Dashboard_WidgetPreview' => 'Widget preview',   
     8 
     9        'Dashboard_TitleWidgetInDashboard_js' => 'Widget already in dashboard', 
     10        'Dashboard_TitleClickToAdd_js' => 'Click to add to dashboard', 
     11        'Dashboard_LoadingPreview_js' => 'Loading preview, please wait...', 
     12        'Dashboard_LoadingWidget_js' => 'Loading widget, please wait...', 
     13        'Dashboard_WidgetNotFound_js' => 'Widget not found', 
     14); 
  • plugins/Dashboard/Dashboard.php

     
    2020                        'author' => 'Piwik', 
    2121                        'homepage' => 'http://piwik.org/', 
    2222                        'version' => '0.1', 
     23                        'translationAvailable' => true, 
    2324                ); 
    2425        } 
    2526 
  • plugins/Dashboard/templates/Dashboard.js

     
    1  
    2  
    3 //label and string used in the javascript 
    4 //overide this object for dataTable_translation 
    5 if(typeof dashboard_translation == "undefined") 
    6 { 
    7         var dashboard_translation = { 
    8                 titleWidgetInDashboard:         'Widget already in dashboard', 
    9                 titleClickToAdd:                        'Click to add to dashboard', 
    10                 loadingPreview:                         'Loading preview, please wait...', 
    11                 loadingWidget:                          'Loading widget, please wait...', 
    12                 widgetNotFound:                         'Widget not found' 
    13         }; 
    14 } 
    15  
    161//there is a problem with loop for-in when we extends javascript Array 
    172//so I prefer using a separate function to do this 
    183function contains(array, searchElem) { 
     
    158143                                                //format the div for upcomming ajax loading and set a temporary content 
    159144                                                $(this) .attr('plugin', plugin) 
    160145                                                                .attr('id', action) 
    161                                                                 .html('<div id="previewLoading"><img src="themes/default/loading.gif" />'+ dashboard_translation.loadingPreview +'</div>').show(); 
     146                                                                .html('<div id="previewLoading"><img src="themes/default/loading.gif" />'+ _pk_translate('Dashboard_LoadingPreview','Loading preview, please wait...') +'</div>').show(); 
    162147                                                self.dashboard.ajaxLoading(plugin, action); 
    163148                                        } 
    164149                                }); 
     
    208193                        if(contains(widgets, plugin+'.'+action)) 
    209194                        { 
    210195                                $(this).addClass('menuDisabled'); 
    211                                 $(this).attr('title', dashboard_translation.titleWidgetInDashboard); 
     196                                $(this).attr('title', _pk_translate('Dashboard_TitleWidgetInDashboard','Widget already in dashboard')); 
    212197                        } 
    213198                        else 
    214199                        { 
    215200                                $(this).removeClass('menuDisabled'); 
    216                                 $(this).attr('title', dashboard_translation.titleClickToAdd); 
     201                                $(this).attr('title', _pk_translate('Dashboard_TitleClickToAdd','Click to add to dashboard')); 
    217202                        } 
    218203                }); 
    219204        }, 
     
    343328                if(typeof onTop == "undefined") 
    344329                        onTop = false; 
    345330                 
    346                 var item = '<div class="items"><div class="widget"><div class="widgetLoading">'+dashboard_translation.loadingWidget+'</div><div plugin="'+plugin+'"'+' id="'+action+'" class="widgetDiv"></div></div></div>'; 
     331                var item = '<div class="items"><div class="widget"><div class="widgetLoading">'+ _pk_translate('Dashboard_LoadingWidget','Loading widget, please wait...') +'</div><div plugin="'+plugin+'"'+' id="'+action+'" class="widgetDiv"></div></div></div>'; 
    347332         
    348333                if(onTop) 
    349334                { 
     
    390375        { 
    391376                var self = this; 
    392377                 
    393                 var title = dashboard_translation.widgetNotFound; 
     378                var title = _pk_translate('Dashboard_WidgetNotFound','Widget not found'); 
    394379                var widgets = piwik.availableWidgets[plugin]; 
    395380                for(var i in widgets) 
    396381                { 
  • plugins/Dashboard/templates/index.tpl

     
     1{loadJavascriptTranslations modules='Dashboard'} 
     2 
    13<script type="text/javascript"> 
    24        {* define some global constants for the following javascript includes *} 
    35        var piwik = new Object; 
     
    2224  
    2325        <div class="dialog" id="confirm">  
    2426                <img src="themes/default/images/delete.png" style="padding: 10px; position: relative; margin-top: 10%; float: left;"/> 
    25                 <p>Are you sure you want to delete this widget from the dashboard ?</p> 
    26                         <input id="yes" type="button" value="Yes"/> 
    27                         <input id="no" type="button" value="No"/> 
     27                <p>{'Dashboard_DeleteWidgetConfirm'|translate}</p> 
     28                        <input id="yes" type="button" value="{'General_Yes'|translate}"/> 
     29                        <input id="no" type="button" value="{'General_No'|translate}"/> 
    2830        </div>  
    2931 
    3032        <div class="button" id="addWidget"> 
    31                 Add a widget... 
     33                {'Dashboard_AddWidget'|translate} 
    3234        </div> 
    3335         
    3436        <div class="menu" id="widgetChooser"> 
    35                 <div id="closeMenuIcon"><img src="themes/default/images/close_medium.png" title="Close this menu"/></div> 
    36                 <div id="menuTitleBar">Select the widget to add in the dashboard</div> 
     37                <div id="closeMenuIcon"><img src="themes/default/images/close_medium.png" title="{'General_Close'|translate}"/></div> 
     38                <div id="menuTitleBar">{'Dashboard_SelectWidget'|translate}</div> 
    3739                <div class="subMenu" id="sub1"> 
    3840                </div> 
    3941                 
     
    4244                 
    4345                <div class="subMenu" id="sub3"> 
    4446                        <div class="widget"> 
    45                                 <div class="handle" title="Add previewed widget to the dashboard"> 
     47                                <div class="handle" title="{'Dashboard_AddPreviewedWidget'|translate}"> 
    4648                                        <div class="button" id="close"> 
    47                                                 <img src="themes/default/images/close.png" /> 
     49                                                <img src="themes/default/images/close.png" title="{'General_Close'|translate}"/> 
    4850                                        </div> 
    49                                         <div class="widgetTitle">Widget preview</div> 
     51                                        <div class="widgetTitle">{'Dashboard_WidgetPreview'|translate}</div> 
    5052                                </div> 
    5153                                <div class="widgetDiv previewDiv"></div> 
    5254                        </div> 
  • plugins/Dashboard/templates/header.tpl

     
    11{* This header is for loading the dashboard in stand alone mode*} 
    22<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> 
    33 
     4{loadJavascriptTranslations modules='Home Dashboard'} 
     5 
    46<script type="text/javascript" src="libs/jquery/jquery.js"></script> 
    57 
    68<script type="text/javascript" src="themes/default/common.js"></script> 
     
    2022<script type="text/javascript" src="libs/jquery/ui.sortable_modif.js"></script> 
    2123 
    2224<link rel="stylesheet" href="plugins/Home/templates/datatable.css"> 
    23 <link rel="stylesheet" href="plugins/Dashboard/templates/dashboard.css"> 
    24  brakuje znaku końca linii na końcu pliku  
     25<link rel="stylesheet" href="plugins/Dashboard/templates/dashboard.css"> 
  • plugins/Home/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'Home_NoPrivileges' => "You are logged in as '%s' but it seems you don't have any permission set in Piwik.". 
     4                "<br />Ask your Piwik administrator to give you 'view' access to a website.", 
     5        'Home_JavascriptDisabled' => "JavaScript must be enabled in order for you to use Piwik in standard view.<br>". 
     6                "However, it seems JavaScript is either disabled or not supported by your browser.<br>". 
     7                "To use standard view, enable JavaScript by changing your browser options, then %1stry again%2s.<br>", 
     8        'Home_TableNoData' => 'No data for this table.', 
     9        'Home_CategoryNoData' => 'No data in this category. Try to "Include all population".', 
     10        'Home_ShowJSCode' => 'Show the javascript code to insert', 
     11         
     12        'Home_IncludeAllPopulation_js' => 'Include all population', 
     13        'Home_ExcludeLowPopulation_js' => 'Exclude low population', 
     14        'Home_PageOf_js' => '%s of %s', 
     15        'Home_Loading_js' => 'Loading...', 
     16         
     17); 
  • plugins/Home/Controller.php

     
    3737                { 
    3838                        if(($currentLogin = Piwik::getCurrentUserLogin()) != 'anonymous') 
    3939                        { 
    40                                 Piwik_ExitWithMessage( "You are logged in as '$currentLogin' but it seems you don't have any permission set in Piwik. 
    41                                 <br />Ask your Piwik administrator to give you 'view' access to a website. 
    42                                 <br /><br />&nbsp;&nbsp;&nbsp;<b><a href='?module=Login&action=logout'>&rsaquo; Logout from Piwik</a></b><br />"); 
     40                                Piwik_ExitWithMessage( sprintf(Piwik_Translate('Home_NoPrivileges'),$currentLogin). 
     41                                "<br /><br />&nbsp;&nbsp;&nbsp;<b><a href='?module=Login&action=logout'>&rsaquo; ".Piwik_Translate('General_Logout')."</a></b><br />"); 
    4342                        } 
    4443                        else 
    4544                        { 
     
    117116 
    118117         
    119118 
    120 } 
    121  brakuje znaku końca linii na końcu pliku  
     119} 
  • plugins/Home/templates/datatable.tpl

     
    33                {$arrayDataTable.message}  
    44        {else} 
    55                {if count($arrayDataTable) == 0} 
    6                 <div id="emptyDatatable">No data for this table.</div> 
     6                <div id="emptyDatatable">{'Home_TableNoData'|translate}</div> 
    77                {else} 
    88                        <a name="{$id}"></a> 
    99                        <table cellspacing="0" class="dataTable">  
  • plugins/Home/templates/datatable_actions_subdatable.tpl

     
    33        {$arrayDataTable.message}  
    44{else} 
    55        {if count($arrayDataTable) == 0} 
    6         <tr><td colspan="{$nbColumns}">No data in this category. Try to "Include all population".</td></tr> 
     6        <tr><td colspan="{$nbColumns}">{'Home_CategoryNoData'|translate}</td></tr> 
    77        {else} 
    88                {foreach from=$arrayDataTable item=row} 
    99                <tr {if $row.idsubdatatable}class="subActionsDataTable" id="{$row.idsubdatatable}"{else}class="actionsDataTable"{/if}> 
     
    1616                </tr> 
    1717                {/foreach} 
    1818        {/if}            
    19 {/if} 
    20  brakuje znaku końca linii na końcu pliku  
     19{/if} 
  • plugins/Home/templates/datatable_actions_recursive.tpl

     
    33        {$arrayDataTable.message}  
    44{else} 
    55        {if count($arrayDataTable) == 0} 
    6                 <div id="emptyDatatable">No data for this table.</div> 
     6                <div id="emptyDatatable">{'Home_TableNoData'|translate}</div> 
    77        {else} 
    88                <table cellspacing="0" class="dataTable dataTableActions">  
    99                <thead> 
     
    4141        {include file="Home/templates/datatable_actions_js.tpl"} 
    4242         
    4343        {/if} 
    44 </div> 
    45  brakuje znaku końca linii na końcu pliku  
     44</div> 
  • plugins/Home/templates/datatable.js

     
    1  
    2 //label and string used in the javascript 
    3 //overide this object for dataTable_translation 
    4 if(typeof dataTable_translation == "undefined") 
    5 { 
    6         var dataTable_translation = { 
    7                 includeLowPop:          'Include all population', 
    8                 excludeLowPop:          'Exclude low population', 
    9                 pageOf:                         ' of ',                                         //like in 1-10 _of_ 42 
    10                 loading:                        'Loading...' 
    11         }; 
    12 } 
    13  
    141//----------------------------------------------------------------------------- 
    152//                                                              Data Table 
    163//----------------------------------------------------------------------------- 
     
    281268                                        { 
    282269                                                if(Number(self.param.filter_excludelowpop) != 0) 
    283270                                                { 
    284                                                         string = dataTable_translation.includeLowPop; 
     271                                                        string = _pk_translate('Home_IncludeAllPopulation','Include all population'); 
    285272                                                } 
    286273                                                else 
    287274                                                { 
    288                                                         string = dataTable_translation.excludeLowPop; 
     275                                                        string = _pk_translate('Home_ExcludeLowPopulation','Exclude low population'); 
    289276                                                } 
    290277                                                $(this).html(string); 
    291278                                        }  
     
    423410                                        // only show this string if there is some rows in the datatable 
    424411                                        if(totalRows != 0) 
    425412                                        { 
    426                                                 var str = offset + '-' + offsetEndDisp + dataTable_translation.pageOf + totalRows; 
     413                                                var str = _pk_translate('Home_PageOf','%s of %s',offset + '-' + offsetEndDisp,totalRows); 
    427414                                                $(this).text(str); 
    428415                                        } 
    429416                                } 
     
    631618                                        <tr>\ 
    632619                                                <td colspan="'+numberOfColumns+'" class="cellSubDataTable">\ 
    633620                                                        <div id="'+divIdToReplaceWithSubTable+'">\ 
    634                                                                 <span id="loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" />'+ dataTable_translation.loading +'</span>\ 
     621                                                                <span id="loadingDataTable" style="display:inline"><img src="themes/default/images/loading-blue.gif" />'+ _pk_translate('Home_Loading','Loading...') +'</span>\ 
    635622                                                        </div>\ 
    636623                                                </td>\ 
    637624                                        </tr>\ 
     
    999986        $('img',domElem).attr('src', 'themes/default/images/plus.png'); 
    1000987} 
    1001988 
    1002          
    1003  brakuje znaku końca linii na końcu pliku  
     989         
  • plugins/Home/templates/datatable_footer.tpl

     
    77        </span> 
    88         
    99        <span id="dataTablePages"></span> 
    10         <span id="dataTablePrevious">&lt; Previous</span> 
    11         <span id="dataTableNext">Next &gt;</span> 
     10        <span id="dataTablePrevious">&lt; {'General_Previous'|translate}</span> 
     11        <span id="dataTableNext">{'General_Next'|translate} &gt;</span> 
    1212        <div> 
    1313                <span id="exportDataTable"> 
    1414                        <span id="exportToFormat" style="display:none"> 
     
    1919                                        <a target="_blank" class="exportToFormat" methodToCall="{$method}" format="JSON" filter_limit="100">Json</a> | 
    2020                                        <a target="_blank" class="exportToFormat" methodToCall="{$method}" format="PHP" filter_limit="100">Php</a> 
    2121                                </span> 
    22                                 <a class="viewDataTable" format="table"><img width="16" height="16" src="themes/default/images/table.png" title="Table" /></a> 
    23                                 <a class="viewDataTable" format="cloud"><img width="16" height="16" src="themes/default/images/tagcloud.png" title="Tag Cloud" /></a> 
    24                                 <a class="viewDataTable" format="graphVerticalBar"><img width="16" height="16" src="themes/default/images/chart_bar.png" title="Vertical bar graph" /></a> 
    25                                 <a class="viewDataTable" format="graphPie"><img width="16" height="16" src="themes/default/images/chart_pie.png" title="Pie chart" /></a> 
     22                                <a class="viewDataTable" format="table"><img width="16" height="16" src="themes/default/images/table.png" title="{'General_Table'|translate}" /></a> 
     23                                <a class="viewDataTable" format="cloud"><img width="16" height="16" src="themes/default/images/tagcloud.png" title="{'General_TagCloud'|translate}" /></a> 
     24                                <a class="viewDataTable" format="graphVerticalBar"><img width="16" height="16" src="themes/default/images/chart_bar.png" title="{'General_VBarGraph'|translate}" /></a> 
     25                                <a class="viewDataTable" format="graphPie"><img width="16" height="16" src="themes/default/images/chart_pie.png" title="{'General_Piechart'|translate}" /></a> 
    2626                        </span> 
    2727                        <span id="exportDataTableShow" style="display:none"> 
    2828                                <img src="plugins/Home/templates/images/more.png" /> 
    2929                        </span> 
    3030                </span> 
    3131 
    32                 <span id="loadingDataTable"><img src="themes/default/images/loading-blue.gif" /> Loading...</span> 
     32                <span id="loadingDataTable"><img src="themes/default/images/loading-blue.gif" /> {'General_LoadingData'|translate}</span> 
    3333        </div> 
    3434</div> 
    3535 
  • plugins/Home/templates/graph.tpl

     
    66        <form class="formEmbedCode" id="{$formId}"> 
    77        Embed <input name="embed_code" value="{$codeEmbed}" onclick="javascript:document.getElementById('{$formId}').embed_code.focus();document.getElementById('{$formId}').embed_code.select();" readonly="true" type="text"> 
    88         
    9         | <a target="_blank" href="{$urlData}">Graph data</a> 
     9        | <a target="_blank" href="{$urlData}">{'General_GraphData'|translate}</a> 
    1010        </form> 
    1111         
    1212        {include file="Home/templates/datatable_footer.tpl"} 
  • plugins/Home/templates/datatable_actions.tpl

     
    33        {$arrayDataTable.message}  
    44{else} 
    55        {if count($arrayDataTable) == 0} 
    6                 <div id="emptyDatatable">No data for this table.</div> 
     6                <div id="emptyDatatable">{'Home_TableNoData'|translate}</div> 
    77        {else} 
    88                <table cellspacing="0" class="dataTable dataTableActions">  
    99                <thead> 
  • plugins/Home/templates/index.tpl

     
    44</head> 
    55<body> 
    66 
     7{loadJavascriptTranslations modules='Home'} 
    78 
    89<script type="text/javascript"> 
    910var period = "{$period}"; 
     
    282283           {/foreach} 
    283284        </optgroup> 
    284285</select> 
    285 </span> | {if $userLogin=='anonymous'}<a href='?module=Login'>Login</a>{else}<a href='?module=Login&action=logout'>Logout</a>{/if}</a> 
     286</span> | {if $userLogin=='anonymous'}<a href='?module=Login'>{'Login_LogIn'|translate}</a>{else}<a href='?module=Login&action=logout'>{'Login_Logout'|translate}</a>{/if}</a> 
    286287</small> 
    287288</form> 
    288289</span> 
     
    299300 
    300301<noscript> 
    301302<span id="javascriptDisable"> 
    302 JavaScript must be enabled in order for you to use Piwik in standard view.<br>  
    303 However, it seems JavaScript is either disabled or not supported by your browser.<br>  
    304 To use standard view, enable JavaScript by changing your browser options, then <a href=''>try again</a>.<br> 
     303{'Home_JavascriptDisabled'|translate:'<a href="">':'</a>'} 
    305304</span> 
    306305</noscript> 
    307306{include file="Home/templates/period_select.tpl"} 
     
    311310 
    312311<div style='clear:both'></div> 
    313312 
    314 <div id="loadingPiwik" {if $basicHtmlView}style="display:none"{/if}><img src="themes/default/images/loading-blue.gif"> Loading data...</div> 
    315 <div id="loadingError">Oops&hellip; problem during the request, please try again.</div> 
     313<div id="loadingPiwik" {if $basicHtmlView}style="display:none"{/if}><img src="themes/default/images/loading-blue.gif"> {'General_LoadingData'|translate}</div> 
     314<div id="loadingError">{'General_ErrorRequest'|translate}</div> 
    316315<div id='content'> 
    317316{if $content}{$content}{/if} 
    318317</div> 
  • plugins/Home/templates/datatable_js.tpl

     
    1  
    21<script type="text/javascript" defer="defer"> 
    32$(document).ready(function(){literal}{{/literal}  
    43        dataTables['{$id}'] = new dataTable(); 
  • plugins/Home/Home.php

     
    2020                        'author' => 'Piwik', 
    2121                        'homepage' => 'http://piwik.org/', 
    2222                        'version' => '0.1', 
    23                         'translationAvailable' => false, 
     23                        'translationAvailable' => true, 
    2424                ); 
    2525        } 
    2626} 
  • plugins/PluginsAdmin/PluginsAdmin.php

     
    1515        { 
    1616                return array( 
    1717                        // name must be the className prefix! 
    18                         'name' => 'Plugins administration', 
     18                        'name' => 'PluginsAdmin', 
    1919                        'description' => '', 
    2020                        'author' => 'Piwik', 
    2121                        'homepage' => 'http://piwik.org/', 
    2222                        'version' => '0.1', 
    23                         'translationAvailable' => false, 
     23                        'translationAvailable' => true, 
    2424                ); 
    2525        } 
    2626} 
  • plugins/PluginsAdmin/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'PluginsAdmin_Plugins' => 'Plugins', 
     4        'PluginsAdmin_Activated' => 'Activated', 
     5        'PluginsAdmin_ActivatedHelp' => 'This plugin cannot be deactivated', 
     6        'PluginsAdmin_Deactivate' => 'Deactivate', 
     7        'PluginsAdmin_Activate' => 'Activate',   
     8); 
  • plugins/PluginsAdmin/templates/manage.tpl

     
    2020        <td>{$plugin.info.description}&nbsp;</td> 
    2121        <td class="center"><a href="{$plugin.info.homepage}">{$plugin.info.author}</a></td> 
    2222        <td>{$plugin.info.version}</td> 
    23         <td class="switch">{if $plugin.alwaysActivated}<span title="This plugin cannot be deactivated">Activated</span>{elseif $plugin.activated}<a href=?module=PluginsAdmin&action=deactivate&pluginName={$name}>Deactivate</a> 
    24 {else}<a href=?module=PluginsAdmin&action=activate&pluginName={$name}>Activate</a>{/if}</td> 
     23        <td class="switch">{if $plugin.alwaysActivated}<span title="{'PluginsAdmin_ActivatedHelp'|translate}">{'PluginsAdmin_Activated'|translate}</span>{elseif $plugin.activated}<a href=?module=PluginsAdmin&action=deactivate&pluginName={$name}>{'PluginsAdmin_Deactivate'|translate}</a> 
     24{else}<a href=?module=PluginsAdmin&action=activate&pluginName={$name}>{'PluginsAdmin_Activate'|translate}</a>{/if}</td> 
    2525        </tr> 
    2626{/foreach} 
    2727 
  • plugins/Widgetize/templates/iframe.tpl

     
    11<html> 
    22<body> 
    33 
     4{loadJavascriptTranslations modules='Home'} 
     5 
    46<script type="text/javascript" src="libs/jquery/jquery.js"></script> 
    57<script type="text/javascript" src="themes/default/common.js"></script> 
    68<script type="text/javascript" src="libs/jquery/jquery.dimensions.js"></script> 
     
    1618{$content} 
    1719 
    1820</body> 
    19 </html> 
    20  brakuje znaku końca linii na końcu pliku  
     21</html> 
  • plugins/Widgetize/templates/js.tpl

     
     1{loadJavascriptTranslations modules='Home'} 
     2 
    13document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/jquery/jquery.js"><\/scr'+'ipt>'); 
    24document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}themes/default/common.js"><\/scr'+'ipt>'); 
    35document.write('<scr'+'ipt language="javascript" src="{$piwikUrl}libs/jquery/jquery.dimensions.js"><\/scr'+'ipt>'); 
     
    1113document.write('<link rel="stylesheet" href="{$piwikUrl}plugins/Home/templates/datatable.css">'); 
    1214 
    1315var content = '{$content|escape:'javascript'}'; 
    14 document.write(content); 
    15  brakuje znaku końca linii na końcu pliku  
     16document.write(content); 
  • plugins/UsersManager/API.php

     
    189189        { 
    190190                if(self::userExists($userLogin)) 
    191191                { 
    192                         throw new Exception("Login $userLogin already exists."); 
     192                        throw new Exception(sprintf(Piwik_TranslateException('UsersManager_ExceptionLoginExists'),$userLogin)); 
    193193                } 
    194194                 
    195195                if(!self::isValidLoginString($userLogin)) 
    196196                { 
    197                         throw new Exception("The login must contain only letters, numbers, or the characters '_' or '-' or '.'"); 
     197                        throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidLogin')); 
    198198                } 
    199199        } 
    200200                 
     
    202202        { 
    203203                if(!self::isValidPasswordString($password)) 
    204204                { 
    205                         throw new Exception("The password length must be between 6 and 26 characters."); 
     205                        throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidPassword')); 
    206206                } 
    207207        } 
    208208         
     
    210210        { 
    211211                if(!Piwik::isValidEmailString($email)) 
    212212                { 
    213                         throw new Exception("The email doesn't have a valid format."); 
     213                        throw new Exception(Piwik_TranslateException('UsersManager_ExceptionInvalidEmail')); 
    214214                } 
    215215        } 
    216216                 
     
    343343                 
    344344                if(!self::userExists($userLogin)) 
    345345                { 
    346                         throw new Exception("User '$userLogin' doesn't exist therefore it can't be deleted."); 
     346                        throw new Exception(sprintf(Piwik_TranslateException("UsersManager_ExceptionDeleteDoesNotExist"),$userLogin)); 
    347347                } 
    348348                 
    349349                 
     
    389389                if($userLogin == 'anonymous' 
    390390                        && $access == 'admin') 
    391391                { 
    392                         throw new Exception("You cannot grant 'admin' access to the 'anonymous' user."); 
     392                        throw new Exception(Piwik_TranslateException("UsersManager_ExceptionAdminAnonymous")); 
    393393                } 
    394394                 
    395395                // in case idSites is null we grant access to all the websites on which the current connected user 
     
    441441        { 
    442442                if(!self::userExists($userLogin)) 
    443443                { 
    444                         throw new Exception("User '$userLogin' doesn't exist."); 
     444                        throw new Exception(sprintf(Piwik_TranslateException("UsersManager_ExceptionUserDoesNotExist"),$userLogin)); 
    445445                } 
    446446        } 
    447447         
     
    449449        { 
    450450                if($userLogin == 'anonymous') 
    451451                { 
    452                         throw new Exception("The anonymous user cannot be edited or deleted. It is used by Piwik to define a user that has not loggued in yet. For example, you can make your statistics public by granting the 'view' access to the 'anonymous' user."); 
     452                        throw new Exception(Piwik_TranslateException("UsersManager_ExceptionEditAnonymous")); 
    453453                } 
    454454        } 
    455455         
     
    462462                 
    463463                if(!in_array($access,$accessList)) 
    464464                { 
    465                         throw new Exception("The parameter access must have one of the following values : [ ". implode(", ", $accessList)." ]"); 
     465                        throw new Exception(sprintf(Piwik_TranslateException("UsersManager_ExceptionAccessValues"),implode(", ", $accessList))); 
    466466                } 
    467467        } 
    468468         
     
    550550                return $l >= 6 && $l <= 26; 
    551551        } 
    552552 
    553 } 
    554  brakuje znaku końca linii na końcu pliku  
     553} 
  • plugins/UsersManager/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'UsersManager_ManageAccess' => 'Manage access', 
     4        'UsersManager_Sites' => 'Sites', 
     5        'UsersManager_AllWebsites' => 'All websites', 
     6        'UsersManager_ApplyToAllWebsites' => 'Apply to all websites', 
     7        'UsersManager_User' => 'User', 
     8        'UsersManager_PrivNone' => 'No access', 
     9        'UsersManager_PrivView' => 'View', 
     10        'UsersManager_PrivAdmin' => 'Admin', 
     11        'UsersManager_ChangeAllConfirm' => 'Are you sure you want to change \'%s\' permissions on all the websites?', 
     12        'UsersManager_Login' => 'Login', 
     13        'UsersManager_Password' => 'Password', 
     14        'UsersManager_Email' => 'Email', 
     15        'UsersManager_Alias' => 'Alias', 
     16        'UsersManager_Token' => 'token_auth', 
     17        'UsersManager_Edit' => 'Edit', 
     18        'UsersManager_AddUser' => 'Add a new user', 
     19 
     20        'UsersManager_DeleteConfirm_js' => 'Are you sure you want to delete the user %s?', 
     21         
     22        'UsersManager_ExceptionLoginExists' => "Login '%s' already exists.", 
     23        'UsersManager_ExceptionInvalidLogin' => "The login must contain only letters, numbers, or the characters '_' or '-' or '.'", 
     24        'UsersManager_ExceptionInvalidPassword' => "The password length must be between 6 and 26 characters.", 
     25        'UsersManager_ExceptionInvalidEmail' => "The email doesn't have a valid format.", 
     26        'UsersManager_ExceptionDeleteDoesNotExist' => "User '%s' doesn't exist therefore it can't be deleted.", 
     27        'UsersManager_ExceptionAdminAnonymous' => "You cannot grant 'admin' access to the 'anonymous' user.", 
     28        'UsersManager_ExceptionEditAnonymous' => "The anonymous user cannot be edited or deleted. It is used by Piwik to define a user that has not logged in yet. For example, you can make your statistics public by granting the 'view' access to the 'anonymous' user.", 
     29        'UsersManager_ExceptionUserDoesNotExist' => "User '%s' doesn't exist.", 
     30        'UsersManager_ExceptionAccessValues' => "The parameter access must have one of the following values : [ %s ]", 
     31 
     32); 
  • plugins/UsersManager/UsersManager.php

     
    1919        { 
    2020                $info = array( 
    2121                        // name must be the className prefix! 
    22                         'name' => 'UserManager', 
     22                        'name' => 'UsersManager', 
    2323                        'description' => 'Description', 
    2424                        'author' => 'Piwik', 
    2525                        'homepage' => 'http://piwik.org/', 
    2626                        'version' => '0.1', 
    27                         'translationAvailable' => false, 
     27                        'translationAvailable' => true, 
    2828                ); 
    2929                 
    3030                return $info; 
  • plugins/UsersManager/templates/UsersManager.js

     
    222222                        ajaxHideError(); 
    223223                        var idRow = $(this).attr('id'); 
    224224                        var loginToDelete = $(this).parent().parent().find('#userLogin').html(); 
    225                         if(confirm('Are you sure you want to delete the user "'+loginToDelete+'"?')) 
     225                        if(confirm(_pk_translate('UsersManager_DeleteConfirm','Are you sure you want to delete the user %s','"'+loginToDelete+'"'))) 
    226226                        { 
    227227                                $.ajax( getDeleteUserAJAX( loginToDelete ) ); 
    228228                        } 
  • plugins/UsersManager/templates/UsersManager.tpl

     
     1{loadJavascriptTranslations modules='UsersManager'} 
    12<script type="text/javascript" src="libs/jquery/jquery.js"></script> 
    23<script type="text/javascript" src="themes/default/common.js"></script> 
    34<link rel="stylesheet" href="themes/default/common-admin.css"> 
     
    1819</style> 
    1920{/literal} 
    2021 
    21 <h2>Manage access</h2> 
     22<h2>{'UsersManager_ManageAccess'|translate}</h2> 
    2223 
    2324<div id="sites"> 
    2425<form method="post" action="{url actionToLoad=index}" id="accessSites"> 
    25         <p>Sites: <select id="selectIdsite" name="idsite" onchange="this.form.submit()"> 
     26        <p>{'UsersManager_Sites'|translate}: <select id="selectIdsite" name="idsite" onchange="this.form.submit()"> 
    2627         
    27         <optgroup label="All websites"> 
    28                 <option label="All websites" value="-1" {if $idSiteSelected==-1} selected="selected"{/if}>Apply to all websites</option> 
     28        <optgroup label="{'UsersManager_AllWebsites'|translate}"> 
     29                <option label="{'UsersManager_AllWebsites'|translate}" value="-1" {if $idSiteSelected==-1} selected="selected"{/if}>{'UsersManager_ApplyToAllWebsites'|translate}</option> 
    2930        </optgroup> 
    30         <optgroup label="Sites"> 
     31        <optgroup label="{'UsersManager_Sites'|translate}"> 
    3132                {foreach from=$websites item=info} 
    3233                        <option value="{$info.idsite}" {if $idSiteSelected==$info.idsite} selected="selected"{/if}>{$info.name}</option> 
    3334                {/foreach} 
     
    4041<table id="access"> 
    4142<thead> 
    4243<tr> 
    43         <th>User</th> 
    44         <th>No access</th> 
    45         <th>View</th> 
    46         <th>Admin</th> 
     44        <th>{'UsersManager_User'|translate}</th> 
     45        <th>{'UsersManager_PrivNone'|translate}</th> 
     46        <th>{'UsersManager_PrivView'|translate}</th> 
     47        <th>{'UsersManager_PrivAdmin'|translate}</th> 
    4748</tr> 
    4849</thead> 
    4950 
     
    6162</tbody> 
    6263</table> 
    6364 
    64 <div id="accessUpdated">Done!</div> 
     65<div id="accessUpdated">{'General_Done'|translate}!</div> 
    6566 
    6667<div class="dialog" id="confirm">  
    67         <p>Are you sure you want to change '<span id='login'></span>' permissions on all the websites?</p> 
    68         <input id="yes" type="button" value="Yes"/> 
    69         <input id="no" type="button" value="No"/> 
     68        <p>{'UsersManager_ChangeAllConfirm'|translate:"<span id='login'></span>"}</p> 
     69        <input id="yes" type="button" value="{'General_Yes'|translate}"/> 
     70        <input id="no" type="button" value="{'General_No'|translate}"/> 
    7071</div>  
    7172 
    7273<h2>Manage users</h2> 
    7374 
    7475<div id="ajaxError" style="display:none"></div> 
    75 <div id="ajaxLoading" style="display:none">Loading... <img src="themes/default/loading.gif"></div> 
     76<div id="ajaxLoading" style="display:none">{'General_LoadingData'|translate} <img src="themes/default/loading.gif"></div> 
    7677<table id="users"> 
    7778        <thead> 
    7879                <tr> 
    79                         <th>Login</th> 
    80                         <th>Password</th> 
    81                         <th>Email</th> 
    82                         <th>Alias</th> 
    83                         <th>token_auth</th> 
    84                         <th>Edit</th> 
    85                         <th>Delete</th> 
     80                        <th>{'UsersManager_Login'|translate}</th> 
     81                        <th>{'UsersManager_Password'|translate}</th> 
     82                        <th>{'UsersManager_Email'|translate}</th> 
     83                        <th>{'UsersManager_Alias'|translate}</th> 
     84                        <th>{'UsersManager_Token'|translate}</th> 
     85                        <th>{'General_Edit'|translate}</th> 
     86                        <th>{'General_Delete'|translate}</th> 
    8687                </tr> 
    8788        </thead> 
    8889         
     
    103104        </tbody> 
    104105</table> 
    105106 
    106 <div id="addrow"><img src='plugins/UsersManager/images/add.png'> Add a new user</div> 
     107<div id="addrow"><img src='plugins/UsersManager/images/add.png'> {'UsersManager_AddUser'|translate}</div> 
    107108<script type="text/javascript" src="plugins/UsersManager/templates/UsersManager.js"></script> 
  • plugins/UserSettings/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'UserSettings_BrowserFamilies' => 'Browser families', 
     4        'UserSettings_Browsers' => 'Browsers', 
     5        'UserSettings_Plugins' => 'Plugins', 
     6        'UserSettings_Configurations' => 'Configurations', 
     7        'UserSettings_OperatinsSystems' => 'Operating systems', 
     8        'UserSettings_Resolutions' => 'Resolutions', 
     9        'UserSettings_WideScreen' => 'Wide Screen', 
     10); 
  • plugins/UserSettings/UserSettings.php

     
    3838                        'author' => 'Piwik', 
    3939                        'homepage' => 'http://piwik.org/', 
    4040                        'version' => '0.1', 
     41                        'translationAvailable' => true, 
    4142                ); 
    4243                 
    4344                return $info; 
  • plugins/UserSettings/index.tpl

     
    11<div id='leftcolumn'> 
    2         <h2>Browser families</h2> 
     2        <h2>{'UserSettings_BrowserFamilies'|translate}</h2> 
    33        {$dataTableBrowserType} 
    44         
    5         <h2>Browsers</h2> 
     5        <h2>{'UserSettings_Browsers'|translate}</h2> 
    66        {$dataTableBrowser} 
    77         
    8         <h2>Plugins</h2> 
     8        <h2>{'UserSettings_Plugins'|translate}</h2> 
    99        {$dataTablePlugin} 
    1010</div> 
    1111 
    1212<div id='rightcolumn'> 
    13         <h2>Configurations</h2> 
     13        <h2>{'UserSettings_Configurations'|translate}</h2> 
    1414        {$dataTableConfiguration} 
    1515         
    16         <h2>Operating systems</h2> 
     16        <h2>{'UserSettings_OperatinsSystems'|translate}</h2> 
    1717        {$dataTableOS} 
    1818         
    19         <h2>Resolutions</h2> 
     19        <h2>{'UserSettings_Resolutions'|translate}</h2> 
    2020        {$dataTableResolution} 
    2121         
    22         <h2>Wide Screen</h2> 
     22        <h2>{'UserSettings_WideScreen'|translate}</h2> 
    2323        {$dataTableWideScreen} 
    2424</div>   
    2525 
  • plugins/VisitsSummary/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'VisitsSummary_NbVisits' => '%s visits', 
     4        'VisitsSummary_NbUniqueVisitors' => '%s unique visitors', 
     5        'VisitsSummary_NbActions' => '%s actions (page views)', 
     6        'VisitsSummary_TotalTime' => '%s total time spent by the visitors', 
     7        'VisitsSummary_MaxNbActions' => '%s max actions in one visit', 
     8        'VisitsSummary_NbBounced' => '%s visitors have bounced (left the site after one page)', 
     9        'VisitsSummary_Evolution' => 'Evolution on the last 30 %ss', 
     10        'VisitsSummary_Report' => 'Report', 
     11        'VisitsSummary_GenerateTime' => '%s seconds to generate the page', 
     12        'VisitsSummary_GenerateQueries' => '%s queries executed', 
     13 
     14); 
  • plugins/VisitsSummary/VisitsSummary.php

     
    1919        { 
    2020                $info = array( 
    2121                        // name must be the className prefix! 
    22                         'name' => 'Piwik_VisitsSummary', 
     22                        'name' => 'VisitsSummary', 
    2323                        'description' => 'Description', 
    2424                        'author' => 'Piwik', 
    2525                        'homepage' => 'http://piwik.org/', 
    2626                        'version' => '0.1', 
    27                         'translationAvailable' => false, 
     27                        'translationAvailable' => true, 
    2828                ); 
    2929                 
    3030                return $info; 
     
    129129Piwik_AddWidget( 'VisitsSummary', 'getLastUniqueVisitorsGraph', 'Last unique visitors graph'); 
    130130Piwik_AddWidget( 'VisitsSummary', 'index', 'Overview with graph'); 
    131131 
    132 Piwik_AddMenu('Visitors', 'Overview', array('module' => 'VisitsSummary'), true); 
    133  brakuje znaku końca linii na końcu pliku  
     132Piwik_AddMenu('Visitors', 'Overview', array('module' => 'VisitsSummary'), true); 
  • plugins/VisitsSummary/index.tpl

     
    22<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script> 
    33 
    44<a name="evolutionGraph" graphId="VisitsSummarygetLastVisitsGraph"></a> 
    5 <h2>Evolution on the last 30 {$period}s</h2> 
     5<h2>{'VisitsSummary_Evolution'|translate:$period}</h2> 
    66{$graphEvolutionVisitsSummary} 
    77 
    8 <h2>Report</h2> 
     8<h2>{'VisitsSummary_Report'|translate}</h2> 
    99{include file=VisitsSummary/sparklines.tpl} 
    1010 
    1111 
    1212<br><br><br> 
    13 <p style='color:lightgrey; size:0.8em;'>{$totalTimeGeneration} seconds {if $totalNumberOfQueries != 0}/ {$totalNumberOfQueries}  queries{/if} to generate the page</p> 
     13<p style='color:lightgrey; size:0.8em;'> 
     14{'VisitsSummary_GenerateTime'|translate:$totalTimeGeneration:$totalNumberOfQueries} 
     15{if $totalNumberOfQueries != 0}, {'VisitsSummary_GenerateQueries'|translate:$totalNumberOfQueries}{/if} 
     16</p> 
  • plugins/VisitsSummary/sparklines.tpl

     
    11<div id="to remove this div" class="parentDiv"> 
    2 <p><img class="sparkline" src="{$urlSparklineNbVisits}" /> <span><strong>{$nbVisits} </strong>visits</span></p> 
    3 <p><img class="sparkline" src="{$urlSparklineNbUniqVisitors}" /> <span><strong>{$nbUniqVisitors}</strong> unique visitors</span></p> 
    4 <p><img class="sparkline" src="{$urlSparklineNbActions}" /> <span><strong>{$nbActions}</strong> actions (page views)</span></p> 
    5 <p><img class="sparkline" src="{$urlSparklineSumVisitLength}" /> <span><strong>{$sumVisitLength|sumtime}</strong> total time spent by the visitors</span></p> 
    6 <p><img class="sparkline" src="{$urlSparklineMaxActions}" /> <span><strong>{$maxActions}</strong> max actions in one visit</span></p> 
    7 <p><img class="sparkline" src="{$urlSparklineBounceCount}" /> <span><strong>{$bounceCount} </strong>visitors have bounced (left the site after one page)</span></p> 
    8  
    9 </div> 
    10  brakuje znaku końca linii na końcu pliku  
     2<p><img class="sparkline" src="{$urlSparklineNbVisits}" /> <span> 
     3        {'VisitsSummary_NbVisits'|translate:"<strong>$nbVisits</strong>"}</span></p> 
     4<p><img class="sparkline" src="{$urlSparklineNbUniqVisitors}" /> <span> 
     5        {'VisitsSummary_NbUniqueVisitors'|translate:"<strong>$nbUniqVisitors</strong>"}</span></p> 
     6<p><img class="sparkline" src="{$urlSparklineNbActions}" /> <span> 
     7        {'VisitsSummary_NbActions'|translate:"<strong>$nbActions</strong>"}</span></p> 
     8<p><img class="sparkline" src="{$urlSparklineSumVisitLength}" /> <span> 
     9        {assign var=sumtimeVisitLength value=$sumVisitLength|sumtime} 
     10        {'VisitsSummary_TotalTime'|translate:"<strong>$sumtimeVisitLength</strong>"}</span></p> 
     11<p><img class="sparkline" src="{$urlSparklineMaxActions}" /> <span> 
     12        {'VisitsSummary_MaxNbActions'|translate:"<strong>$maxActions</strong>"}</span></p> 
     13<p><img class="sparkline" src="{$urlSparklineBounceCount}" /> <span> 
     14        {'VisitsSummary_NbBounced'|translate:"<strong>$bounceCount</strong>"}</span></p> 
     15</div> 
  • plugins/Actions/API.php

     
    6666        public function getDownloads( $idSite, $period, $date, $expanded = false, $idSubtable = false ) 
    6767        { 
    6868                $dataTable = $this->getDataTable('Actions_downloads', $idSite, $period, $date, $expanded, $idSubtable ); 
    69                 $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackAddDetail', array('label', 'url', create_function('$url', 'return $url;'))); 
     69                $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackAddDetail', array('full_url', 'url', create_function('$url', 'return $url;'))); 
    7070                $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackReplace', array('label', 'Piwik_getPathFromActionsUrl')); 
    7171                $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackReplace', array('label', 'Piwik_truncateActionsPath')); 
    7272                 
     
    7676        public function getOutlinks( $idSite, $period, $date, $expanded = false, $idSubtable = false ) 
    7777        { 
    7878                $dataTable = $this->getDataTable('Actions_outlink', $idSite, $period, $date, $expanded, $idSubtable ); 
    79                 $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackAddDetail', array('label', 'url', create_function('$url', 'return $url;'))); 
     79                $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackAddDetail', array('full_url', 'url', create_function('$url', 'return $url;'))); 
    8080                $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackReplace', array('label', 'Piwik_getPathFromActionsUrl')); 
    8181                $dataTable->queueFilter('Piwik_DataTable_Filter_ColumnCallbackReplace', array('label', 'Piwik_truncateActionsPath')); 
    8282                return $dataTable; 
  • plugins/Actions/Actions.php

     
    3737                        'author' => 'Piwik', 
    3838                        'homepage' => 'http://piwik.org/', 
    3939                        'version' => '0.1', 
     40                        'translationAvailable' => false 
    4041                ); 
    4142                 
    4243                return $info; 
     
    282283                                $currentTable = new Piwik_DataTable_Row( 
    283284                                        array(  Piwik_DataTable_Row::COLUMNS =>  
    284285                                                        array(  'label' => (string)$actionName, 
     286                                                                        'full_url' => (string)$row['name'], 
    285287                                                                ) 
    286288                                                ) 
    287289                                        ); 
  • plugins/Installation/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'Installation_Installation' => 'Installation', 
     4        'Installation_InstallationStatus' => 'Installation status', 
     5        'Installation_PercentDone' => '%s %% Done', 
     6                 
     7        'Installation_NoConfigFound' =>  
     8                "The Piwik configuration file couldn't be found and you are trying to access a Piwik page.<br>". 
     9                "<b>&nbsp;&nbsp;&raquo; You can <a href='index.php'>install Piwik now</a></b>". 
     10                "<br><small>If you installed Piwik before and have some tables in your DB, don't worry,". 
     11                "you can reuse the same tables and keep your existing data!</small>", 
     12 
     13        'Installation_MysqlSetup' => 'Mysql database setup', 
     14        'Installation_MysqlErrorConnect' => 'Error while trying to connect to the Mysql database', 
     15 
     16        'Installation_JsTag' => 'Javascript tag',        
     17        'Installation_JsTagHelp' =>  
     18                '<p>To count all visitors, you must insert the javascript code on all of your pages.</p>'. 
     19                '<p>Your pages do not have to be made with PHP, Piwik will work on all kinds of pages (whether it is HTML, ASP, Perl or any other languages).</p>'. 
     20                '<p>Here is the code you have to insert: (copy and paste on all your pages) </p>', 
     21 
     22        'Installation_Congratulations' => 'Congratulations', 
     23        'Installation_ContratulationsHelp' =>  
     24                '<p>Congratulations! Your Piwik installation is complete.</p>'. 
     25                '<p>Make sure your javascript code is entered on your pages, and wait for your first visitors!</p>', 
     26        'Installation_GoToPiwik' => 'Go to Piwik', 
     27 
     28        'Installation_SetupWebsite' => 'Setup a website', 
     29        'Installation_SetupWebsiteError' => 'There was an error when adding the website', 
     30 
     31        'Installation_GeneralSetup' => 'General Setup', 
     32        'Installation_GeneralSetupSuccess' => 'General Setup configured with success', 
     33 
     34        'Installation_SystemCheck' => 'System check', 
     35        'Installation_SystemCheckPhp' => 'PHP version', 
     36        'Installation_SystemCheckPdo' => 'Pdo extension',                                
     37        'Installation_SystemCheckPdoMysql' => 'Pdo_Mysql extension', 
     38        'Installation_SystemCheckPdoError' => 'You need to enable the <code>php_pdo</code> and <code>php_pdo_mysql</code> extensions in your php.ini file.',                     
     39        'Installation_SystemCheckPdoErrorHelp' =>  
     40                "On a windows server you can add the lines      <code>extension=php_pdo.dll\nextension=php_pdo_mysql.dll</code> in your php.ini". 
     41                '<br><br>On a Linux server you can compile php with the following option <code>--with-pdo-mysql </code>'. 
     42                '<br><br>More information on the <a style="color:red" href="http://php.net/pdo">PHP website</a>.', 
     43        'Installation_SystemCheckPhpXml' => 'PHP-XML extension', 
     44        'Installation_SystemCheckWriteDirs' => 'Directories with write access', 
     45        'Installation_SystemCheckWriteDirsHelp' => 'To fix this error on your Linux system, try typing in the following command(s)', 
     46        'Installation_SystemCheckMemoryLimit' => 'Memory limit',         
     47        'Installation_SystemCheckMemoryLimitHelp' =>  
     48                'On a high traffic website, the archiving process may require more memory than currently allowed.'. 
     49                '<br>See the directive memory_limit in your php.ini file if necessary.', 
     50        'Installation_SystemCheckGD' => 'GD &gt; 2.x (graphics)', 
     51        'Installation_SystemCheckGDHelp' => 'The sparklines (small graphs) will not work.', 
     52        'Installation_SystemCheckTimeLimit' => 'set_time_limit() allowed', 
     53        'Installation_SystemCheckTimeLimitHelp' =>  
     54                'On a high traffic website, executing the archiving process may require more time than currently allowed.'. 
     55                '<br>See the directive max_execution_time  in your php.ini file if necessary', 
     56        'Installation_SystemCheckMail' => 'mail() allowed', 
     57        'Installation_SystemCheckError' => 'An error occured - must be fixed before you proceed', 
     58        'Installation_SystemCheckWarning' => 'Piwik will work normally but some features may be missing', 
     59         
     60        'Installation_Tables' => 'Creating the tables', 
     61        'Installation_TablesWarning' => 'Some <span id="linkToggle">Piwik tables</span> are already installed in the DB', 
     62        'Installation_TablesFound' => 'The following tables have been found in the database', 
     63        'Installation_TablesWarningHelp' => 'Either choose to reuse the existing database tables or select a clean install to erase all existing data in the database.', 
     64        'Installation_TablesReuse' => 'Reuse the existing tables', 
     65        'Installation_TablesDelete' => 'Delete the detected tables', 
     66        'Installation_TablesDeletedSuccess' => 'Existing Piwik tables deleted with success', 
     67        'Installation_TablesCreatedSuccess' => 'Tables created with success!', 
     68        'Installation_TablesDeleteConfirm' => 'Are you sure you want to delete all the Piwik tables from this database?', 
     69 
     70        'Installation_Welcome' => 'Welcome!', 
     71        'Installation_WelcomeHelp' =>  
     72                '<p>Piwik is an open source web analytics software that makes it easy to get the information you want from your visitors.</p>'. 
     73                '<p>This process is split up into %s easy steps and will take around 5 minutes.</p>',    
     74); 
  • plugins/Installation/Installation.php

     
    2929                        'author' => 'Piwik', 
    3030                        'homepage' => 'http://piwik.org/', 
    3131                        'version' => '0.1', 
    32                         'translationAvailable' => false, 
     32                        'translationAvailable' => true, 
    3333                ); 
    3434                 
    3535                return $info; 
     
    6767                } 
    6868                else 
    6969                { 
    70                         Piwik::exitWithErrorMessage(" 
    71                                 The Piwik configuration file couldn't be found and you are trying to access a Piwik page.<br> 
    72                                 <b>&nbsp;&nbsp;&raquo; You can <a href='index.php'>install Piwik now</a></b> 
    73                                 <br><small>If you installed Piwik before and have some tables in your DB, don't worry,  
    74                                 you can reuse the same tables and keep your existing data!</small>"); 
     70                        Piwik::exitWithErrorMessage(Piwik_Translate('Installation_NoConfigFound')); 
    7571                } 
    7672                exit; 
    7773        }        
    78 } 
    79  brakuje znaku końca linii na końcu pliku  
     74} 
  • plugins/Installation/templates/systemCheck.tpl

     
    22{assign var=error value="<img src='themes/default/images/error.png' />"} 
    33{assign var=warning value="<img src='themes/default/images/warning.png' />"} 
    44 
    5 <h1>System check</h1> 
     5<h1>{'Installation_SystemCheck'|translate}</h1> 
    66 
    77 
    88<table class="infosServer"> 
    99        <tr> 
    10                 <td class="label">PHP version &gt; {$infos.phpVersion_minimum}</td> 
     10                <td class="label">{'Installation_SystemCheckPhp'|translate} &gt; {$infos.phpVersion_minimum}</td> 
    1111                <td>{if $infos.phpVersion_ok}{$ok}{else}{$error}{/if}</td> 
    1212        </tr><tr> 
    13                 <td class="label">Pdo extension</td> 
     13                <td class="label">{'Installation_SystemCheckPdo'|translate}</td> 
    1414                <td>{if $infos.pdo_ok}{$ok} 
    1515                {else}{$error}{/if}      
    1616                </td> 
    1717        </tr>   
    1818        <tr> 
    19                 <td class="label">Pdo_Mysql extension</td> 
     19                <td class="label">{'Installation_SystemCheckPdoMysql'|translate}</td> 
    2020                <td>{if $infos.pdo_mysql_ok}{$ok} 
    2121                {else}{$error} 
    2222                {/if} 
    2323                 
    2424                {if !$infos.pdo_mysql_ok || !$infos.pdo_ok} 
    25                         <p class="error" style="width:80%">You need to enable the <code>php_pdo</code> and <code>php_pdo_mysql</code> extensions in your  
    26                         php.ini file. 
     25                        <p class="error" style="width:80%">{'Installation_SystemCheckPdoError'|translate} 
    2726                        <small> 
    28                         <br><br>On a windows server you can add the lines  
    29                         <code>extension=php_pdo.dll 
    30                                 extension=php_pdo_mysql.dll</code> in your php.ini  
    31                          
    32                         <br><br>On a Linux server you can compile php with the following option 
    33                         <code>--with-pdo-mysql </code>  
    34                          
    35                         <br><br>More information on the <a style="color:red" href='http://php.net/pdo'>PHP website</a>. 
     27                        <br><br> 
     28                        {'Installation_SystemCheckPdoErrorHelp'|translate} 
    3629                        </small> 
    3730                        </p> 
    3831                {/if} 
     
    4235         
    4336        {* We don't use utf8_encode currently but I think we will soon so I leave the code here 
    4437        <tr> 
    45                 <td class="label">PHP-XML extension <br> (utf8_decode function)</td> 
     38                <td class="label">{'Installation_SystemCheckPhpXml'|translate} <br> (utf8_decode function)</td> 
    4639            <td>{if $infos.phpXml_ok}{$ok}{else}{$error}{/if}</td> 
    4740        </tr> 
    4841        *} 
    4942        <tr> 
    5043                <td valign="top"> 
    51                         Directories with write access 
     44                        {'Installation_SystemCheckWriteDirs'|translate} 
    5245                </td> 
    5346                <td> 
    5447                        {foreach from=$infos.directories key=dir item=bool} 
     
    6457{if $problemWithSomeDirectories} 
    6558        <br> 
    6659        <div class="error"> 
    67                 To fix this error on your Linux system, try typing in the following command(s): 
     60                        {'Installation_SystemCheckWriteDirsHelp'|translate}: 
    6861        {foreach from=$infos.directories key=dir item=bool} 
    6962                <ul>{if !$bool} 
    7063                        <li>chmod a+w {$basePath}{$dir}</li> 
     
    7770<h1>Optional</h1> 
    7871<table class="infos"> 
    7972        <tr> 
    80                 <td class="label">Memory limit</td> 
     73                <td class="label">{'Installation_SystemCheckMemoryLimit'|translate}</td> 
    8174                <td> 
    8275                        {$infos.memoryCurrent} 
    8376                        {if $infos.memory_ok}{$ok}{else}{$warning}  
    84                                 <br><i>On a high traffic website, the archiving process may require more memory than currently allowed. 
    85                                 <br>See the directive memory_limit in your php.ini file if necessary.</i>{/if}   
     77                                <br><i>{'Installation_SystemCheckMemoryLimitHelp'|translate}</i>{/if}    
    8678                </td> 
    8779        </tr> 
    8880        <tr> 
    89                 <td class="label">GD &gt; 2.x (graphics)</td> 
     81                <td class="label">{'Installation_SystemCheckGD'|translate}</td> 
    9082                <td> 
    91                         {if $infos.gd_ok}{$ok}{else}{$warning} <br><i>The sparklines (small graphs) will not work.</i>{/if} 
     83                        {if $infos.gd_ok}{$ok}{else}{$warning} <br><i>{'Installation_SystemCheckGDHelp'|translate}</i>{/if} 
    9284                </td> 
    9385        </tr> 
    9486        <tr> 
    95                 <td class="label">set_time_limit() allowed</td> 
     87                <td class="label">{'Installation_SystemCheckTimeLimit'|translate}</td> 
    9688                <td>{if $infos.setTimeLimit_ok}{$ok}{else}{$warning} 
    97                         <br><i>On a high traffic website, executing the archiving process may require more time than currently allowed. 
    98                                 <br>See the directive max_execution_time  in your php.ini file if necessary.</i>{/if}</td> 
     89                        <br><i>{'Installation_SystemCheckTimeLimitHelp'|translate}</i>{/if}</td> 
    9990        </tr> 
    10091        <tr> 
    101                 <td class="label">mail() allowed</td> 
     92                <td class="label">{'Installation_SystemCheckMail'|translate}</td> 
    10293                <td>{if $infos.mail_ok}{$ok}{else}{$warning}{/if}</td> 
    10394        </tr> 
    10495</table> 
    10596<p><small> 
    10697Legend: 
    10798<br> 
    108 {$ok} Ok<br> 
    109 {$error} Error to be fixed<br> 
    110 {$warning} Warning: Piwik will work normally but some features may be missing<br> 
     99{$ok} {'General_Ok'|translate}<br> 
     100{$error} {'General_Error'|translate}: {'Installation_SystemCheckError'|translate} <br> 
     101{$warning} {'General_Warning'|translate}: {'Installation_SystemCheckWarning'|translate} <br> 
    111102</small></p> 
    112103 
    113104{if !$showNextStep} 
    114105<p class="nextStep"> 
    115         <a href="{url}">Refresh the page &raquo;</a> 
     106        <a href="{url}">{'General_Refresh'|translate} &raquo;</a> 
    116107</p> 
    117108 
    118109{/if} 
  • plugins/Installation/templates/databaseSetup.tpl

     
    1 <h1>Mysql database setup</h1> 
     1<h1>{'Installation_MysqlSetup'|translate}</h1> 
    22 
    33{if isset($errorMessage)} 
    44        <div class="error"> 
    55                <img src="themes/default/images/error_medium.png"> 
    6                 Error while trying to connect to the Mysql database: 
     6                {'Installation_MysqlErrorConnect'|translate}: 
    77                <br>{$errorMessage} 
    88                 
    99        </div> 
     
    1111 
    1212{if isset($form_data)} 
    1313        {include file=default/genericForm.tpl} 
    14 {/if} 
    15  brakuje znaku końca linii na końcu pliku  
     14{/if} 
  • plugins/Installation/templates/displayJavascriptCode.tpl

     
    3131        <img src="themes/default/images/success_medium.png"> 
    3232</span> 
    3333{/if} 
    34 <h1>Javascript tag</h1> 
    35 <p>To count all visitors, you must insert the javascript code on all of your pages.</p> 
    36 <p>Your pages do not have to be made with PHP, Piwik will work on all kinds of pages (whether it is HTML, ASP, Perl or any other languages).</p> 
    37 <p>Here is the code you have to insert: (copy and paste on all your pages) </P> 
     34<h1>{'Installation_JsTag'|translate}</h1> 
     35{'Installation_JsTagHelp'|translate} 
    3836<code> 
    3937{$javascriptTag} 
    4038</code> 
  • plugins/Installation/templates/finished.tpl

     
    1 <h1>Congratulations</h1> 
     1<h1>{'Installation_Congratulations'|translate}</h1> 
    22 
    3 <p>Congratulations! Your Piwik installation is complete.</p> 
     3{'Installation_ContratulationsHelp'|translate} 
    44 
    5 <p>Make sure your javascript code is entered on your pages,  
    6 and wait for your first visitors!</p> 
    75 
    8  
    96<p class="nextStep"> 
    10         <a href="{url module='' action=''}">Go to Piwik &raquo;</a> 
     7        <a href="{url module='' action=''}">{'Installation_GoToPiwik'|translate} &raquo;</a> 
    118</p> 
  • plugins/Installation/templates/firstWebsiteSetup.tpl

     
    22 
    33{if isset($displayGeneralSetupSuccess)} 
    44<span id="toFade" class="success"> 
    5         General Setup configured with success 
     5        {'Installation_GeneralSetupSuccess'|translate} 
    66        <img src="themes/default/images/success_medium.png"> 
    77</span> 
    88{/if} 
    99 
    10 <h1>Setup a website</h1> 
     10<h1>{'Installation_SetupWebsite'|translate}</h1> 
    1111 
    1212 
    1313 
    1414{if isset($errorMessage)} 
    1515        <div class="error"> 
    1616                <img src="themes/default/images/error_medium.png"> 
    17                 There was an error when adding the website: 
     17                {'Installation_SetupWebsiteError'|translate}: 
    1818                <br>- {$errorMessage} 
    1919                 
    2020        </div> 
     
    2323 
    2424{if isset($form_data)} 
    2525        {include file=default/genericForm.tpl} 
    26 {/if} 
    27  brakuje znaku końca linii na końcu pliku  
     26{/if} 
  • plugins/Installation/templates/welcome.tpl

     
    1 <h1>Welcome!</h1> 
    2 <p>Piwik is an open source web analytics software that makes it easy to get the information you want from your visitors.</p> 
     1<h1>{'Installation_Welcome'|translate}</h1> 
    32 
    4 <p>This process is split up into {$totalNumberOfSteps} easy steps and will take around 5 minutes.</p> 
    5  brakuje znaku końca linii na końcu pliku  
     3{'Installation_WelcomeHelp'|translate:$totalNumberOfSteps} 
  • plugins/Installation/templates/generalSetup.tpl

     
    1 <h1>General Setup</h1> 
     1<h1>{'Installation_GeneralSetup'|translate}</h1> 
    22 
    33{if isset($form_data)} 
    44        {include file=default/genericForm.tpl} 
    5 {/if} 
    6  brakuje znaku końca linii na końcu pliku  
     5{/if} 
  • plugins/Installation/templates/tablesCreation.tpl

     
    1 <h1>Creating the tables</h1> 
     1<h1>{'Installation_Tables'|translate}</h1> 
    22{if isset($someTablesInstalled)} 
    3         <div class="warning">Some <span id="linkToggle">Piwik tables</span> are already installed in the DB 
     3        <div class="warning">{'Installation_TablesWarning'|translate} 
    44        <img src="themes/default/images/warning_medium.png"> 
    55        </div> 
    6         <div id="toggle" style="display:none;color:#4F2410"><small><i>The following tables have been found in the database:  
     6        <div id="toggle" style="display:none;color:#4F2410"><small><i>{'Installation_TablesFound'|translate}: 
    77                <br>{$tablesInstalled} </i></small></div> 
    88 
    9         <p>Either choose to reuse the existing database tables or select a clean install  
    10         to erase all existing data in the database.</p> 
     9        <p>{'Installation_TablesWarningHelp'|translate}</p> 
    1110         
    12         <p class="nextStep"><a href="{url action=$nextModuleName}">Reuse the existing tables &raquo;</a></p> 
    13         <p class="nextStep" id="eraseAllTables"><a href="{url deleteTables=1}">Delete the detected tables &raquo;</a></p> 
     11        <p class="nextStep"><a href="{url action=$nextModuleName}">{'Installation_TablesReuse'|translate} &raquo;</a></p> 
     12        <p class="nextStep" id="eraseAllTables"><a href="{url deleteTables=1}">{'Installation_TablesDelete'|translate} &raquo;</a></p> 
    1413                                 
    1514{/if} 
    1615 
    1716{if isset($existingTablesDeleted)} 
    18         <div class="success"> Existing Piwik tables deleted with success 
     17        <div class="success"> {'Installation_TablesDeletedSuccess'|translate}  
    1918        <img src="themes/default/images/success_medium.png"></div> 
    2019{/if} 
    2120 
    2221 
    2322{if isset($tablesCreated)} 
    24         <div class="success"> Tables created with success!  
     23        <div class="success"> {'Installation_TablesCreatedSuccess'|translate}  
    2524        <img src="themes/default/images/success_medium.png"></div> 
    2625{/if} 
    2726 
     
    3231{literal} 
    3332<script> 
    3433$(document).ready( function(){ 
    35         var strConfirmEraseTables = "Are you sure you want to delete all the Piwik tables from this database?"; 
     34        {/literal} 
     35        var strConfirmEraseTables = "{'Installation_TablesDeleteConfirm'|translate} "; 
     36        {literal}        
    3637         
    3738        // toggle the display of the tables detected during the installation when clicking 
    3839        // on the span "linkToggle" 
     
    6465        ; 
    6566}); 
    6667</script> 
    67 {/literal} 
    68  brakuje znaku końca linii na końcu pliku  
     68{/literal} 
  • plugins/Installation/templates/structure.tpl

     
    11 
    22<html> 
    33<head> 
    4 <title>Piwik &raquo; Installation</title> 
     4<title>Piwik &raquo; {'Installation_Installation'|translate}</title> 
    55</head> 
    66<body> 
    77 
     
    194194                        {include file="$subTemplateToLoad"} 
    195195                        {if $showNextStep} 
    196196                                <p class="nextStep"> 
    197                                         <a href="{url action=$nextModuleName}">Next &raquo;</a> 
     197                                        <a href="{url action=$nextModuleName}">{'General_Next'|translate} &raquo;</a> 
    198198                                </p> 
    199199                        {/if} 
    200200                </div> 
    201201                 
    202202                <div class="both"></div> 
    203203                 
    204                 <h3>Installation status</h3> 
     204                <h3>{'Installation_InstallationStatus'|translate}</h3> 
    205205                 
    206206                <div id="installPercent"> 
    207207                <p style="width: {$percentDone}%;"></p> 
    208208        </div> 
    209209         
    210         {$percentDone}% Done 
     210        {'Installation_PercentDone'|translate:$percentDone}  
    211211</div> 
  • plugins/AdminHome/templates/index.tpl

     
    4242</div> 
    4343 
    4444<div id="footer" style="border-top:1px solid gray; margin-top:20px;padding-top:10px;"> 
    45 <a href='?module=Home'>Back to Piwik homepage</a> 
     45<a href='?module=Home'>{'General_BackToHomepage'|translate}</a> 
    4646 
    4747</div> 
  • plugins/UserCountry/lang/en.php

     
    11<?php 
    22$translations = array ( 
    33 
     4        'UserCountry_Country' => 'Country', 
     5        'UserCountry_Continent' => 'Continent', 
     6        'UserCountry_DistinctCountries' => '%s distinct countries', 
     7         
    48        // Countries 
    59        'country_ac' => 'Ascension Islands', 
    610        'country_ad' => 'Andorra', 
  • plugins/UserCountry/index.tpl

     
    22 
    33<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script> 
    44 
    5 <h2>Country</h2> 
     5<h2>{'UserCountry_Country'|translate}</h2> 
    66{$dataTableCountry} 
    77 
    8 <h2>Continent</h2> 
     8<h2>{'UserCountry_Continent'|translate}</h2> 
    99{$dataTableContinent} 
    1010 
    11 <p><img class="sparkline" src="{$urlSparklineCountries}" /> <span><strong>{$numberDistinctCountries} </strong> distinct countries</span></p>     
     11<p><img class="sparkline" src="{$urlSparklineCountries}" /> <span> 
     12{'UserCountry_DistinctCountries'|translate:"<strong>$numberDistinctCountries</strong>"} </span></p>      
    1213 
    13 {postEvent name="template_footerUserCountry"} 
    14  brakuje znaku końca linii na końcu pliku  
     14{postEvent name="template_footerUserCountry"} 
  • plugins/Login/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'Login_PluginDescription' => 'Login screen, gives credentials to users', 
     4        'Login_LoginPasswordNotCorrect' => 'Username & Password not correct', 
     5        'Login_Login' => 'Username', 
     6        'Login_Password' => 'Password', 
     7        'Login_LogIn' => 'Log in', 
     8        'Login_Logout' => 'Logout', 
     9        'Login_LostYourPassword' => 'Lost your password?',       
     10); 
  • plugins/Login/lang/fr.php

     
     1<?php 
     2$translations = array( 
     3        'Login_LoginPasswordNotCorrect' => 'Utilisateur & Mot de passe not correct', 
     4        'Login_Login' => 'Utilisateur', 
     5        'Login_Password' => 'Mot de passe', 
     6        'Login_LogIn' => 'Log in',       
     7); 
  • plugins/Login/templates/login.tpl

     
    2727{if $form_data.errors} 
    2828<div id="login_error">   
    2929        {foreach from=$form_data.errors item=data} 
    30                 <strong>ERROR</strong>: {$data}<br /> 
     30                <strong>{'General_Error'|translate}</strong>: {$data}<br /> 
    3131        {/foreach} 
    3232</div> 
    3333{/if} 
    3434 
    3535{if $AccessErrorString} 
    36 <div id="login_error"><strong>ERROR</strong>: {$AccessErrorString}<br /></div> 
     36<div id="login_error"><strong>{'General_Error'|translate}</strong>: {$AccessErrorString}<br /></div> 
    3737{/if} 
    3838 
    3939<form {$form_data.attributes}> 
     
    5757 
    5858{* 
    5959<p id="nav"> 
    60 <a href="" title="Password Lost and Found">Lost your password?</a> 
     60<a href="" title="Password Lost and Found">{'Login_LostYourPassword'|translate}</a> 
    6161</p> 
    6262*} 
    6363</div> 
  • plugins/Login/Login.php

     
    2727                        'author' => 'Piwik', 
    2828                        'homepage' => 'http://piwik.org/', 
    2929                        'version' => '0.1', 
    30                         'translationAvailable' => false, 
     30                        'translationAvailable' => true, 
    3131                ); 
    3232                 
    3333                return $info; 
  • plugins/API/API.php

     
    2020                        'author' => 'Piwik', 
    2121                        'homepage' => 'http://piwik.org/', 
    2222                        'version' => '0.1', 
    23                         'translationAvailable' => false, 
     23                        'translationAvailable' => true, 
    2424                ); 
    2525        } 
    2626} 
  • plugins/API/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'API_QuickDocumentation' =>  
     4                "<h1>API quick documentation</h1>". 
     5                "<p>If you don't have data for today you can first <a href='misc/generateVisits.php' target=_blank>generate some data</a> using the Visits Generator script.</p>". 
     6                "<p>You can try the different formats available for every method. It is very easy to extract any data you want from piwik!</p>". 
     7                "<p>If you want to <b>request the data without being logged in to Piwik</b> you need to add the parameter <code><u>&token_auth=%s</u></code> to the API calls URLs that require authentication.</p>". 
     8                "<p><b>For more information have a look at the <a href='http://dev.piwik.org/trac/wiki/API'>official API Documentation</a> or the <a href='http://dev.piwik.org/trac/wiki/API/Reference'>API Reference</a>.</b></P>", 
     9        'API_LoadedAPIs' => 'Loaded successfully %s APIs', 
     10         
     11 
     12); 
  • plugins/API/Controller.php

     
    5555        function listAllAPI() 
    5656        { 
    5757                $token_auth = Zend_Registry::get('auth')->getTokenAuth(); 
    58                 echo "<style>body{ font-family:georgia,arial; font-size:0.95em;} </style>"; 
    59                 echo "<h1>API quick documentation</h1>"; 
    60                 echo "<p>If you don't have data for today you can first <a href='misc/generateVisits.php' target=_blank>generate some data</a> using the Visits Generator script.</p>"; 
    61                 echo "<p>You can try the different formats available for every method. It is very easy to extract any data you want from piwik!</p>"; 
    62                 echo "<p>If you want to <b>request the data without being logged in to Piwik</b> you need to add the parameter <code><u>&token_auth=$token_auth</u></code> to the API calls URLs that require authentication.</p>"; 
    63                 echo "<p><b>For more information have a look at the <a href='http://dev.piwik.org/trac/wiki/API'>official API Documentation</a> or the <a href='http://dev.piwik.org/trac/wiki/API/Reference'>API Reference</a>.</b></P>"; 
     58                echo "<style>body{ font-family:georgia,arial; font-size:0.95em;} </style>"; 
     59                echo sprintf(Piwik_Translate('API_QuickDocumentation'),$token_auth); 
     60 
    6461 
    6562                $loaded = $this->init(); 
    66                 echo "<p><i> Loaded successfully $loaded APIs</i></p>\n"; 
     63                echo "<p><i> ".sprintf(Piwik_Translate('API_LoadedAPIs'),$loaded)."</i></p>\n"; 
    6764                 
    6865                echo Piwik_API_Proxy::getInstance()->getAllInterfaceString(); 
    69                 echo "<p><a href='?module=Home'>Back to Piwik homepage</a></p>"; 
     66                echo "<p><a href='?module=Home'>".Piwik_Translate('General_BackToHomepage')."</a></p>"; 
    7067        } 
    7168         
    7269} 
  • plugins/Referers/lang/en.php

     
    11<?php 
    22$translations = array( 
    3         'Referers_DirectEntry' => 'Direct Entry', 
    43        'Referers_SearchEngines' => 'Search Engines', 
    5         'Referers_Websites' => 'Websites', 
    6         'Referers_Partners' => 'Partners', 
    7         'Referers_Newsletters' => 'Newsletters', 
    8         'Referers_Campaigns' => 'Campaigns', 
     4         
     5        'Referers_Keywords' => 'Keywords', 
     6         
     7        'Referers_Evolution' => 'Evolution over the period', 
     8         
     9        'Referers_Type' => 'Referer Type',       
     10        'Referers_TypeDirectEntries' => '%s direct entries', 
     11        'Referers_TypeSearchEngines' => '%s from search engines', 
     12        'Referers_TypePartners' => '%s from partners', 
     13        'Referers_TypeWebsites' => '%s from websites', 
     14        'Referers_TypeNewsletters' => '%s from newsletters', 
     15        'Referers_TypeCampaigns' => '%s from campaigns', 
     16         
     17        'Referers_Other' => 'Other', 
     18        'Referers_OtherDistinctSearchEngines' => '%s distinct search engines', 
     19        'Referers_OtherDistinctKeywords' => '%s distinct keywords', 
     20        'Referers_OtherDistinctWebsites' => '%1s distinct websites (using %2s distinct urls)', 
     21        'Referers_OtherDistinctPartners' => '%1s distinct partners (using %2s distinct urls)', 
     22        'Referers_OtherDistinctCampaigns' => '%s distinct campaigns', 
     23         
     24        'Referers_TagCloud' => 'Tag cloud output', 
     25 
    926); 
    1027  
  • plugins/Referers/searchEngines_Keywords.tpl

     
    11<div id='leftcolumn'> 
    2         <h2>Search engines</h2> 
     2        <h2>{'Referers_SearchEngines'|translate}</h2> 
    33        {$searchEngines} 
    44</div> 
    55 
    66<div id='rightcolumn'> 
    7         <h2>Keywords</h2> 
     7        <h2>{'Referers_Keywords'|translate}</h2> 
    88        {$keywords} 
    99</div> 
  • plugins/Referers/index.tpl

     
    11<script type="text/javascript" src="plugins/Home/templates/sparkline.js"></script> 
    22 
    33        <a name="evolutionGraph" graphId="{$nameGraphEvolutionReferers}"></a> 
    4         <h2>Evolution over the period</h2> 
     4        <h2>{'Referers_Evolution'|translate}</h2> 
    55        {$graphEvolutionReferers} 
    66         
    7         <h2>Referer Type</h2> 
     7        <h2>{'Referers_Type'|translate}</h2> 
    88        <table> 
    99                <tr><td> 
    10                         <p><img class="sparkline" src="{$urlSparklineDirectEntry}" /> <span><strong>{$visitorsFromDirectEntry} </strong> direct entries</span></p> 
    11                         <p><img class="sparkline" src="{$urlSparklineSearchEngines}" /> <span><strong>{$visitorsFromSearchEngines} </strong>  from search engines</span></p> 
    12                         <p><img class="sparkline" src="{$urlSparklinePartners}" /> <span><strong>{$visitorsFromPartners} </strong> from partners</span></p> 
     10                        <p><img class="sparkline" src="{$urlSparklineDirectEntry}" /> <span> 
     11                        {'Referers_TypeDirectEntries'|translate:"<strong>$visitorsFromDirectEntry</strong>"}</span></p> 
     12                        <p><img class="sparkline" src="{$urlSparklineSearchEngines}" /> <span> 
     13                        {'Referers_TypeSearchEngines'|translate:"<strong>$visitorsFromSearchEngines</strong>"}</span></p> 
     14                        <p><img class="sparkline" src="{$urlSparklinePartners}" /> <span> 
     15                        {'Referers_TypePartners'|translate:"<strong>$visitorsFromPartners</strong>"}</span></p> 
    1316                </td><td> 
    14                         <p><img class="sparkline" src="{$urlSparklineWebsites}" /> <span><strong>{$visitorsFromWebsites} </strong> from websites</span></p> 
    15                         <p><img class="sparkline" src="{$urlSparklineNewsletters}" /> <span><strong>{$visitorsFromNewsletters} </strong>  from newsletters</span></p> 
    16                         <p><img class="sparkline" src="{$urlSparklineCampaigns}" /> <span><strong>{$visitorsFromCampaigns} </strong>  from campaigns</span></p> 
     17                        <p><img class="sparkline" src="{$urlSparklineWebsites}" /> <span> 
     18                        {'Referers_TypeWebsites'|translate:"<strong>$visitorsFromWebsites</strong>"}</span></p> 
     19                        <p><img class="sparkline" src="{$urlSparklineNewsletters}" /> <span> 
     20                        {'Referers_TypeNewsletters'|translate:"<strong>$visitorsFromNewsletters</strong>"}</span></p> 
     21                        <p><img class="sparkline" src="{$urlSparklineCampaigns}" /> <span> 
     22                        {'Referers_TypeCampaigns'|translate:"<strong>$visitorsFromCampaigns</strong>"}</span></p> 
    1723                </td></tr> 
    1824        </table> 
    1925         
    20         <h2>Other</h2> 
     26        <h2>{'Referers_Other'|translate}</h2> 
    2127        <table> 
    2228                <tr><td> 
    23                         <p><img class="sparkline" src="{$urlSparklineDistinctSearchEngines}" /> <span><strong>{$numberDistinctSearchEngines} </strong>  distinct search engines</span></p> 
    24                         <p><img class="sparkline" src="{$urlSparklineDistinctKeywords}" /> <span><strong>{$numberDistinctKeywords} </strong> distinct keywords</span></p> 
     29                        <p><img class="sparkline" src="{$urlSparklineDistinctSearchEngines}" /> <span> 
     30                        {'Referers_OtherDistinctSearchEngines'|translate:"<strong>$numberDistinctSearchEngines</strong>"}</span></p> 
     31                        <p><img class="sparkline" src="{$urlSparklineDistinctKeywords}" /> <span> 
     32                        {'Referers_OtherDistinctKeywords'|translate:"<strong>$numberDistinctKeywords</strong>"}</span></p> 
    2533                </td><td> 
    26                         <p><img class="sparkline" src="{$urlSparklineDistinctWebsites}" /> <span><strong>{$numberDistinctWebsites} </strong>  distinct websites (using <strong>{$numberDistinctWebsitesUrls}</strong> distinct urls)</span></p> 
    27                         <p><img class="sparkline" src="{$urlSparklineDistinctPartners}" /> <span><strong>{$numberDistinctPartners} </strong>   distinct partners (using <strong>{$numberDistinctPartnersUrls}</strong> distinct urls)</span></p> 
    28                         <p><img class="sparkline" src="{$urlSparklineDistinctCampaigns}" /> <span><strong>{$numberDistinctCampaigns} </strong>  distinct campaigns</span></p> 
     34                        <p><img class="sparkline" src="{$urlSparklineDistinctWebsites}" /> <span> 
     35                        {'Referers_OtherDistinctWebsites'|translate:"<strong>$numberDistinctWebsites</strong>":"<strong>$numberDistinctWebsitesUrls</strong>"}</span></p> 
     36                        <p><img class="sparkline" src="{$urlSparklineDistinctPartners}" /> <span> 
     37                        {'Referers_OtherDistinctPartners'|translate:"<strong>$numberDistinctPartners</strong>":"<strong>$numberDistinctPartnersUrls</strong>"}</span></p> 
     38                        <p><img class="sparkline" src="{$urlSparklineDistinctCampaigns}" /> <span>  
     39                        {'Referers_OtherDistinctCampaigns'|translate:"<strong>$numberDistinctCampaigns</strong>"}</span></p> 
    2940                        </td></tr> 
    3041        </table> 
    3142         
    32         <p>Tag cloud output</p> 
    33         {$dataTableRefererType} 
    34  brakuje znaku końca linii na końcu pliku  
     43        <p>{'Referers_TagCloud'|translate}</p> 
     44        {$dataTableRefererType} 
  • plugins/VisitTime/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'VisitTime_LocalTime' => 'Visit per local time', 
     4        'VisitTime_ServerTime' => 'Visit per server time', 
     5); 
  • plugins/VisitTime/VisitTime.php

     
    2929                        'author' => 'Piwik', 
    3030                        'homepage' => 'http://piwik.org/', 
    3131                        'version' => '0.1', 
     32                        'translationAvailable' => true 
    3233                ); 
    3334                 
    3435                return $info; 
  • plugins/VisitTime/index.tpl

     
    11<div id='leftcolumn'> 
    2 <h2>Visit per local time</h2> 
     2<h2>{'VisitTime_LocalTime'|translate}</h2> 
    33{$dataTableVisitInformationPerLocalTime} 
    44</div> 
    55 
    66<div id='rightcolumn'> 
    7 <h2>Visit per server time</h2> 
     7<h2>{'VisitTime_ServerTime'|translate}</h2> 
    88{$dataTableVisitInformationPerServerTime} 
    9 </div> 
    10  brakuje znaku końca linii na końcu pliku  
     9</div> 
  • plugins/VisitorInterest/lang/en.php

     
     1<?php 
     2$translations = array( 
     3        'VisitorInterest_VisitsPerDuration' => 'Visits per visit duration', 
     4        'VisitorInterest_VisitsPerNbOfPages' => 'Visits per number of pages', 
     5); 
  • plugins/VisitorInterest/VisitorInterest.php

     
    4949                        'author' => 'Piwik', 
    5050                        'homepage' => 'http://piwik.org/', 
    5151                        'version' => '0.1', 
     52                        'translationAvailable' => true 
    5253                ); 
    5354                 
    5455                return $info; 
  • plugins/VisitorInterest/index.tpl

     
    11 
    2         <h2>Visits per visit duration</h2> 
     2        <h2>{'VisitorInterest_VisitsPerDuration'|translate}</h2> 
    33        {$dataTableNumberOfVisitsPerVisitDuration} 
    4         <h2>Visits per number of pages</h2> 
    5         {$dataTableNumberOfVisitsPerPage} 
    6  brakuje znaku końca linii na końcu pliku  
     4        <h2>{'VisitorInterest_VisitsPerNbOfPages'|translate}</h2> 
     5        {$dataTableNumberOfVisitsPerPage} 
  • libs/javascript/sprintf.js

     
     1/** 
     2 * sprintf() for JavaScript v.0.4 
     3 * 
     4 * Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/> 
     5 * Thanks to David Baird (unit test and patch). 
     6 * 
     7 * This program is free software; you can redistribute it and/or modify it under 
     8 * the terms of the GNU General Public License as published by the Free Software 
     9 * Foundation; either version 2 of the License, or (at your option) any later 
     10 * version. 
     11 * 
     12 * This program is distributed in the hope that it will be useful, but WITHOUT 
     13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
     14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 
     15 * details. 
     16 * 
     17 * You should have received a copy of the GNU General Public License along with 
     18 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 
     19 * Place, Suite 330, Boston, MA 02111-1307 USA 
     20 */ 
     21 
     22function str_repeat(i, m) { for (var o = []; m > 0; o[--m] = i); return(o.join('')); } 
     23 
     24function sprintf () { 
     25  var i = 0, a, f = arguments[i++], o = [], m, p, c, x; 
     26  while (f) { 
     27    if (m = /^[^\x25]+/.exec(f)) o.push(m[0]); 
     28    else if (m = /^\x25{2}/.exec(f)) o.push('%'); 
     29    else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) { 
     30      if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) throw("Too few arguments."); 
     31      if (/[^s]/.test(m[7]) && (typeof(a) != 'number')) 
     32        throw("Expecting number but found " + typeof(a)); 
     33      switch (m[7]) { 
     34        case 'b': a = a.toString(2); break; 
     35        case 'c': a = String.fromCharCode(a); break; 
     36        case 'd': a = parseInt(a); break; 
     37        case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break; 
     38        case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break; 
     39        case 'o': a = a.toString(8); break; 
     40        case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break; 
     41        case 'u': a = Math.abs(a); break; 
     42        case 'x': a = a.toString(16); break; 
     43        case 'X': a = a.toString(16).toUpperCase(); break; 
     44      } 
     45      a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a); 
     46      c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' '; 
     47      x = m[5] - String(a).length; 
     48      p = m[5] ? str_repeat(c, x) : ''; 
     49      o.push(m[4] ? a + p : p + a); 
     50    } 
     51    else throw ("Huh ?!"); 
     52    f = f.substring(m[0].length); 
     53  } 
     54  return o.join(''); 
     55} 
  • modules/SmartyPlugins/modifier.translate.php

     
    1818 *  
    1919 * @return string The translated string 
    2020 */ 
    21 function smarty_modifier_translate($string, $aValues = null) 
     21function smarty_modifier_translate($string) 
    2222{ 
    23         if(is_null($aValues)) 
     23        if(func_num_args() <= 1) 
    2424        { 
    2525                $aValues = array(); 
    2626        } 
    27         if(!is_array($aValues)) 
     27        else 
    2828        { 
    29                 $aValues = array( $aValues); 
     29                $aValues = func_get_args(); 
     30                array_shift($aValues); 
    3031        } 
    3132        return vsprintf(Piwik_Translate($string), $aValues); 
    32 } 
    33  brakuje znaku końca linii na końcu pliku  
     33} 
  • modules/SmartyPlugins/function.loadJavascriptTranslations.php

     
     1<?php 
     2 
     3/** 
     4 *      inserts javascript translation array into the template from given modules 
     5 *  must be called with 'modules' argument which consists of space-separated module names (i.e. plugins) 
     6 * 
     7 * 
     8 *  Example (use in template): 
     9 * 
     10 *  {loadJavascriptTranslations modules='SitesManager Home General'} 
     11 * 
     12 *  loads javascript array translations from main translation file ('General') 
     13 *  and both 'Home' and 'SitesManager' plugins translations 
     14 *  
     15 *  only translations with '_fs' suffix will be loaded 
     16 * 
     17 *  in order to use translation in your javascript use _pk_translate function 
     18 *  (it is always loaded with translations): 
     19 * 
     20 *  <script type="text/javascript"> 
     21 *     alert(_pk_translate('MY_TRANSLATION_STRING','Default string in English')) 
     22 *  </script> 
     23 * 
     24 *  Note: Use translation string from your translation file WITHOUT '_js' suffix. 
     25 *  
     26 * _pk_translate function supports printf() arguments, so you can call: 
     27 * 
     28 *   _pk_translate('_NB_OF_EGGS','There is %s eggs on the table','ten') 
     29 */ 
     30 
     31function smarty_function_loadJavascriptTranslations($params, &$smarty)  
     32{ 
     33        if(!isset($params['modules'])) 
     34        { 
     35                throw new Exception("The smarty function loadJavascriptTranslations needs a 'modules' parameter."); 
     36        } 
     37        $translate = Piwik_Translate::getInstance(); 
     38         
     39        return $translate->getJavascriptTranslations(explode(' ',$params['modules'])); 
     40} 
  • modules/TranslateException.php

     
     1<?php 
     2/** 
     3 * Piwik - Open source web analytics 
     4 *  
     5 * @link http://piwik.org 
     6 * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later 
     7 * @version $Id$ 
     8 *  
     9 * @package Piwik_Helper 
     10 */ 
     11 
     12require_once "Translate.php"; 
     13 
     14/** 
     15 * Returns translated string or given message if translation is not found. 
     16 * This function does not throw any exception. Use it to translate exceptions. 
     17 * 
     18 * @return string 
     19 */ 
     20function Piwik_TranslateException($message) 
     21{ 
     22        $s = null; 
     23         
     24        try  
     25        { 
     26                $s = Piwik_Translate($message); 
     27        } 
     28        catch(Exception $e) 
     29        { 
     30                $s = null; 
     31        } 
     32         
     33        if( $s == null ) 
     34        { 
     35                $s = $message; 
     36        } 
     37         
     38        return $s;               
     39} 
  • modules/FrontController.php

     
    2929require_once "API/Proxy.php"; 
    3030require_once "Site.php"; 
    3131require_once "Translate.php"; 
     32require_once "TranslateException.php"; 
    3233require_once "Url.php"; 
    3334require_once "Controller.php"; 
    3435 
  • modules/Translate.php

     
    6969                        throw new Exception("The language selected ('$language') is not a valid language file "); 
    7070                } 
    7171        } 
     72         
     73        /** 
     74         * Generate javascript translations array 
     75         *  
     76         * @return string containing javascript code with translations array (including <script> tag) 
     77         * 
     78         */ 
     79        public function getJavascriptTranslations($moduleList) 
     80        { 
     81                if( !$moduleList ) 
     82                { 
     83                        return ''; 
     84                } 
     85                // TODO: add {$PiwikUrl} to the following js include: 
     86                $js = '<script type="text/javascript" src="libs/javascript/sprintf.js" /></script>'; 
     87                 
     88                $js .= '<script type="text/javascript">var translations = {'; 
     89                                         
     90                $moduleRegex = '#^('; 
     91                foreach($moduleList as $module) 
     92                { 
     93                        $moduleRegex .= $module.'|';  
     94                } 
     95                $moduleRegex = substr($moduleRegex, 0, -1); 
     96                $moduleRegex .= ')_([^_]+)_js$#i'; 
     97                 
     98                foreach($GLOBALS['Piwik_translations'] as $key => $value) 
     99                { 
     100                        $matches = array(); 
     101                         
     102                        if( preg_match($moduleRegex,$key,$matches) ) { 
     103                                $varName = $matches[1].'_'.$matches[2]; 
     104                                $varValue = $value; 
     105                                 
     106                                $js .= $varName. ": '".str_replace("'","\\'",$varValue)."',"; 
     107                        } 
     108                         
     109                        $matches = null; 
     110                } 
     111                 
     112                $js .= '};'; 
     113                $js .= 'function _pk_translate(tvar, str) { '. 
     114                        'var s = translations[tvar] ? translations[tvar] : str;'. 
     115                        'return sprintf(s, Array.prototype.slice.call(arguments).slice(2)); }'; 
     116                $js .= '</script>'; 
     117                 
     118                return $js; 
     119        } 
    72120} 
    73121 
    74122function Piwik_Translate($index)