Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::i18n(3pm) [debian man page]

Jifty::I18N(3pm)					User Contributed Perl Documentation					  Jifty::I18N(3pm)

NAME
Jifty::I18N - Internationalization framework for Jifty SYNOPSIS
# Whenever you need an internationalized string: print _('Hello, %1!', 'World'); In your Mason templates: <% _('Hello, %1!', 'World') %> METHODS
"_" This module provides a method named "_", which allows you to quickly and easily include localized strings in your application. The first argument is the string to be translated. If that string contains placeholders, the remaining arguments are used to replace the placeholders. The placeholders in the form of "%1" where the number is the number of the argument used to replace it: _('Welcome %1 to the %2', 'Bob', 'World'); This example would return the string "Welcome Bob to the World" if no translation is being performed. new Set up Jifty's internationalization for your application. This pulls in Jifty's PO files, your PO files and then exports the _ function into the wider world. install_global_loc available_languages Return an array of available languages _get_file_patterns Get list of patterns for all PO files in the project. (Paths are gotten from the configuration variables and plugins). get_language_handle Get the language handle for this request. get_current_language Get the current language for this request, formatted as a Locale::Maketext subclass string (i.e., "zh_tw" instead of "zh-TW"). refresh Used by Jifty::Handler in DevelMode to reload .po files whenever they are modified on disk. promote_encoding STRING [CONTENT-TYPE] Return STRING promoted to our best-guess of an appropriate encoding. STRING should not have the UTF-8 flag set when passed in. Optionally, you can pass a MIME content-type string as a second argument. If it contains a charset= parameter, we will use that encoding. Failing that, we use Encode::Guess to guess between UTF-8 and iso-latin-1. If that fails, and the string validates as UTF-8, we assume that. Finally, we fall back on returning the string as is. maybe_decode_utf8 STRING Attempt to decode STRING as UTF-8. If STRING is not valid UTF-8, or already contains wide characters, return it undecoded. N.B: In an ideal world, we wouldn't need this function, since we would know whether any given piece of input is UTF-8. However, the world is not ideal. perl v5.14.2 2010-09-25 Jifty::I18N(3pm)

Check Out this Related Man Page

Jifty::View::Mason::Handler(3pm)			User Contributed Perl Documentation			  Jifty::View::Mason::Handler(3pm)

NAME
Jifty::View::Mason::Handler - Handler for Mason requests inside of Jifty SUMMARY
Jifty controls all of the input and output from the Mason templating engine; this means that we cannot use the Mason's standard HTML::Mason::CGIHandler interface to interact with it. new PARAMHASH Takes a number of key-value parameters; see HTML::Mason::Params. Defaults the "out_method" to appending to "buffer" in Jifty::Handler and the "request_class" to Jifty::View::Mason::Request (below). Finally, adds "h" and "u" escapes, which map to "escape_uri" and escape_utf8 respectively. config Returns our Mason config. We use the component root specified in the "Web/TemplateRoot" framework configuration variable (or "html" by default). Additionally, we set up a "jifty" component root, as specified by the "Web/DefaultTemplateRoot" configuration. All interpolations are HTML-escaped by default, and we use the fatal error mode. escape_utf8 SCALARREF Does a css-busting but minimalist escaping of whatever html you're passing in. escape_uri SCALARREF Escapes in-place URI component according to RFC2396. Takes a reference to perl string. *Note* that octets would be treated as latin1 encoded sequence and converted to UTF-8 encoding and then escaped. So this sub always provide UTF-8 escaped string. See also Encode for more info about converting. template_exists COMPONENT Checks if the "COMPONENT" exists, or if "COMPONENT/index.html" exists, and returns which one did. If neither did, it searches for "dhandler" components which could match, returning "COMPONENT" if it finds one. Finally, if it finds no possible component matches, returns undef. Note that this algorithm does not actually decisively return if Mason will handle a given component; the dhandlers could defer handling, for instance. show COMPONENT Takes a component path to render. Deals with setting up a global HTML::Mason::FakeApache and Request object, and calling the component. handle_comp A synonym for show request_args The official source for request arguments is from the current Jifty::Request object. create_cache_directories Attempts to create our application's mason cache directory. perl v5.14.2 2010-12-08 Jifty::View::Mason::Handler(3pm)
Man Page