diff --git a/h5pxblock/h5pxblock.py b/h5pxblock/h5pxblock.py index 285e4020..0cfe3b39 100644 --- a/h5pxblock/h5pxblock.py +++ b/h5pxblock/h5pxblock.py @@ -118,6 +118,17 @@ def resource_string(self, path): return data.decode("utf8") def render_template(self, template_path, context): + """ + Render a template with the given context. The template is translated + according to the user's language. + + Args: + template_path (str): The path to the template + context(dict, optional): The context to render in the template + + Returns: + str: The rendered template + """ return loader.render_django_template( template_path, context,