NAME
Template::Plugin::DumbQuotes - Transform educated quotes to dumb quotes
DESCRIPTION
Installs a filter to change Smart Quotes (curly etc...) and similar characters to plain/dumb equivalent (ASCII safe)
SYNOPSIS
[% USE DumbQuotes %]
[% FILTER dumb_quotes %]
“This is an example of smart-quotes”
[% END %]
[%# will be changed to :
"This is an example of smart-quotes"
%]
[%# Specify another filter name for your convenience %]
[% USE DumbQuotes dq %]
[% | dq %][% | loc %]What’s up[% END %][% END %]
FILTERS
- double quotes ” and “
-
are changed to "
- guillemets «»
-
are changed to "
- single quotes ‘’
-
are changed to
`
and'
- dashes –—
-
are changed to hyphen-minus
-
- ellipsis …
-
is changed to three dots :
...
INTERNALS
init
init respects TT interface to initialise the filter
filter
uses a regexp internally to change the text in input.
MOTIVATION
The original reason why this plugin has been created is to decrease the number of different but yet similar strings in translation files (Using Locale::Maketext). Indeed in templates, depending on the context, you want to use smort-quotes for rich-capable user-agent, and in some other cases (exemple text-email templates) you just want dumb-quotes.
This plugins allows you to use the rich version in templates by filtering them out, and still, you will only have an unique lexicon entry in your .po (or whatever).
Example:
[% |dumb_quotes %] [% |loc %]let’s roll[% END %] [% END %]
UTF-8
It should work flawlessly whether your template is unicode encoded or not.
LICENSE
Template::Plugin::DumbQuotes is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR & COPYRIGHT
Except where otherwise noted, Template::Plugin::DumbQuotes is Copyright 2005-2007 Six Apart, cpan (at) sixapart (dot) com. All rights reserved.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 28:
Non-ASCII character seen before =encoding in '“This'. Assuming UTF-8