Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/SmartyPlugins/modifier.translate.php14
-rw-r--r--core/Translate.php2
-rw-r--r--lang/en.php39
-rw-r--r--plugins/ExamplePlugin/ExamplePlugin.php14
-rw-r--r--plugins/Goals/templates/GoalForm.js75
-rw-r--r--plugins/Goals/templates/add_edit_goal.tpl38
-rw-r--r--plugins/Goals/templates/add_new_goal.tpl4
-rw-r--r--plugins/Goals/templates/form_add_goal.tpl147
-rw-r--r--plugins/Goals/templates/list_goal_edit.tpl36
-rw-r--r--plugins/Goals/templates/list_top_segment.tpl9
-rw-r--r--plugins/Goals/templates/overview.tpl6
-rw-r--r--plugins/Goals/templates/single_goal.tpl10
-rw-r--r--plugins/Goals/templates/title_and_evolution_graph.tpl6
13 files changed, 242 insertions, 158 deletions
diff --git a/core/SmartyPlugins/modifier.translate.php b/core/SmartyPlugins/modifier.translate.php
index 3c3a7346cc..09a2ecdf89 100644
--- a/core/SmartyPlugins/modifier.translate.php
+++ b/core/SmartyPlugins/modifier.translate.php
@@ -11,13 +11,19 @@
*/
/**
- * Read the translation string from the given index (read form the selected language in Piwik).
- * The translations strings are located either in /lang/xx.php or within the plugin lang directory.
+ * Translates in the currently selected language the specified translation $stringToken
+ * Translations strings are located either in /lang/xx.php or within the plugin lang directory.
*
- * Example:
+ * Usage:
* {'General_Unknown'|translate} will be translated as 'Unknown' (see the entry in /lang/en.php)
*
- * @return string The translated string
+ * Usage with multiple substrings to be replaced in the translation string:
+ * - in lang/en.php you would find:
+ * 'VisitorInterest_BetweenXYMinutes' => '%1s-%2s min',
+ * - in the smarty template you would then translate the string, passing the two parameters:
+ * {'VisitorInterest_BetweenXYMinutes'|translate:$min:$max}
+ *
+ * @return string The translated string, with optional substrings parameters replaced
*/
function smarty_modifier_translate($stringToken)
{
diff --git a/core/Translate.php b/core/Translate.php
index 9487682f66..da2a09410e 100644
--- a/core/Translate.php
+++ b/core/Translate.php
@@ -124,7 +124,7 @@ class Piwik_Translate
'for(var i in translations) { piwik_translations[i] = translations[i];} ';
$js .= 'function _pk_translate(translationStringId) { '.
'if( typeof(piwik_translations[translationStringId]) != \'undefined\' ){ return piwik_translations[translationStringId]; }'.
- 'return "The string "+translationStringId+" was not loaded in javascript. Make sure it is suffixed with _js";}';
+ 'return "The string "+translationStringId+" was not loaded in javascript. Make sure it is suffixed with _js and that you called {loadJavascriptTranslations plugins=\'\$YOUR_PLUGIN_NAME\'} before your javascript code.";}';
return $js;
}
diff --git a/lang/en.php b/lang/en.php
index 343c11fc59..9ebc69c6b7 100644
--- a/lang/en.php
+++ b/lang/en.php
@@ -57,6 +57,7 @@ $translations = array(
'General_ColumnValuePerVisit' => 'Value per Visit',
'General_ColumnVisitsWithConversions' => 'Visits with Conversions',
'General_Save' => 'Save',
+ 'General_ForExampleShort' => 'eg.',
'General_Website' => 'Website',
'General_RequiresFlash' => 'Displaying Graphs in Piwik requires Flash',
'General_GraphHelp' => 'More information about displaying graphs in Piwik.',
@@ -315,6 +316,40 @@ $translations = array(
'Goals_ColumnConversions' => 'Conversions',
'Goals_ColumnConversionRate' => 'Conversion Rate',
'Goals_ColumnRevenue' => 'Revenue',
+ 'Goals_OverallRevenue' => '%s overall revenue',
+ 'Goals_OverallConversionRate' => '%s overall conversion rate (visits with a completed goal)',
+ 'Goals_Conversions' => '%s conversions',
+ 'Goals_ConversionRate' => '%s conversion rate',
+ 'Goals_NoGoalsNeedAccess' => 'Only an Administrator or the Super User can add Goals for a given website. Please ask your Piwik administrator to set up a Goal for your website. <br>Tracking Goals is a great way to help understand and maximize your website performance! ',
+ 'Goals_AddNewGoal' => 'Add a new Goal',
+ 'Goals_AddNewGoalOrEditExistingGoal' => '%sAdd a new Goal%s or %sEdit%s existing Goals',
+ 'Goals_AddGoal_js' => 'Add Goal',
+ 'Goals_UpdateGoal_js' => 'Update Goal',
+ 'Goals_DeleteGoalConfirm_js' => 'Are you sure you want to delete the Goal %s?',
+ 'Goals_GoalName' => 'Goal Name',
+ 'Goals_GoalIsTriggered' => 'Goal is triggered',
+ 'Goals_GoalIsTriggeredWhen' => 'Goal is triggered when',
+ 'Goals_WhenVisitors' => 'when visitors',
+ 'Goals_Manually' => 'manually',
+ 'Goals_ManuallyTriggeredUsingJavascriptFunction' => 'Goal is manually triggered using the Javascript API trackGoal()',
+ 'Goals_VisitUrl' => 'Visit a given URL (page or group of pages)',
+ 'Goals_Download' => 'Download a file',
+ 'Goals_ClickOutlink' => 'Click on a Link to an external website',
+ 'Goals_Optional' => '(optional)',
+ 'Goals_WhereVisitedPageManuallyCallsJavascriptTrackerLearnMore' => 'where the visited page contains a call to the JavaScript piwikTracker.trackGoal() method (%slearn more%s)',
+ 'Goals_DefaultRevenue' => 'Goal default revenue is ',
+ 'Goals_DefaultRevenueHelp' => 'For example, a Contact Form submitted by a visitor may be worth $10 on average. Piwik will help you understand how well your visitors segments are performing.',
+ 'Goals_ConversionsOverview' => 'Conversions Overview',
+ 'Goals_BestCountries' => 'Your best converting countries are: ',
+ 'Goals_BestKeywords' => 'Your top converting keywords are: ',
+ 'Goals_BestReferers' => 'Your best converting websites referers are: ',
+ 'Goals_ReturningVisitorsConversionRateIs' => 'Returning visitors conversion rate is %s',
+ 'Goals_NewVisitorsConversionRateIs' => 'New visitors conversion rate is %s',
+ 'Goals_Contains' => 'contains %s',
+ 'Goals_IsExactly' => 'is exactly %s',
+ 'Goals_MatchesExpression' => 'matches the expression %s',
+ 'Goals_CaseSensitive' => 'Case sensitive match',
+ 'Goals_Pattern' => 'Pattern',
'Installation_PluginDescription' => 'Installation process of Piwik. The Installation is usually done once only. If the configuration file config/config.inc.php is deleted, the installation will start again.',
'Installation_Installation' => 'Installation',
'Installation_InstallationStatus' => 'Installation status',
@@ -476,7 +511,7 @@ $translations = array(
'Referers_DistinctKeywords' => 'distinct keywords',
'Referers_DistinctCampaigns' => 'distinct campaigns',
'Referers_DistinctWebsites' => 'distinct websites',
- 'Referers_UsingNDistinctUrls' => ' (using %2s distinct urls)',
+ 'Referers_UsingNDistinctUrls' => ' (using %1s distinct urls)',
'Referers_SubmenuEvolution' => 'Evolution',
'Referers_SubmenuSearchEngines' => 'Search Engines &amp; Keywords',
'Referers_SubmenuWebsites' => 'Websites',
@@ -880,7 +915,7 @@ $translations = array(
'VisitorInterest_WidgetPages' => 'Pages per visit',
'VisitorInterest_SubmenuFrequencyLoyalty' => 'Frequency &amp; Loyalty',
'VisitorInterest_PlusXMin' => '%s min',
- 'VisitorInterest_BetweenXYMinutes' => '%1s-%1s min',
+ 'VisitorInterest_BetweenXYMinutes' => '%1s-%2s min',
'VisitorInterest_OnePage' => '1 page',
'VisitorInterest_NPages' => '%s pages',
'VisitorInterest_BetweenXYSeconds' => '%1s-%2ss',
diff --git a/plugins/ExamplePlugin/ExamplePlugin.php b/plugins/ExamplePlugin/ExamplePlugin.php
index 6bbe8da827..6e9a57d28e 100644
--- a/plugins/ExamplePlugin/ExamplePlugin.php
+++ b/plugins/ExamplePlugin/ExamplePlugin.php
@@ -155,6 +155,20 @@ class Piwik_ExamplePlugin_Controller extends Piwik_Controller
$out .= 'View the list of API methods you can call on <a href="http://dev.piwik.org/trac/wiki/API/Reference#Methods">API reference</a><br/>';
$out .= 'For example you can try <code>Piwik_UsersManager_API::getInstance()->getUsersSitesFromAccess("view");</code> or <code>Piwik_UsersManager_API::getInstance()->deleteUser("userToDelete");</code><br/>';
+ $out .= '<h2>Javascript in Piwik</h2>';
+ $out .= '<h3>i18n internationalization</h3>';
+ $out .= 'In order to translate strings within Javascript code, you can use the javascript function _pk_translate( token );.
+ <ul><li>The "token" parameter is the string unique key found in the translation file. For this token string to be available in Javascript, you must
+ suffix your token by "_js" in the language file. For example, you can add <code>\'Goals_AddGoal_js\' => \'Add Goal\',</code> in the lang/en.php file</li>
+ <li>You then need to instruct Piwik to load your Javascript translations for your plugin; by default, all translation strings are not loaded in Javascript for performance reasons. This can be done by calling the Smarty modifier before any your javascript includes that would be using the translations, eg.
+ <code>{loadJavascriptTranslations plugins=\'$YOUR_PLUGIN_NAME\'}</code>. In our previous example, the $YOUR_PLUGIN_NAME being Goals, we would write <code>{loadJavascriptTranslations plugins=\'Goals\'}</code>
+ </li><li>You can then print this string from your JS code by doing <code>_pk_translate(\'Goals_AddGoal_js\');</code>.
+ </li></ul>';
+
+ $out .= '<h3>Reload a widget in the dashboard</h3>';
+ $out .= 'It is sometimes useful to reload one widget in the dashboard (for example, every 20 seconds for a real time widget, or after a setting change).
+ You can easily force your widget to reload in the dashboard by calling the helper function <code>piwik.dashboardObject.reloadEnclosingWidget($(this));</code>.';
+
$out .= '<h2>Smarty plugins</h2>';
$out .= 'There are some builtin plugins for Smarty especially developped for Piwik. <br>
You can find them on the <a href="http://dev.piwik.org/trac/browser/trunk/core/SmartyPlugins">SVN at /trunk/core/SmartyPlugins</a>. <br>
diff --git a/plugins/Goals/templates/GoalForm.js b/plugins/Goals/templates/GoalForm.js
index 22751ac0d3..b8972eb903 100644
--- a/plugins/Goals/templates/GoalForm.js
+++ b/plugins/Goals/templates/GoalForm.js
@@ -42,11 +42,6 @@ function initGoalForm(goalMethodAPI, submitText, goalName, matchAttribute, patte
}
}
-function initAndShowAddGoalForm()
-{
- initGoalForm('Goals.addGoal', 'Add Goal', '', 'url', '', 'contains', false, '0');
- return showAddNewGoal();
-}
function bindGoalForm()
{
@@ -80,31 +75,6 @@ function bindGoalForm()
initAndShowAddGoalForm();
} );
}
-
-function bindListGoalEdit()
-{
- $('a[name=linkEditGoal]').click( function() {
- var goalId = $(this).attr('id');
- var goal = piwik.goals[goalId];
- initGoalForm("Goals.updateGoal", "Update Goal", goal.name, goal.match_attribute, goal.pattern, goal.pattern_type, (goal.case_sensitive=='0' ? false : true), goal.revenue, goalId);
- showAddNewGoal();
- return false;
- });
-
- $('a[name=linkDeleteGoal]').click( function() {
- var goalId = $(this).attr('id');
- var goal = piwik.goals[goalId];
- if(confirm(sprintf("Are you sure you want to delete the Goal '%s'?", goal.name)))
- {
- $.ajax( getAjaxDeleteGoal( goalId ) );
- }
- return false;
- });
-
- $('a[name=linkEditGoals]').click( function(){
- return showEditGoals();
- } );
-}
function getAjaxDeleteGoal(idGoal)
{
var ajaxRequest = piwikHelper.getStandardAjaxConf();
@@ -112,11 +82,11 @@ function getAjaxDeleteGoal(idGoal)
var parameters = {};
parameters.idSite = piwik.idSite;
- parameters.idGoal = idGoal;
- parameters.method = 'Goals.deleteGoal';
+ parameters.idGoal = idGoal;
+ parameters.method = 'Goals.deleteGoal';
parameters.module = 'API';
parameters.format = 'json';
- parameters.token_auth = piwik.token_auth;
+ parameters.token_auth = piwik.token_auth;
ajaxRequest.data = parameters;
return ajaxRequest;
}
@@ -130,7 +100,7 @@ function getAjaxAddGoal()
parameters.idSite = piwik.idSite;
parameters.name = encodeURIComponent( $('#goal_name').val() );
-
+
if($('[name=trigger_type]').val() == 'manually') {
parameters.matchAttribute = 'manually';
parameters.patternType = 'regex';
@@ -144,12 +114,43 @@ function getAjaxAddGoal()
}
parameters.revenue = $('input[name=revenue]').val();
- parameters.idGoal = $('input[name=goalIdUpdate]').val();
- parameters.method = $('input[name=methodGoalAPI]').val();
+ parameters.idGoal = $('input[name=goalIdUpdate]').val();
+ parameters.method = $('input[name=methodGoalAPI]').val();
parameters.module = 'API';
parameters.format = 'json';
- parameters.token_auth = piwik.token_auth;
+ parameters.token_auth = piwik.token_auth;
ajaxRequest.data = parameters;
return ajaxRequest;
}
+
+function bindListGoalEdit()
+{
+ $('a[name=linkEditGoal]').click( function() {
+ var goalId = $(this).attr('id');
+ var goal = piwik.goals[goalId];
+ initGoalForm("Goals.updateGoal", _pk_translate('Goals_UpdateGoal_js'), goal.name, goal.match_attribute, goal.pattern, goal.pattern_type, (goal.case_sensitive=='0' ? false : true), goal.revenue, goalId);
+ showAddNewGoal();
+ return false;
+ });
+
+ $('a[name=linkDeleteGoal]').click( function() {
+ var goalId = $(this).attr('id');
+ var goal = piwik.goals[goalId];
+ if(confirm(sprintf(_pk_translate('Goals_DeleteGoalConfirm_js'), '"'+goal.name+'"')))
+ {
+ $.ajax( getAjaxDeleteGoal( goalId ) );
+ }
+ return false;
+ });
+
+ $('a[name=linkEditGoals]').click( function(){
+ return showEditGoals();
+ } );
+}
+
+function initAndShowAddGoalForm()
+{
+ initGoalForm('Goals.addGoal', _pk_translate('Goals_AddGoal_js'), '', 'url', '', 'contains', false, '0');
+ return showAddNewGoal();
+} \ No newline at end of file
diff --git a/plugins/Goals/templates/add_edit_goal.tpl b/plugins/Goals/templates/add_edit_goal.tpl
index c09f1cdab3..997f68d61a 100644
--- a/plugins/Goals/templates/add_edit_goal.tpl
+++ b/plugins/Goals/templates/add_edit_goal.tpl
@@ -1,15 +1,18 @@
<div id="AddEditGoals">
{if isset($onlyShowAddNewGoal)}
- <h2>Add a new Goal</h2>
+ <h2>{'Goals_AddNewGoal'|translate}</h2>
{else}
- <h2><a onclick='' name="linkAddNewGoal">+ Add a new Goal</a>
- or <a onclick='' name="linkEditGoals">Edit</a> existing Goals</h2>
+ <h2>
+ {'Goals_AddNewGoalOrEditExistingGoal'|translate:"<a onclick='' name='linkAddNewGoal'>+":"</a>":"<a onclick='' name='linkEditGoals'>":"</a>"}
+ </h2>
{/if}
<div>
- <div id="ajaxError" style="display:none"></div>
- <div id="ajaxLoading" style="display:none"><div id="loadingPiwik"><img src="themes/default/images/loading-blue.gif" alt="" /> {'General_LoadingData'|translate}</div></div>
+ <div id="ajaxError" style="display:none"></div>
+ <div id="ajaxLoading" style="display:none">
+ <div id="loadingPiwik"><img src="themes/default/images/loading-blue.gif" alt="" /> {'General_LoadingData'|translate}</div>
+ </div>
</div>
{if !isset($onlyShowAddNewGoal)}
@@ -20,25 +23,28 @@
<a id='bottom'></a>
</div>
-{literal}
+{loadJavascriptTranslations plugins='Goals'}
<script type="text/javascript" src="plugins/Goals/templates/GoalForm.js"></script>
<script language="javascript">
-var mappingMatchTypeName = {
+var mappingMatchTypeName = {ldelim}
"url": "URL",
"file": "filename",
"external_website": "external website URL"
-};
-var mappingMatchTypeExamples = {
- "url": "eg. contains 'checkout/confirmation'<br>eg. is exactly 'http://example.com/thank-you.html'<br>eg. matches the expression '(.*)\\\/demo\\\/(.*)'",
- "file": "eg. contains 'files/brochure.pdf'<br>eg. is exactly 'http://example.com/files/brochure.pdf'<br>eg. matches the expression '(.*)\\\.zip'",
- "external_website": "eg. contains 'amazon.com'<br>eg. is exactly 'http://mypartner.com/landing.html'<br>eg. matches the expression 'http://www.amazon.com\\\/(.*)\\\/yourAffiliateId'"
-};
-
+{rdelim};
+var mappingMatchTypeExamples = {ldelim}
+ "url": "{'General_ForExampleShort'|translate} {'Goals_Contains'|translate:"'checkout/confirmation'"} \
+ <br/>{'General_ForExampleShort'|translate} {'Goals_IsExactly'|translate:"'http://example.com/thank-you.html'"} \
+ <br/>{'General_ForExampleShort'|translate} {'Goals_MatchesExpression'|translate:"matches the expression '(.*)\\\/demo\\\/(.*)'"}",
+ "file": "{'General_ForExampleShort'|translate} {'Goals_Contains'|translate:"'files/brochure.pdf'"} \
+ <br/>{'General_ForExampleShort'|translate} {'Goals_IsExactly'|translate:"'http://example.com/files/brochure.pdf'"} \
+ <br/>{'General_ForExampleShort'|translate} {'Goals_MatchesExpression'|translate:"'(.*)\\\.zip'"}",
+ "external_website": "{'General_ForExampleShort'|translate} {'Goals_Contains'|translate:"'amazon.com'"} \
+ <br>{'General_ForExampleShort'|translate} {'Goals_IsExactly'|translate:"'http://mypartner.com/landing.html'"} \
+ <br>{'General_ForExampleShort'|translate} {'Goals_MatchesExpression'|translate:"'http://www.amazon.com\\\/(.*)\\\/yourAffiliateId'"}"
+{rdelim};
bindGoalForm();
-{/literal}
-
{if !isset($onlyShowAddNewGoal)}
piwik.goals = {$goalsJSON};
bindListGoalEdit();
diff --git a/plugins/Goals/templates/add_new_goal.tpl b/plugins/Goals/templates/add_new_goal.tpl
index 05a7f66e8d..7450bf4764 100644
--- a/plugins/Goals/templates/add_new_goal.tpl
+++ b/plugins/Goals/templates/add_new_goal.tpl
@@ -2,7 +2,5 @@
{if $userCanEditGoals}
{include file=Goals/templates/add_edit_goal.tpl}
{else}
-Only an Administrator or the Super User can add Goals for a given website.
-Please ask your Piwik administrator to set up a Goal for your website.
-<br>Tracking Goals are a great tool to help you maximize your website performance!
+{'Goals_NoGoalsNeedAccess'|translate}
{/if}
diff --git a/plugins/Goals/templates/form_add_goal.tpl b/plugins/Goals/templates/form_add_goal.tpl
index 4f4b12f838..9c0178b9b2 100644
--- a/plugins/Goals/templates/form_add_goal.tpl
+++ b/plugins/Goals/templates/form_add_goal.tpl
@@ -1,85 +1,84 @@
{literal}
<style>
.goalInlineHelp{
-color:#9B9B9B;
+ color:#9B9B9B;
+}
+.tableForm {
+ width:700px;
}
</style>
{/literal}
<span id='GoalForm' style="display:none;">
<form>
- <table class="tableForm">
- <tbody>
- <tr>
- <td>Goal Name </td>
- <td><input type="text" name="name" value="" id="goal_name" /></td>
- </tr>
- <tr>
- <td>Goal is triggered
- <select name="trigger_type">
- <option value="visitors">when visitors</option>
- <option value="manually">manually</option>
- </select>
- </td>
- <td>
- <input type="radio" id="match_attribute_url" value="url" name="match_attribute" />
- <label for="match_attribute_url">Visit a given URL (page or group of pages)</label>
- <br />
- <input type="radio" id="match_attribute_file" value="file" name="match_attribute" />
- <label for="match_attribute_file">Download a file</label>
- <br />
- <input type="radio" id="match_attribute_external_website" value="external_website" name="match_attribute" />
- <label for="match_attribute_external_website">Click on a Link to an external website </label>
- </td>
- </tr>
- </tbody>
- <tbody id="match_attribute_section">
- <tr>
- <td>where the <span id="match_attribute_name"></span></td>
- <td>
- <select name="pattern_type">
- <option value="contains">contains</option>
- <option value="exact">is exactly</option>
- <option value="regex">matches the expression</option>
- </select>
-
- <input type="text" name="pattern" value="" />
- <br />
- <div id="examples_pattern" class="goalInlineHelp"></div>
- <br />
- <span style="float:right">
- (optional) <input type="checkbox" id="case_sensitive" />
- <label for="case_sensitive">Case sensitive match</label>
- </span>
- </td>
- </tr>
- </tbody>
- <tbody id="manual_trigger_section" style="display:none">
- <tr>
- <td colspan="2">
- where the visited page manually calls the JavaScript piwikTracker.trackGoal() method (<a target='_blank' href='misc/redirectToUrl.php?url=http://piwik.org/docs/javascript-tracking/'>learn more</a>)
- </td>
- </tr>
- </tbody>
- <tbody>
- <tr>
- <td>(optional) Goal default value is </td>
- <td>{$currency} <input type="text" name="revenue" size="1" value="0" />
- <div class="goalInlineHelp">
- For example, a Contact Form submitted by a visitor <br />
- may be worth $10 on average. Piwik will help you understand <br />
- how well your visitors segments are performing.</div>
- </td>
- </tr>
- <tr>
- <td colspan="2" style="border:0">
- <div class="submit">
- <input type="hidden" name="methodGoalAPI" value="" />
- <input type="hidden" name="goalIdUpdate" value="" />
- <input type="submit" value="Add Goal" name="submit" id="goal_submit" class="submit" />
- </div>
- </td>
+<table class="tableForm">
+ <tbody>
+ <tr>
+ <td>{'Goals_GoalName'|translate} </td>
+ <td><input type="text" name="name" value="" id="goal_name" /></td>
+ </tr>
+ <tr>
+ <td style='width:240px;'>{'Goals_GoalIsTriggered'|translate}
+ <select name="trigger_type">
+ <option value="visitors">{'Goals_WhenVisitors'|translate}</option>
+ <option value="manually">{'Goals_Manually'|translate}</option>
+ </select>
+ </td>
+ <td>
+ <input type="radio" id="match_attribute_url" value="url" name="match_attribute"/>
+ <label for="match_attribute_url">{'Goals_VisitUrl'|translate}</label>
+ <br />
+ <input type="radio" id="match_attribute_file" value="file" name="match_attribute"/>
+ <label for="match_attribute_file">{'Goals_Download'|translate}</label>
+ <br />
+ <input type="radio" id="match_attribute_external_website" value="external_website" name="match_attribute"/>
+ <label for="match_attribute_external_website">{'Goals_ClickOutlink'|translate}</label>
+ </td>
</tr>
- </tbody>
- </table>
+ </tbody>
+ <tbody id="match_attribute_section">
+ <tr>
+ <td>where the <span id="match_attribute_name"></span></td>
+ <td>
+ <select name="pattern_type">
+ <option value="contains">{'Goals_Contains'|translate:""}</option>
+ <option value="exact">{'Goals_IsExactly'|translate:""}</option>
+ <option value="regex">{'Goals_MatchesExpression'|translate:""}</option>
+ </select>
+
+ <input type="text" name="pattern" value="" />
+ <br />
+ <div id="examples_pattern" class="goalInlineHelp"></div>
+ <br />
+ <span style="float:right">
+ {'Goals_Optional'|translate} <input type="checkbox" id="case_sensitive"/>
+ <label for="case_sensitive">{'Goals_CaseSensitive'|translate}</label>
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ <tbody id="manual_trigger_section" style="display:none">
+ <tr><td colspan="2">
+ {'Goals_WhereVisitedPageManuallyCallsJavascriptTrackerLearnMore'|translate:"<a target='_blank' href='misc/redirectToUrl.php?url=http://piwik.org/docs/javascript-tracking/'>":"</a>"}
+ </td></tr>
+ </tbody>
+ <tbody>
+ <tr>
+ <td>(optional) {'Goals_DefaultRevenue'|translate}</td>
+ <td>{$currency} <input type="text" name="revenue" size="1" value="0"/>
+ <div class="goalInlineHelp"> {'Goals_DefaultRevenueHelp'|translate} </div>
+ </td>
+ </tr>
+ <tr>
+ <tr>
+ <td colspan="2" style="border:0">
+ <div class="submit">
+ <input type="hidden" name="methodGoalAPI" value="" />
+ <input type="hidden" name="goalIdUpdate" value="" />
+ <input type="submit" value="" name="submit" id="goal_submit" class="submit" />
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
</form>
</span>
diff --git a/plugins/Goals/templates/list_goal_edit.tpl b/plugins/Goals/templates/list_goal_edit.tpl
index 92cab34b25..c5081b3fc2 100644
--- a/plugins/Goals/templates/list_goal_edit.tpl
+++ b/plugins/Goals/templates/list_goal_edit.tpl
@@ -1,22 +1,42 @@
+
<span id='EditGoals' style="display:none;">
<table class="tableForm">
<thead style="font-weight:bold">
<td>Id</td>
- <td>Goal Name</td>
- <td>Goal is Triggered when</td>
- <td>Revenue</td>
- <td>Edit</td>
- <td>Delete</td>
+ <td>{'Goals_GoalName'|translate}</td>
+ <td>{'Goals_GoalIsTriggeredWhen'|translate}</td>
+ <td>{'Goals_ColumnRevenue'|translate}</td>
+ <td>{'General_Edit'|translate}</td>
+ <td>{'General_Delete'|translate}</td>
</thead>
{foreach from=$goals item=goal}
<tr>
<td>{$goal.idgoal}</td>
<td>{$goal.name}</td>
- <td>{$goal.match_attribute} {if isset($goal.pattern_type)}<br>Pattern {$goal.pattern_type}: {$goal.pattern}</b>{/if}</td>
+ <td><span class='matchAttribute'>{$goal.match_attribute}</span> {if isset($goal.pattern_type)}<br>{'Goals_Pattern'|translate} {$goal.pattern_type}: {$goal.pattern}</b>{/if}</td>
<td>{if $goal.revenue==0}-{else}{$currency}{$goal.revenue}{/if}</td>
- <td><a href='#' name="linkEditGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/edit.png' border=0> Edit</a></td>
- <td><a href='#' name="linkDeleteGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/remove.png' border=0> Delete</a></td>
+ <td><a href='#' name="linkEditGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/edit.png' border=0> {'General_Edit'|translate}</a></td>
+ <td><a href='#' name="linkDeleteGoal" id="{$goal.idgoal}"><img src='plugins/UsersManager/images/remove.png' border=0> {'General_Delete'|translate}</a></td>
</tr>
{/foreach}
</table>
</span>
+
+<script language="javascript">
+var goalTypeToTranslation = {ldelim}
+ "manually" : "{'Goals_ManuallyTriggeredUsingJavascriptFunction'|translate}",
+ "file" : "{'Goals_Download'|translate}",
+ "url" : "{'Goals_VisitUrl'|translate}",
+ "external_website" : "{'Goals_ClickOutlink'|translate}"
+{rdelim}
+{literal}
+$(document).ready( function() {
+ // translation of the goal "match attribute" to human readable description
+ $('.matchAttribute').each( function() {
+ matchAttribute = $(this).text();
+ translation = goalTypeToTranslation[matchAttribute];
+ $(this).text(translation);
+ });
+} );
+{/literal}
+</script> \ No newline at end of file
diff --git a/plugins/Goals/templates/list_top_segment.tpl b/plugins/Goals/templates/list_top_segment.tpl
index 6dbe69813f..0848990fd0 100644
--- a/plugins/Goals/templates/list_top_segment.tpl
+++ b/plugins/Goals/templates/list_top_segment.tpl
@@ -1,5 +1,10 @@
{foreach from=$topSegment item=element name=topGoalElements}
-<span class='goalTopElement' title='<b>{$element.nb_conversions}</b> conversions, <b>{$element.conversion_rate}%</b> conversion rate'>
-{$element.name}</span>{logoHtml metadata=$element.metadata alt=$element.name}{if $smarty.foreach.topGoalElements.iteration == $smarty.foreach.topGoalElements.total-1} and {elseif $smarty.foreach.topGoalElements.iteration < $smarty.foreach.topGoalElements.total-1}, {else}{/if}
+{assign var=nb_conversion value=$element.nb_conversions}
+{assign var=conversion_rate value=$element.conversion_rate}
+<span class='goalTopElement' title='{'Goals_Conversions'|translate:"<b>$nb_conversions</b>"},
+ {'Goals_ConversionRate'|translate:"<b>$conversion_rate%</b>"}'>
+{$element.name}</span>
+{logoHtml metadata=$element.metadata alt=$element.name}
+{if $smarty.foreach.topGoalElements.iteration == $smarty.foreach.topGoalElements.total-1} and {elseif $smarty.foreach.topGoalElements.iteration < $smarty.foreach.topGoalElements.total-1}, {else}{/if}
{/foreach} {* (<a href=''>more</a>) *}
diff --git a/plugins/Goals/templates/overview.tpl b/plugins/Goals/templates/overview.tpl
index 1e342840dc..04afb70adb 100644
--- a/plugins/Goals/templates/overview.tpl
+++ b/plugins/Goals/templates/overview.tpl
@@ -7,12 +7,12 @@
<h2 style="padding-top: 30px;">{$goal.name} (goal)</h2>
<div id='leftcolumn'>
<div class="sparkline">{sparkline src=$goal.urlSparklineConversions}
- {'%s conversions'|translate:"<strong>$nb_conversions</strong>"}</div>
+ {'Goals_Conversions'|translate:"<strong>$nb_conversions</strong>"}</div>
</div>
<div id='rightcolumn'>
<div class="sparkline">{sparkline src=$goal.urlSparklineConversionRate}
- {'%s conversion rate'|translate:"<strong>$conversion_rate%</strong>"}</div>
- {* (<a href=''>more</a>) *}
+ {'Goals_ConversionRate'|translate:"<strong>$conversion_rate%</strong>"}</div>
+ {* (<a href=''>{'General_More'|translate}</a>) *}
</div>
{/foreach}
diff --git a/plugins/Goals/templates/single_goal.tpl b/plugins/Goals/templates/single_goal.tpl
index 8beb4593c4..c0b45b8dde 100644
--- a/plugins/Goals/templates/single_goal.tpl
+++ b/plugins/Goals/templates/single_goal.tpl
@@ -2,12 +2,12 @@
<div style="clear:both;"></div>
{if $nb_conversions > 0}
- <h2>Conversions Overview</h2>
+ <h2>{'Goals_ConversionsOverview'|translate}</h2>
<ul class="ulGoalTopElements">
- <li>Your best converting countries are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.country}</li>
- {if count($topSegments.keyword)>0}<li>Your top converting keywords are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.keyword}</li>{/if}
- {if count($topSegments.website)>0}<li>Your best converting websites referers are: {include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.website}</li>{/if}
- <li>Returning visitors conversion rate is <b>{$conversion_rate_returning}%</b>, New Visitors conversion rate is <b>{$conversion_rate_new}%</b></li>
+ <li>{'Goals_BestCountries'|translate}{include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.country}</li>
+ {if count($topSegments.keyword)>0}<li>{'Goals_BestKeywords'|translate}{include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.keyword}</li>{/if}
+ {if count($topSegments.website)>0}<li>{'Goals_BestReferers'|translate}{include file='Goals/templates/list_top_segment.tpl' topSegment=$topSegments.website}</li>{/if}
+ <li>{'Goals_ReturningVisitorsConversionRateIs'|translate:"<b>$conversion_rate_returning%</b>"}, {'Goals_NewVisitorsConversionRateIs'|translate:"<b>$conversion_rate_new%</b>"}</li>
</ul>
{/if}
<hr>
diff --git a/plugins/Goals/templates/title_and_evolution_graph.tpl b/plugins/Goals/templates/title_and_evolution_graph.tpl
index 8a344df003..aad9a9d7e6 100644
--- a/plugins/Goals/templates/title_and_evolution_graph.tpl
+++ b/plugins/Goals/templates/title_and_evolution_graph.tpl
@@ -6,13 +6,13 @@
<div id='leftcolumn'>
<div class="sparkline">{sparkline src=$urlSparklineConversions}
- {'%s conversions'|translate:"<strong>$nb_conversions</strong>"}</div>
+ {'Goals_Conversions'|translate:"<strong>$nb_conversions</strong>"}</div>
{if $revenue != 0 }
<div class="sparkline">{sparkline src=$urlSparklineRevenue}
- {'%s overall revenue'|translate:"<strong>$currency$revenue</strong>"}</div>
+ {'Goals_OverallRevenue'|translate:"<strong>$currency$revenue</strong>"}</div>
{/if}
</div>
<div id='rightcolumn'>
<div class="sparkline">{sparkline src=$urlSparklineConversionRate}
- {'%s overall conversion rate (visits with a completed goal)'|translate:"<strong>$conversion_rate%</strong>"}</div>
+ {'Goals_OverallConversionRate'|translate:"<strong>$conversion_rate%</strong>"}</div>
</div>