Re: [Catalyst] Hangs in RenderView in "end"

2009-07-08 Thread Gunnar Strand
Tomas Doran skrev:
>
> On 6 Jul 2009, at 05:33, Gunnar Strand wrote:
>>>
>>> Wow, that's a fairly unexpected gotcha.
>>>
>>> Any chance of a doc patch to make it easier for the next poor soul who
>>> gets stuck on this?
>> Sure. Where would you like it?
>
> A 'NOTES' or 'CAVEATS' section in the POD for Catalyst::View::TT is 
> the best place I can think of right now.
>
> Write something and it can go somewhere else if anyone has a better idea?

Here's what I wrote, and I've attached a patch for 
Catalyst::View::TT.pm. I'm very inexperienced using patches, so let me 
know if you want it in any other way.

=head1 NOTES

If you are using the L module inside your templates, and you
experience that the Catalyst server appears to hang while rendering
the web page, then it may be due to the debug mode of L (which is
waiting for input in the terminal window). You can try turning off the
debug mode using the "-no_debug" option and see if that solves you
problem, eg.:

[% USE CGI('-no_debug') %]



KR,
Gunnar

>
> Cheers
> t0m
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: 
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>







  

cgi_debug.patch
Description: Binary data
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] I18N with quotation marks

2009-07-08 Thread Gunnar Strand

Cosimo Streppone skrev:
> Gunnar Strand  wrote:
>
>> Ton Voon skrev:
>>>
>>> Final question: How do you internationalise a bit of text that does
>>> want some markup within it? For instance, I want something that 
>>> outputs:
>>>
>>> Click here for the about page.
>>
>> Wouldn't you need to send every part of the text through c.loc
>> individually? I guess something like this:
>>
>> c.loc("Click ") _ link _ c.loc(" for the about page")
>
> If you collect all your i18n messages into .po files,
> that are worked on by translators, they have little or no
> context information, so they are going to have a really
> hard time figuring out the sense of words.
>
> We internationalized a dynamic non-catalyst website in
> 19 languages now, and we found the following, in gettext notation,
> to be the best for front-end and back-end developers
> and translators.
>
>  _('Click here for the about page')
>
> So,
>
> 1) Keep the markup. It's ugly, but to us it's slightly better than
>   the alternatives.
>
> 2) Variables as variables. This also conserves strings
>   if/when you're changing URLs or variable content.
>   Example:
>
>   "You can upload up to [_1] Mb of pictures."
>
>   As the string embeds the variable, your string won't need
>   to be translated again if you change your upload limit.
>
> 3) Don't break sentences. In general, the longer, the better.
>   In general.
I agree completely, and I may have misunderstood the question, but I 
interpreted it that the I18Ned text would be put through an HTML filter. 
In that case the above example of having markup inside the text sent to 
the localizer will not work.

I personally prefer to use library routines for creating html markup 
instead of hard coding data. I am using Maketext for my project (I'm not 
very experienced yet), but it seems that an alternative would be to 
extend the language file with HTML support in it to produce 
corresponding output:

_('Click [link,_1,here] for the about page')

This would be prettier (IMHO) and allows the rendering mechanism for 
links to be put in one place.

KR,
Gunnar






  

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Themes, skins, templates and componentized UI?

2009-07-08 Thread Gunnar Strand

Zbigniew Lukasiak skrev:
> On Mon, Jul 6, 2009 at 9:55 PM, Gunnar Strand wrote:
>   
>> Hi,
>>
>> I am a little new in the web design area. I'm trying to design an
>> application where the "view" part must be simple to replace by whomever
>> installs it, with elements of their own design. This would work
>> comparable to "themes" or "skins". I've done some googling, but I
>> haven't got any obvious hits on this. The closest I _think_ is
>> "CatalystX::Usul", but I haven't really understood if that's what I'm
>> looking for :-)
>>
>> Also, I would also want the person installing the application to be able
>> to restructure the visual parts using "components", where a component
>> could for instance be a "result ticker", "main menu", "member table" or
>> such. Perhaps in the way that Joomla does, but the components will be
>> application specific. It's much a matter of deciding what components are
>> present in which views and where.
>>
>> I imagine, for instance, a collection of widgets (button,
>> drop-down-list, text field etc) which are reused in the TT templates. A
>> component would then use these widgets as building blocks, populating
>> them using data from the stash. A "view" (webpage) would be a template
>> including one or more of these components. A theme could then override
>> any widgets of choice to change the look-and-feel of the whole
>> application instantly.
>>
>> Am I approaching this from the right direction and does anyone know if
>> there exists a framework similar to this to use with Catalyst?
>>
>> Or should I perhaps go barking up the TT tree? ;-)
>> 
>
> I am working on CatalystX::Elements with the first one being Comments
> - I am not sure if it goes in the same direction - but it seems close.
>   The main goal is providing Catalyst feature addons - that could be
> used as kind of scaffolding - that is they should be easy to assemble,
> implying they are rather simplistic, and later easy to be gradually
> replaced.  For now I am not dealing with templates at all - the
> Comments element lets you to stash a form which knows how to render
> itself into HTML and can be inserted somewhere in the templates.
> I've posted about it at my blog:
> http://perlalchemy.blogspot.com/2009/06/catalystxcomments-rfc.html
> (also have a look at the comment).  There is some code for it at:
> http://github.com/gshank/ravlog/tree/8b7ec1493324212cde91927c15fc54cd2c9db25d/lib/CatalystX
> (but now I've decided to change the name and add Elements - a play on
> the chemical metaphor of Catalyst).
>
>
>   
Thanks, I'll take a look at it!

KR,
Gunnar







  

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Themes, skins, templates and componentized UI?

2009-07-08 Thread Gunnar Strand

John Napiorkowski skrev:
>
>
>
> - Original Message 
> From: Gunnar Strand 
> [...]
> I imagine, for instance, a collection of widgets (button, 
> drop-down-list, text field etc) which are reused in the TT templates. A 
> component would then use these widgets as building blocks, populating 
> them using data from the stash. A "view" (webpage) would be a template 
> including one or more of these components. A theme could then override 
> any widgets of choice to change the look-and-feel of the whole 
> application instantly.
>
> Am I approaching this from the right direction and does anyone know if 
> there exists a framework similar to this to use with Catalyst?
>
> Or should I perhaps go barking up the TT tree? ;-)
>
> KR,
> Gunnar
>
>
> ---
>
> The closet think to something componentized on the UI side would be Reaction,
>
> http://search.cpan.org/~mstrout/Reaction-0.002000/
>
> but that has very high development and I think you'd have to be willing to 
> get your hands 
> dirty with the code.  Although someone actually using it may correct me :)
>
> John
>   
Thanks. I'll go look it up.

KR,
Gunnar







  

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] New Apress book shipping now from Amazon.com

2009-07-08 Thread Thomas L. Shinnick

At 05:28 PM 7/8/2009, Kieren Diment wrote:


On 09/07/2009, at 7:40 AM, Ari Constancio wrote:

Hello,

For those interested, Amazon.com is shipping now pre-orders for "The
Definitive Guide to Catalyst". Not sure about new orders, though.

Regards,
Ari Constancio


Thanks for this.  Indeed they are, officially the book is being
released on Friday.


Anybody going to have one of those "link to Amazon from here and 
we'll get a donation" links on their web page.  (hint hint)

Hmm, http://books.perl.org/ should, but doesn't...?
(I'll wait until tomorrow before ordering)
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] New Apress book shipping now from Amazon.com

2009-07-08 Thread Kieren Diment


On 09/07/2009, at 7:40 AM, Ari Constancio wrote:


Hello,

For those interested, Amazon.com is shipping now pre-orders for "The
Definitive Guide to Catalyst". Not sure about new orders, though.

Regards,
Ari Constancio



Thanks for this.  Indeed they are, officially the book is being  
released on Friday.


I wrote about 2/3 of it, Matt Trout wrote about two chapters and  
helped me plan out the outline.  Eden Cardim (with a lot of help from  
Robert "Phaylon" Seladek) wrote chapter 12 on Reaction,  Jay Kuri  
wrote the Authenication chapter, and Jess Robinson the chapter on  
DBIx::Class.


Marcus Ramberg provided us with a foreword, and Jesse Scheidlower  
helped me a lot with the proof reading of the final stages of the  
book. A cast of many helped me with Chapter 11 (the Catalyst Cookbook).


And finally, here's the table of contents:


CHAPTER 1 Introducing the Catalyst Web Application  
Framework .1
CHAPTER 2 Catalyst Setup and Background Knowledge . 
19
CHAPTER 3 Your First Catalyst  
Application ..53
CHAPTER 4 Extending LolCatalyst- 
Lite ..81
CHAPTER 5  
Deployment ..  .109
CHAPTER 6 Database  
Models .. 135
CHAPTER 7 The Catalyst  
Dispatcher ...167
CHAPTER 8 Authentication and  
Authorization  ..189
CHAPTER 9 Interacting with Web Services in Your  
Applications .219
CHAPTER 10 Extending  
Catalyst . . ..233
CHAPTER 11 Catalyst  
Cookbook . . ..247
CHAPTER 12 The Reaction Component UI Framework  
303
APPENDIX A Compiling Your Own  
Perl . .315
APPENDIX B Making Your Own CPAN Mirror  with CPAN::Mini or  
minicpan.sh 317






___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] New Apress book shipping now from Amazon.com

2009-07-08 Thread Ari Constancio
Hello,

For those interested, Amazon.com is shipping now pre-orders for "The
Definitive Guide to Catalyst". Not sure about new orders, though.

Regards,
Ari Constancio

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst crashing hard with UTF-8 string

2009-07-08 Thread Tomas Doran


On 8 Jul 2009, at 18:01, Paul Makepeace wrote:

You know it's dieing inside TT, right? So you can Data::Dumper the  
input

which causes it to die to a file, write a program that instantiates
View::TT, calls ->render with the same input (and template), and  
that should

crap out in the same way?


Ya, I was kinda hoping you wouldn't say this, and that there was a way
to catch whatever was happening in Catalyst or trace the execution
path to get to the point where the things actually dieing.


Well, start by throwing Devel::SimpleTrace, or Carp::Always at it to  
get a strack trace.


MyApp::View::TT->render is going to get called, so add something like  
this to that class:


use Data::Dumper;
sub render {
my ($self, $c, $template, $args) = @_;
local $Data::Dumper::Maxdepth = 4;
warn Dumper([$template, $args]);
$self->next::method($c, $template, $args);
}

increase Maxdepth if needed until it pukes..

You should literally be able to dump the Dumper glob into a .t file,  
and build a test around it


use MyApp;
use MyApp::View::TT;

my $view = MyApp::View::TT->new(%config_your_app_gives_TT_view);
my $VAR! = # Dumper crap here

my ($template, $args) = @$VAR1;

$view->render('MyApp', $template, $args); # Should blow up, in the  
'correct' way..


Cutting template / data down to smallest replicable size and throwing  
away Catalyst app and using raw TT should be easy from there forwards :)


Another thought - have you tried disabling the XS stash for TT? (IIRC  
there is an env var to do this) and seeing if that affects the crash?


Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Hangs in RenderView in "end"

2009-07-08 Thread Gordon Yeong
Mod deflate was never on because i made sure apache2 was shut down.
I am using myapp_server.pl and the fault occurs.
Tried to replicate the problem with safari and it doesn't occur.
I believe there's some hidden complication with firefox.


This isn't a fastcgi/mod_deflate issue is it? Are you running both? If so,
> turn off mod_deflate and see if it fixes?
>
> Cheers
> t0m
>
>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst crashing hard with UTF-8 string

2009-07-08 Thread Paul Makepeace
On Wed, Jul 8, 2009 at 11:40 AM, Tomas Doran wrote:
> Paul Makepeace wrote:
>>
>> Something's definitely changed wrt to UTF-8 behavior since we did our
>> big upgrade from Catalyst 5.7. Are there any 'known gotchas' I could
>> check?
>>
>> At this point my debugging fu runs out--help appreciated on where to look
>> next.
>
> No gotchas that I can think of.
>
> Are you sure this is a Catalyst issue, and not caused by a recent TT
> upgrade?
>
> You know it's dieing inside TT, right? So you can Data::Dumper the input
> which causes it to die to a file, write a program that instantiates
> View::TT, calls ->render with the same input (and template), and that should
> crap out in the same way?

Ya, I was kinda hoping you wouldn't say this, and that there was a way
to catch whatever was happening in Catalyst or trace the execution
path to get to the point where the things actually dieing.

(FWIW, upgrading TT from 2.20 to 2.21 didn't appear to help.)

P

> Sound sane? And should give you something self contained which you can test
> with different TT versions easily..
>
> Cheers
> t0m
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Hangs in RenderView in "end"

2009-07-08 Thread Tomas Doran

Gordon Yeong wrote:

hi there

 I am facing almost the same issue in that even clicking the "stop" 
button on firefox would see no difference in the debugging terminal or 
have a response from the webpage.
When i have safari accesssing the same page, i can submit without a 
problem and the server doesn't hang.


 Any thoughts?


This isn't a fastcgi/mod_deflate issue is it? Are you running both? If 
so, turn off mod_deflate and see if it fixes?


Cheers
t0m

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst crashing hard with UTF-8 string

2009-07-08 Thread Tomas Doran

Paul Makepeace wrote:

Something's definitely changed wrt to UTF-8 behavior since we did our
big upgrade from Catalyst 5.7. Are there any 'known gotchas' I could
check?

At this point my debugging fu runs out--help appreciated on where to look next.


No gotchas that I can think of.

Are you sure this is a Catalyst issue, and not caused by a recent TT 
upgrade?


You know it's dieing inside TT, right? So you can Data::Dumper the input 
which causes it to die to a file, write a program that instantiates 
View::TT, calls ->render with the same input (and template), and that 
should crap out in the same way?


Sound sane? And should give you something self contained which you can 
test with different TT versions easily..


Cheers
t0m


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] I18N with quotation marks

2009-07-08 Thread Cosimo Streppone

Gunnar Strand  wrote:


Ton Voon skrev:


Final question: How do you internationalise a bit of text that does
want some markup within it? For instance, I want something that outputs:

Click here for the about page.


Wouldn't you need to send every part of the text through c.loc
individually? I guess something like this:

c.loc("Click ") _ link _ c.loc(" for the about page")


If you collect all your i18n messages into .po files,
that are worked on by translators, they have little or no
context information, so they are going to have a really
hard time figuring out the sense of words.

We internationalized a dynamic non-catalyst website in
19 languages now, and we found the following, in gettext notation,
to be the best for front-end and back-end developers
and translators.

  _('Click here for the about page')

So,

1) Keep the markup. It's ugly, but to us it's slightly better than
   the alternatives.

2) Variables as variables. This also conserves strings
   if/when you're changing URLs or variable content.
   Example:

   "You can upload up to [_1] Mb of pictures."

   As the string embeds the variable, your string won't need
   to be translated again if you change your upload limit.

3) Don't break sentences. In general, the longer, the better.
   In general.

--
Cosimo

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] I18N with quotation marks

2009-07-08 Thread Gunnar Strand

Ton Voon skrev:
>
> On 2 Jul 2009, at 09:35, Ton Voon wrote:
>
>> Does everyone agree this makes sense? If so, any objections if I add 
>> this to http://dev.catalystframework.org/wiki/best_practices?
>
> I've added a section at 
> http://dev.catalystframework.org/wiki/best_practices now.
>
> This includes Jose Luis Martinez's suggestions for the 
> escape_js_string routine, implemented as a TT filter.
>
> Final question: How do you internationalise a bit of text that does 
> want some markup within it? For instance, I want something that outputs:
>
> Click here for the about page.
>
> If I do something like:
>
> link = '' _ c.loc("here") _ '';
> c.loc("Click %1 for the about page", link)
>
> Then I cannot filter through html for the 2nd loc output.
>
> Is there a nicer way?
Wouldn't you need to send every part of the text through c.loc 
individually? I guess something like this:

c.loc("Click ") _ link _ c.loc(" for the about page")

Not so nice maybe, but I guess it should work?

KR,
Gunnar
>
> Ton







  

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Hangs in RenderView in "end"

2009-07-08 Thread Gunnar Strand

Gordon Yeong skrev:
> hi there
>
>  I am facing almost the same issue in that even clicking the "stop" 
> button on firefox would see no difference in the debugging terminal or 
> have a response from the webpage.
> When i have safari accesssing the same page, i can submit without a 
> problem and the server doesn't hang.
>
>  Any thoughts?
>
> thanks
>
> gordon
I turned on debugging in the local TT.pm in myApp as you describe below. 
I accessed the page on the application's server with Firefox only. 
Didn't try any other browser.

In my case, the request was aborted and the server returned to normal 
after I clicked "Stop" in Firefox. So it only hung until then. I guess 
you can try to press Ctrl-D in the terminal window to get it to continue 
in case the server is waiting for input, but I never tried that (didn't 
think of it). At least you would know if that is the problem.

I also tried running the server under a debugger (perl -d:ptkdb 
script/myapp_server.pl), but wasn't really getting me anywhere since I 
know too little about Catalyst/TT internals.

KR,
Gunnar
>
> 2009/7/8 Gordon Yeong mailto:anexi...@gmail.com>>
>
>
> hi there
>  
> I think i am facing the same fault.
>  hmmm... When you mention TT.pm, do you mean the local TT.pm found in
> myApp/View/TT.pm or is it the TT.pm belonging to the Template
> Toolkit package?
>
> thanks
>
> Regards,
> Gordon Yeong
>
>
> 2009/7/3 Gunnar Strand  >
>
> I found the problem. Turning on debugging for TT (DEBUG =>
> DEBUG_ALL) in TT.pm showed that it hangs on the [% USE CGI %]
> directive. Apparently
>
> [% USE CGI('-no_debug') %]
>
> is needed. Got it from here:
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=137589
>
> Seems CGI thinks that it is begin run from command line and
> prompts for data.
>
> KR,
> Gunnar
> 
> 
> *From:* Gunnar Strand  >
> *To:* The elegant MVC web framework
> mailto:catalyst@lists.scsys.co.uk>>
> *Sent:* Monday, June 29, 2009 6:39:41 AM
> *Subject:* Re: [Catalyst] Hangs in RenderView in "end"
>
> >> Is there any way of running the server in a debugger or to
> turn tracing on? Can I send a signal to it to get it to >dump
> a stack trace somehow? Any attempt I've made so far just
> results in nothing or segmentation faults.
> >
> >[...]
> >
> >I don't understand why you're seeing segfaults. What version
> of Catalyst are you using, what is your perl -V, and do you
> have the latest version of Variable::Magic installed? Also, if
> you could attach gdb and get the catalyst process to segfault,
> then a backtrace from c land could be useful.
>
> The debugger works now(!). I've always had problems with it
> but hadn't tried it for a while. Maybe a library got updated.
>
> Thanks for the tips!
>
> KR,
> Gunnar
>
> ___
> List: Catalyst@lists.scsys.co.uk
> 
> Listinfo:
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> 
> Listinfo:
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>







  

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] I18N with quotation marks

2009-07-08 Thread Ton Voon


On 2 Jul 2009, at 09:35, Ton Voon wrote:

Does everyone agree this makes sense? If so, any objections if I add  
this to http://dev.catalystframework.org/wiki/best_practices?


I've added a section at http://dev.catalystframework.org/wiki/best_practices 
 now.


This includes Jose Luis Martinez's suggestions for the  
escape_js_string routine, implemented as a TT filter.


Final question: How do you internationalise a bit of text that does  
want some markup within it? For instance, I want something that outputs:


Click here for the about page.

If I do something like:

link = '' _ c.loc("here") _ '';
c.loc("Click %1 for the about page", link)

Then I cannot filter through html for the 2nd loc output.

Is there a nicer way?

Ton___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Hangs in RenderView in "end"

2009-07-08 Thread Gordon Yeong
hi there

 I am facing almost the same issue in that even clicking the "stop" button
on firefox would see no difference in the debugging terminal or have a
response from the webpage.
When i have safari accesssing the same page, i can submit without a problem
and the server doesn't hang.

 Any thoughts?

thanks

gordon

2009/7/8 Gordon Yeong 

>
> hi there
>
> I think i am facing the same fault.
>  hmmm... When you mention TT.pm, do you mean the local TT.pm found in
> myApp/View/TT.pm or is it the TT.pm belonging to the Template Toolkit
> package?
>
> thanks
>
> Regards,
> Gordon Yeong
>
>
> 2009/7/3 Gunnar Strand 
>
> I found the problem. Turning on debugging for TT (DEBUG => DEBUG_ALL) in
>> TT.pm showed that it hangs on the [% USE CGI %] directive. Apparently
>>
>> [% USE CGI('-no_debug') %]
>>
>> is needed. Got it from here:
>>
>> https://bugzilla.mozilla.org/show_bug.cgi?id=137589
>>
>> Seems CGI thinks that it is begin run from command line and prompts for
>> data.
>>
>> KR,
>> Gunnar
>> --
>> *From:* Gunnar Strand 
>> *To:* The elegant MVC web framework 
>> *Sent:* Monday, June 29, 2009 6:39:41 AM
>> *Subject:* Re: [Catalyst] Hangs in RenderView in "end"
>>
>>  >> Is there any way of running the server in a debugger or to turn
>> tracing on? Can I send a signal to it to get it to >dump a stack trace
>> somehow? Any attempt I've made so far just results in nothing or
>> segmentation faults.
>> >
>> >[...]
>> >
>> >I don't understand why you're seeing segfaults. What version of Catalyst
>> are you using, what is your perl -V, and do you have the latest version of
>> Variable::Magic installed? Also, if you could attach gdb and get the
>> catalyst process to segfault, then a backtrace from c land could be useful.
>>
>> The debugger works now(!). I've always had problems with it but hadn't
>> tried it for a while. Maybe a library got updated.
>>
>> Thanks for the tips!
>>
>> KR,
>> Gunnar
>>
>> ___
>> List: Catalyst@lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>>
>> ___
>> List: Catalyst@lists.scsys.co.uk
>> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>> Searchable archive:
>> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>> Dev site: http://dev.catalyst.perl.org/
>>
>>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Hangs in RenderView in "end"

2009-07-08 Thread Gordon Yeong
hi there

I think i am facing the same fault.
 hmmm... When you mention TT.pm, do you mean the local TT.pm found in
myApp/View/TT.pm or is it the TT.pm belonging to the Template Toolkit
package?

thanks

Regards,
Gordon Yeong


2009/7/3 Gunnar Strand 

> I found the problem. Turning on debugging for TT (DEBUG => DEBUG_ALL) in
> TT.pm showed that it hangs on the [% USE CGI %] directive. Apparently
>
> [% USE CGI('-no_debug') %]
>
> is needed. Got it from here:
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=137589
>
> Seems CGI thinks that it is begin run from command line and prompts for
> data.
>
> KR,
> Gunnar
> --
> *From:* Gunnar Strand 
> *To:* The elegant MVC web framework 
> *Sent:* Monday, June 29, 2009 6:39:41 AM
> *Subject:* Re: [Catalyst] Hangs in RenderView in "end"
>
> >> Is there any way of running the server in a debugger or to turn tracing
> on? Can I send a signal to it to get it to >dump a stack trace somehow? Any
> attempt I've made so far just results in nothing or segmentation faults.
> >
> >[...]
> >
> >I don't understand why you're seeing segfaults. What version of Catalyst
> are you using, what is your perl -V, and do you have the latest version of
> Variable::Magic installed? Also, if you could attach gdb and get the
> catalyst process to segfault, then a backtrace from c land could be useful.
>
> The debugger works now(!). I've always had problems with it but hadn't
> tried it for a while. Maybe a library got updated.
>
> Thanks for the tips!
>
> KR,
> Gunnar
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/