MCPcopy Create free account
hub / github.com/nodejs/node / gettext

Function gettext

deps/v8/third_party/jinja2/ext.py:172–179  ·  view source on GitHub ↗
(__context: Context, __string: str, **variables: t.Any)

Source from the content-addressed store, hash-verified

170def _make_new_gettext(func: t.Callable[[str], str]) -> t.Callable[..., str]:
171 @pass_context
172 def gettext(__context: Context, __string: str, **variables: t.Any) -> str:
173 rv = __context.call(func, __string)
174 if __context.eval_ctx.autoescape:
175 rv = Markup(rv)
176 # Always treat as a format string, even if there are no
177 # variables. This makes translation strings more consistent
178 # and predictable. This requires escaping
179 return rv % variables # type: ignore
180
181 return gettext
182

Callers

nothing calls this directly

Calls 2

MarkupClass · 0.90
callMethod · 0.45

Tested by

no test coverage detected