Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Update for critical security issue in PHPMailer included in release Vanilla 2.3.1
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Where to translate the Guest Welcome message? guest.php

pixelinepixeline New
edited September 2010 in Vanilla 2.0 - 2.2
I would like to translate into French the default Welcome message once sees when not logged in.

I found the View in applications/dashboard/modules/guest.php

But it calls for

echo T($this->MessageCode, $this->MessageDefault);
Where then can i set this MessageCode?




  • TimTim Operations Vanilla Staff
    I did a source code search. It revealed that $this->MessageCode is set in class.guestmodule.php like so:
    public $MessageCode = 'GuestModule.Message';

    Additionally, looking up the T() function, I found this:
    /** * Translates a code into the selected locale's definition. * * @param string $Code The code related to the language-specific definition. * Codes thst begin with an '@' symbol are treated as literals and not translated. * @param string $Default The default value to be displayed if the translation code is not found. * @return string The translated string or $Code if there is no value in $Default. * @see Gdn::Translate() */ function T($Code, $Default = '') { return Gdn::Translate($Code, $Default); }

    Thus, 'GuestModule.Message' is the translation code and can be modified in the locale file for your forum, found here:

    To redefine that code in particular, something like this would work:
    $Definition['GuestModule.Message'] = "Looks like you're new round these parts. Tie up your horse and sit yerself down fer a drink.";

    Good luck.

    Vanilla Forums Senior Developer [GitHub, Twitter,]

  • Great, it works a treat! Thanks a lot also for the thorought explanation!
Sign In or Register to comment.