Function | Parameters | Return Value | Description |
---|
cache_clear() |
|
| Clears the text constant cache |
get_formatted_text_constant(_id, language=None, **kwargs) | _id: CONST
language: Sprachcode kwargs: Arguments to replace the placeholders in the text constant | The text constant with the optional arguments formatted into the text | Fetches the text constant and replace placeholders. When no argument was given for a placeholder it is simply ignored. Text constants are only fetched once and then cached. |
get_text_constant(_id, language=None, default=None) | _id: CONST
language: Sprachcode default: A string to return when no text constant with the given id exists | The text constant | Fetches a text constant. When default is None and no constant exists with that id, a ValueError is raised. Text constants are only fetched once and then cached. |
safe_format(text, **formatting_parameters) | text: A string with format parameters like 'Hello {user}' formatting_parameters: Arguments to replace the placeholders in the text | The text with placeholders replaced | Safely formats a string without raising an error when not all placeholders were replaced |