symfony API

sfMessageFormat Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.3 version. Switch to:

sfMessageFormat class.

Method Summary

  • string format($string, $args, $catalogue, $charset)
    Formats the string. That is, for a particular string find
  • string formatString($string, $args, $catalogue)
    Do string translation.
  • string getCharset()
    Gets the charset for message output. Default is UTF-8.
  • MessageSource getSource()
    Gets the message source.
  • loadCatalogue($catalogue)
    Loads the message from a particular catalogue. A listed
  • replaceArgs()
  • setCharset($charset)
    Sets the charset for message output.
  • setUntranslatedPS($postscript)
    Sets the prefix and suffix to append to untranslated messages.
  • __construct($source, $charset)
    Constructor.

Method Details

  • (string) format ($string, $args, $catalogue, $charset) Browse code

    $string the string to translate.
    $args a list of string to substitute.
    $catalogue get the translation from a particular message
    $charset charset, the input AND output charset catalogue.

    Formats the string. That is, for a particular string find

    the corresponding translation. Variable subsitution is performed
    for the $args parameter. A different catalogue can be specified
    using the $catalogue parameter.
    The output charset is determined by $this->getCharset();

    returns translated string.

  • (string) formatString ($string, $args, $catalogue) Browse code

    $string the string to translate.
    $args a list of string to substitute.
    $catalogue get the translation from a particular message catalogue.

    Do string translation.

    returns translated string.

  • (string) getCharset () Browse code

    Gets the charset for message output. Default is UTF-8.

    returns charset, default UTF-8

  • (MessageSource) getSource () Browse code

    Gets the message source.

  • loadCatalogue ($catalogue) Browse code

    $catalogue message catalogue to load.

    Loads the message from a particular catalogue. A listed

    loaded catalogues is kept to prevent reload of the same
    catalogue. The load catalogue messages are stored
    in the $this->message array.

  • replaceArgs () Browse code

  • setCharset ($charset) Browse code

    $charset charset, default is UTF-8

    Sets the charset for message output.

  • setUntranslatedPS ($postscript) Browse code

    $postscript first element is the prefix, second element the suffix.

    Sets the prefix and suffix to append to untranslated messages.

    e.g. $postscript=array('[T]','[/T]'); will output
    "[T]Hello[/T]" if the translation for "Hello" can not be determined.

  • __construct ($source, $charset) Browse code

    $source the source of translation messages.
    $charset for the message output.

    Constructor.

    Create a new instance of sfMessageFormat using the messages
    from the supplied message source.