Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion transifex/native/django/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from transifex.native import tx


def translate(_string, _context=None, _escape=True, **params):
def translate(_string, _context=None, _escape=True, _key=None, **params):
"""Translate the given source string to the current language.

A convenience wrapper that uses the current language of a Django app.
Expand All @@ -16,6 +16,9 @@ def translate(_string, _context=None, _escape=True, **params):
about the source string
:param bool _escape: if True, the returned string will be HTML-escaped,
otherwise it won't
:param str _key: an optional key that identifies this string;
if omitted, the key is generated automatically based on the
strings itself and its context
:return: the final translation in the current language
:rtype: unicode
"""
Expand All @@ -32,6 +35,7 @@ def translate(_string, _context=None, _escape=True, **params):
_context=_context,
is_source=is_source,
escape=_escape,
_key=_key,
params=params,
)

Expand Down