symfony API

sfMessageFormat Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.0 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

sfMessageFormat class.

Method Summary

Method Details

  • (string) format (, , , )

    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.

  • formatExists ()

  • (string) formatString (, , )

    Do string translation.

    returns translated string.

  • (string) getCharset ()

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

    returns charset, default UTF-8

  • getFormattedString ()

  • (MessageSource) getSource ()

    Gets the message source.

  • loadCatalogue ()

    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 ()

  • setCharset ()

    Sets the charset for message output.

  • setUntranslatedPS ()

    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 (, )


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