Changes between Version 116 and Version 117 of ConfigurationGuidelines


Ignore:
Timestamp:
03/18/16 11:31:29 (6 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ConfigurationGuidelines

    v116 v117  
    154154=== Registration Message Options ===
    155155
    156 The welcome message and other messages relating to registration and logging in are in {{{current.auth.messages}}}
    157 which can be set in a {{{customise_auth_user_resource()}}} function in your template's config.py file.
    158 To see the messages that can be changed, look for the {{{messages.*}}} lines in the {{{AuthS3.__init__}}}
    159 function in {{{modules/s3/s3aaa.py}}}.
    160 These also show examples of using format elements like {{{%(system_name)s}}} to insert the system name,
    161 url, user name, and link to the user's profile.  Use the same format elements in your messages to have
    162 those inserted.
     156The welcome message and other messages relating to registration and logging in are in {{{current.auth.messages}}} which can be configured in a {{{customise_auth_user_resource()}}} function in your template's {{{config.py}}} file.
     157
     158To see the messages that can be changed, look for the {{{messages.*}}} lines in the {{{AuthS3.__init__}}} function in {{{modules/s3/s3aaa.py}}}.
     159These also show examples of using format elements like {{{%(system_name)s}}} to insert the system name, url, user name, and link to the user's profile.  Use the same format elements in your messages to have those inserted.
    163160
    164161Example:
     
    166163{{{
    167164def customise_auth_user_resource(r, resource):
    168     current.auth.messages.welcome_email_subject = "Welcome to %(system_name)s!"
    169     current.auth.messages.welcome_email = \
     165    messages = current.auth.messages
     166    messages.welcome_email_subject = "Welcome to %(system_name)s!"
     167    messages.welcome_email = \
    170168"""Welcome to %(system_name)s, %(first_name) %(last_name)!
    171169* You can start using %(system_name)s at: %(url)s
    172170* To edit your profile go to: %(url)s%(profile)s
    173171Thank you for registering!"""
    174 }}}
    175 
    176 These messages will be inserted in the translation files automatically, and do not need {{{T( )}}} around them.
    177 For a site with multiple languages, it is suggested to include the original message in English to serve as the
    178 key in the translation files, and to include the format elements (for system name, etc.) in the message, so that
    179 the translator can rearrange them as needed.
     172
     173settings.customise_auth_user_resource = customise_auth_user_resource
     174}}}
     175
     176These messages do not need {{{T( )}}} around them. If a translation is required they need adding to the languages/xx.py file.
     177
     178As-usual, for a site with multiple languages, it is suggested to include the original message in English to serve as the key in the translation files, and to include the format elements (for system name, etc.) in the message, so that the translator can rearrange them as needed.
    180179== Mapping Options ==
    181180http://localhost:8000/sahana/gis/config/update/1