Skip Menu |
 

This queue is for tickets about the RT-Extension-TicketLocking CPAN distribution.

Report information
The Basics
Id: 101745
Status: open
Priority: 0/
Queue: RT-Extension-TicketLocking

People
Owner: Nobody in particular
Requestors: ELACOUR [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)

Attachments


Subject: Missing loc calls
Download (untitled) / with headers
text/plain 1.2k
Attached patch adds some missing loc calls. There is still two ugly plaes where I do not know how to set localization: diff --git a/html/Callbacks/RT-Extension-TicketLocking/Ticket/Display.html/BeforeActionList b/html/Callbacks/RT-Extension-TicketLocking/Ticket/Display.html/BeforeActionList index 535c545..b93e518 100644 --- a/html/Callbacks/RT-Extension-TicketLocking/Ticket/Display.html/BeforeActionList +++ b/html/Callbacks/RT-Extension-TicketLocking/Ticket/Display.html/BeforeActionList @@ -8,6 +8,7 @@ $Actions => undef #variables except for id unless($Duration) { my $msg = (grep defined && m{You have unlocked this ticket\. It was locked for (\d+) seconds\.}i, @$Actions)[-1]; + # FIXME: How to loc this? if ( $msg && $msg =~ /(You have unlocked this ticket\.) It was locked for (\d+) seconds\./i ) { $ARGS{'Duration'} = $2 if $2 && $2 !~ /\./; } diff --git a/html/Elements/ShowLock b/html/Elements/ShowLock index a83d05f..71ddfab 100644 --- a/html/Elements/ShowLock +++ b/html/Elements/ShowLock @@ -49,6 +49,7 @@ %} <%INIT> foreach ( grep defined, @{ $ARGS{'Actions'} || [] } ) { + # FIXME: how to loc this? s/(You have unlocked this ticket\.) It was locked for \d+ seconds\./$1/i; } if ( $Id ) {
Subject: 0001-Add-missing-loc-calls.patch
From 2cb741c6d0b15e74db8157bcdbf58ecfd7f01510 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Mon, 26 Jan 2015 13:36:00 +0100 Subject: [PATCH 1/3] Add missing loc calls --- html/Elements/ShowLock | 4 ++-- lib/RT/Extension/TicketLocking.pm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html/Elements/ShowLock b/html/Elements/ShowLock index 81a9c4a..a83d05f 100644 --- a/html/Elements/ShowLock +++ b/html/Elements/ShowLock @@ -23,7 +23,7 @@ %# %# END LICENSE BLOCK -% my $TicketLabel = $Id ? "Ticket #$Id" : 'this ticket'; +% my $TicketLabel = $Id ? loc("Ticket #[_1]", $Id) : loc('this ticket'); % if ($Duration ||($u->id && $u->id == $session{'CurrentUser'}->id)) { <div class="locked-by-you"> @@ -40,7 +40,7 @@ </div> % } elsif ($u->id) { % my $u_str = $m->scomp('/Elements/ShowUser', User => $u); -% $TicketLabel = 'This ticket' if $TicketLabel eq 'this ticket'; +% $TicketLabel = loc('This ticket') if $TicketLabel eq loc('this ticket'); % $TicketLabel = $m->interp->apply_escapes($TicketLabel, 'h'); % $ago = $m->interp->apply_escapes($ago, 'h'); <div class="locked"> diff --git a/lib/RT/Extension/TicketLocking.pm b/lib/RT/Extension/TicketLocking.pm index 55b334f..86b4cc4 100644 --- a/lib/RT/Extension/TicketLocking.pm +++ b/lib/RT/Extension/TicketLocking.pm @@ -343,17 +343,17 @@ sub Unlock { my $type = shift || 'Auto'; my $lock = $ticket->RT::Ticket::Locked(); - return (undef, "This ticket was not locked.") unless $lock; - return (undef, "You cannot unlock a ticket locked by another user.") + return (undef, $ticket->CurrentUser->loc("This ticket was not locked.")) unless $lock; + return (undef, $ticket->CurrentUser->loc("You cannot unlock a ticket locked by another user.")) unless $lock->Content->{User} == $ticket->CurrentUser->id; my $current_type = $lock->Content->{'Type'}; - return (undef, "There is a lock with a higher priority on this ticket.") + return (undef, $ticket->CurrentUser->loc("There is a lock with a higher priority on this ticket.")) if $ticket->LockPriority( $type ) < $ticket->LockPriority( $current_type ); my $duration = time() - $lock->Content->{'Timestamp'}; $ticket->DeleteAttribute('RT_Lock'); - return ($duration, "You have unlocked this ticket. It was locked for $duration seconds."); + return ($duration, $ticket->CurrentUser->loc("You have unlocked this ticket. It was locked for [_1] seconds.", $duration)); } -- 2.1.4
There is still missing locs, here is an additionnal patch.
Subject: 0001-Add-more-missing-loc-calls.patch
From 6f435552761a034886747cee174c0abd45e69d11 Mon Sep 17 00:00:00 2001 From: Emmanuel Lacour <elacour@easter-eggs.com> Date: Mon, 26 Jan 2015 14:02:15 +0100 Subject: [PATCH] Add more missing loc calls --- html/Elements/MyLocks | 8 ++++---- po/ticketlocking.pot | 18 +++++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/html/Elements/MyLocks b/html/Elements/MyLocks index 111a34d..5324a3a 100644 --- a/html/Elements/MyLocks +++ b/html/Elements/MyLocks @@ -48,14 +48,14 @@ <&|/Widgets/TitleBox, title => loc("Tickets locked by you") &> % if(@locks) { - <a href="index.html?UnlockAll=1">Unlock All</a> + <a href="index.html?UnlockAll=1"><&|/l&>Unlock All</&></a> <table border="0" cellspacing="0" cellpadding="1" width="100%" class="ticket-list"> <%PERL> my $expire_title; - $expire_title = {title => 'Expires in'} if $expiry; + $expire_title = {title => loc('Expires in')} if $expiry; $m->comp('/Elements/CollectionAsTable/Header', - Format => [{title => '#'}, {title => 'Subject'}, {title => 'Time Locked'}, $expire_title, {title => 'NBSP'}], + Format => [{title => '#'}, {title => loc('Subject')}, {title => loc('Time Locked')}, $expire_title, {title => 'NBSP'}], maxitems => ($expiry ? 5 : 4) ); @@ -74,7 +74,7 @@ {output => ["<a href=\"${RT::WebPath}/Ticket/Display.html?id=$id\">$subject</a>"]}, {output => [$date->DurationAsString($duration)]}, {output => [$expiryTime]}, - {output => ["<a href=\"${RT::WebPath}/Ticket/Display.html?id=$id&Lock=remove\">Unlock</a>"]}], + {output => ["<a href=\"${RT::WebPath}/Ticket/Display.html?id=$id&Lock=remove\">".loc('Unlock')."</a>"]}], maxitems => ($expiry ? 5 : 4), i => $i ); diff --git a/po/ticketlocking.pot b/po/ticketlocking.pot index b954d0b..bd0d36d 100644 --- a/po/ticketlocking.pot +++ b/po/ticketlocking.pot @@ -7,10 +7,18 @@ msgstr "" msgid "Break lock" msgstr "" +#: html/Elements/MyLocks:56 +msgid "Expires in" +msgstr "" + #: html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged:34 html/Callbacks/RT-Extension-TicketLocking/RTIR/Elements/QueueTabs/Default:24 html/Callbacks/RT-Extension-TicketLocking/Ticket/Elements/Tabs/Default:27 msgid "Lock" msgstr "" +#: html/Elements/MyLocks:58 +msgid "Subject" +msgstr "" + #: lib/RT/Extension/TicketLocking.pm:351 msgid "There is a lock with a higher priority on this ticket." msgstr "" @@ -32,10 +40,18 @@ msgstr "" msgid "Tickets locked by you" msgstr "" -#: html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged:21 html/Callbacks/RT-Extension-TicketLocking/RTIR/Elements/QueueTabs/Default:12 html/Callbacks/RT-Extension-TicketLocking/Ticket/Elements/Tabs/Default:16 +#: html/Elements/MyLocks:58 +msgid "Time Locked" +msgstr "" + +#: html/Callbacks/RT-Extension-TicketLocking/Elements/Tabs/Privileged:21 html/Callbacks/RT-Extension-TicketLocking/RTIR/Elements/QueueTabs/Default:12 html/Callbacks/RT-Extension-TicketLocking/Ticket/Elements/Tabs/Default:16 html/Elements/MyLocks:77 msgid "Unlock" msgstr "" +#: html/Elements/MyLocks:51 +msgid "Unlock All" +msgstr "" + #: lib/RT/Extension/TicketLocking.pm:347 msgid "You cannot unlock a ticket locked by another user." msgstr "" -- 2.1.4
Subject: Re: [rt.cpan.org #101745] Missing loc calls
Date: Mon, 26 Jan 2015 14:34:54 -0500
To: bug-RT-Extension-TicketLocking [...] rt.cpan.org
From: Alex Vandiver <alexmv [...] bestpractical.com>
Download (untitled) / with headers
text/plain 382b
On Mon, 26 Jan 2015 07:41:00 -0500 "Emmanuel Lacour via RT" <bug-RT-Extension-TicketLocking@rt.cpan.org> wrote: Show quoted text
> Attached patch adds some missing loc calls.
Thanks, applied. I expect the FIXME's need some larger changes to be right, but I don't have the time or context to rework the module at the moment. I'll leave this ticket open, and re-purpose it to fixing those. - Alex


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.