pgettext
Translates a message within a specific context by prepending the context and a separator before calling the standard translation function, returning the original message if no translation is found.
def pgettext(
context: string,
message: string
) - > string
Translates a message within a specific context to resolve ambiguities between identical strings used in different parts of an application.
Parameters
| Name | Type | Description |
|---|---|---|
| context | string | The context string used to disambiguate the message, such as 'verb' vs 'noun'. |
| message | string | The actual text string to be translated. |
Returns
| Type | Description |
|---|---|
string | The translated string if a translation exists for the given context; otherwise, the original message string. |