Loading...
 
Skip to main content

Watching of Tracker won't work in other language than 'en'

Status
Closed
Subject
Watching of Tracker won't work in other language than 'en'
Version
1.9.x
Category
  • Error
Feature
Trackers
Submitted by
purcaholic
Volunteered to solve
purcaholic
Rating
(0)
Description

Hi there,

found a issue while using the tracker on a TikiWiki installation which is running in german language.

Following code is used in file tiki-view_tracker.php to set the monitor state:

Image
Copy to clipboard
if (in_array($user_email, $emails)) { $smarty->assign('email_mon', tra('Cancel monitoring')); } else { $smarty->assign('email_mon', tra('Monitor')); }


and the smarty template '/templates/tiki-view_tracker.tpl' uses following snippet to handle the monitor state:

Image
Copy to clipboard
{if $email_mon eq 'Monitor'} <a href="tiki-view_tracker.php?trackerId={$trackerId}&amp;monitor=y" title="{tr}monitor{/tr}"><img src="img/icons/icon_watch.png" width="16" height="16" border="0" align="right" hspace="5" alt="{tr}monitor{/tr}" /></a> {else} <a href="tiki-view_tracker.php?trackerId={$trackerId}&amp;monitor=n" title="{tr}stop monitor{/tr}"><img src="img/icons/icon_unwatch.png" width="16" height="16" border="0" align="right" hspace="5" alt="{tr}stop monitor{/tr}" /></a> {/if}


The smarty variable $email_mon contains 'Monitor', if TiiWiki runs in englisch, in other languages the content will differ, depending on translation (e. g. 'Überwachen' in german).

Greetings
purcaholic

Solution

I'm a TikiWiki greenhorn, but a usage of an language independent smarty variable could be a solution (maybe there is a better way...).

tiki-view_tracker.php:

Image
Copy to clipboard
if (in_array($user_email, $emails)) { $smarty->assign('email_mon', tra('Cancel monitoring')); $smarty->assign('email_mon_state', 'n'); } else { $smarty->assign('email_mon', tra('Monitor')); $smarty->assign('email_mon_state', 'y'); }


/templates/tiki-view_tracker.tpl:

Image
Copy to clipboard
{if $email_mon_state eq 'y'} <a href="tiki-view_tracker.php?trackerId={$trackerId}&amp;monitor=y" title="{tr}monitor{/tr}"><img src="img/icons/icon_watch.png" width="16" height="16" border="0" align="right" hspace="5" alt="{tr}monitor{/tr}" /></a> {else} <a href="tiki-view_tracker.php?trackerId={$trackerId}&amp;monitor=n" title="{tr}stop monitor{/tr}"><img src="img/icons/icon_unwatch.png" width="16" height="16" border="0" align="right" hspace="5" alt="{tr}stop monitor{/tr}" /></a> {/if}


Fixed 1.9.9

Importance
2
Priority
10
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
1370
Created
Tuesday 02 October, 2007 17:38:43 UTC
by Unknown
LastModif
Wednesday 03 October, 2007 12:48:00 UTC


Show PHP error messages