| 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 (`'`). |