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

Function npgettext

deps/v8/third_party/jinja2/ext.py:224–240  ·  view source on GitHub ↗
(
        __context: Context,
        __string_ctx: str,
        __singular: str,
        __plural: str,
        __num: int,
        **variables: t.Any,
    )

Source from the content-addressed store, hash-verified

222) -> t.Callable[..., str]:
223 @pass_context
224 def npgettext(
225 __context: Context,
226 __string_ctx: str,
227 __singular: str,
228 __plural: str,
229 __num: int,
230 **variables: t.Any,
231 ) -> str:
232 variables.setdefault("context", __string_ctx)
233 variables.setdefault("num", __num)
234 rv = __context.call(func, __string_ctx, __singular, __plural, __num)
235
236 if __context.eval_ctx.autoescape:
237 rv = Markup(rv)
238
239 # Always treat as a format string, see gettext comment above.
240 return rv % variables # type: ignore
241
242 return npgettext
243

Callers

nothing calls this directly

Calls 3

MarkupClass · 0.90
setdefaultMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected