class_docstr: This extension adds gettext support to Jinja.
class_docstr_tok: ["This","extension","adds","gettext","support","to","Jinja","."]
docstr: Generates a useful node from the data provided.
docstr_tok: ["Generates","a","useful","node","from","the","data","provided","."]
code: def _make_node(
      self,
      singular: str,
      plural: t.Optional[str],
      context: t.Optional[str],
      variables: t.Dict[str, nodes.Expr],
      plural_expr: t.Optional[nodes.Expr],
      vars_referenced: bool,
      num_called_num: bool,
  ) -> nodes.Output:
      """Generates a useful node from the data provided."""
      newstyle = self.environment.newstyle_gettext  # type: ignore
      node: nodes.Expr
  
      # no variables referenced?  no need to escape for old style
      # gettext invocations only if there are vars.
      if not vars_referenced and not newstyle:
          singular = singular.replace("%%", "%")
          if plural:
              plural = plural.replace("%%", "%")
  
      func_name = "gettext"
      func_args: t.List[nodes.Expr] = [nodes.Const(singular)]
  
      if context is not None:
          func_args.insert(0, nodes.Const(context))
          func_name = f"p{func_name}"
  
      if plural_expr is not None:
          func_name = f"n{func_name}"
          func_args.extend((nodes.Const(plural), plural_expr))
  
      node = nodes.Call(
          nodes.Name(func_name, "load"), func_args, [], None, None
      )
  
      # in case newstyle gettext is used, the method is powerful
      # enough to handle the variable expansion and autoescape
      # handling itself
      if newstyle:
          for key, value in variables.items():
              # the function adds that later anyways in case num was
              # called num, so just skip it.
              if num_called_num and key == "num":
                  continue
              node.kwargs.append(nodes.Keyword(key, value))
  
      # otherwise do that here
      else:
          # mark the return value as safe if we are in an
          # environment with autoescaping turned on
          node = nodes.MarkSafeIfAutoescape(node)
          if variables:
              node = nodes.Mod(
                  node,
                  nodes.Dict(
                      [
                          nodes.Pair(nodes.Const(key), value)
                          for key, value in variables.items()
                      ]
                  ),
              )
      return nodes.Output([node])
  
imports: import pprint
  import re
  import typing
  from markupsafe import Markup
  from .None import defaults
  from .None import nodes
  from .environment import Environment
  from .exceptions import TemplateAssertionError
  from .exceptions import TemplateSyntaxError
  from .runtime import concat
  from .runtime import Context
  from .runtime import Undefined
  from .utils import import_string
  from .utils import pass_context
label_desc: Use image node_id 10 for calling the InternationalizationExtension obj's underlying member method code with example usage: obj._make_node(singular, plural, context, variables, plural_expr, vars_referenced, num_called_num) and returns: nodes