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

Function ngettext

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

Source from the content-addressed store, hash-verified

184def _make_new_ngettext(func: t.Callable[[str, str, int], str]) -> t.Callable[..., str]:
185 @pass_context
186 def ngettext(
187 __context: Context,
188 __singular: str,
189 __plural: str,
190 __num: int,
191 **variables: t.Any,
192 ) -> str:
193 variables.setdefault("num", __num)
194 rv = __context.call(func, __singular, __plural, __num)
195 if __context.eval_ctx.autoescape:
196 rv = Markup(rv)
197 # Always treat as a format string, see gettext comment above.
198 return rv % variables # type: ignore
199
200 return ngettext
201

Callers

nothing calls this directly

Calls 3

MarkupClass · 0.90
setdefaultMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected