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

Function pgettext

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

Source from the content-addressed store, hash-verified

203def _make_new_pgettext(func: t.Callable[[str, str], str]) -> t.Callable[..., str]:
204 @pass_context
205 def pgettext(
206 __context: Context, __string_ctx: str, __string: str, **variables: t.Any
207 ) -> str:
208 variables.setdefault("context", __string_ctx)
209 rv = __context.call(func, __string_ctx, __string)
210
211 if __context.eval_ctx.autoescape:
212 rv = Markup(rv)
213
214 # Always treat as a format string, see gettext comment above.
215 return rv % variables # type: ignore
216
217 return pgettext
218

Callers

nothing calls this directly

Calls 3

MarkupClass · 0.90
setdefaultMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected