Changes between Version 115 and Version 116 of ConfigurationGuidelines


Ignore:
Timestamp:
03/18/16 11:15:11 (6 years ago)
Author:
Pat Tressel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ConfigurationGuidelines

    v115 v116  
    154154=== Registration Message Options ===
    155155
    156 The welcome message and other messages relating to registration and logging in are in {{{settings.auth.messages}}}
    157 which can be set in a {{{customise_auth_user_resource()}}} function in your template's config.py file.  To see the
    158 messages that can be changed, look for the {{{messages.*}}} lines in the {{{AuthS3.__init__}}} in {{{modules/s3/s3aaa.py}}}.
    159 These also show examples of using format elements like {{{%(system_name)s}}} to insert the system name, url, user name,
    160 and link to the user's profile.  Use the same format elements in your messages to have those inserted.
     156The welcome message and other messages relating to registration and logging in are in {{{current.auth.messages}}}
     157which can be set in a {{{customise_auth_user_resource()}}} function in your template's config.py file.
     158To see the messages that can be changed, look for the {{{messages.*}}} lines in the {{{AuthS3.__init__}}}
     159function in {{{modules/s3/s3aaa.py}}}.
     160These also show examples of using format elements like {{{%(system_name)s}}} to insert the system name,
     161url, user name, and link to the user's profile.  Use the same format elements in your messages to have
     162those inserted.
     163
     164Example:
     165
     166{{{
     167def customise_auth_user_resource(r, resource):
     168    current.auth.messages.welcome_email_subject = "Welcome to %(system_name)s!"
     169    current.auth.messages.welcome_email = \
     170"""Welcome to %(system_name)s, %(first_name) %(last_name)!
     171* You can start using %(system_name)s at: %(url)s
     172* To edit your profile go to: %(url)s%(profile)s
     173Thank you for registering!"""
     174}}}
    161175
    162176These messages will be inserted in the translation files automatically, and do not need {{{T( )}}} around them.
    163 For a site with multiple languages, it is suggested to include the original message in English to server as the
     177For a site with multiple languages, it is suggested to include the original message in English to serve as the
    164178key in the translation files, and to include the format elements (for system name, etc.) in the message, so that
    165179the translator can rearrange them as needed.