Edgewall Software

Changes between Version 11 and Version 12 of TracDev/CodingStyle


Ignore:
Timestamp:
May 23, 2010, 5:13:31 PM (14 years ago)
Author:
Christian Boos
Comment:

added conventions for #Strings

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/CodingStyle

    v11 v12  
    1414   e.g. `_do_whatever_it_takes_to_delete`
    1515
     16== Strings ==
     17
     18 - Use `"..."` for text meant to be read by users,
     19   use `'...'` for string constants (e.g. keys in dicts, CSS class names, filenames).
     20   The former strings will usually be translated, so be sure to play nice with the i18n conventions ([[TracL10N#ForDevelopers]]).
     21   In fact, the only "..." strings that won't get translated are the messages for the log.
     22   However this is not a very strict convention, rather a help to see what should be translated or not. It is OK to use `'...'` when the message contains `"` characters, for example, as such messages are often long and can't usually be mistaken for string constants anyway.
     23 - For regular expressions, use `r'...'` strings,
     24   or multiline `r'''...'''` in `re.VERBOSE` mode.
     25 - For SQL code, use multiline `"""..."""` strings if needed. Single line SQL also use `"..."` style most of the time, as they often contain single quotes (`'`).
    1626
    1727== Miscellaneous ==