class_docstr: Calculate the number of translated and untranslated nodes.
class_docstr_tok: ["Calculate","the","number","of","translated","and","untranslated","nodes","."]
code: def apply(self, **kwargs: Any) -> None:
      from sphinx.builders.gettext import MessageCatalogBuilder
  
      if isinstance(self.app.builder, MessageCatalogBuilder):
          return
  
      total = translated = 0
      for node in self.document.findall(
          NodeMatcher(translated=Any)
      ):  # type: nodes.Element
          total += 1
          if node["translated"]:
              translated += 1
  
      self.document["translation_progress"] = {
          "total": total,
          "translated": translated,
      }
  
imports: from __future__ import annotations
  import contextlib
  from os import path
  from re import DOTALL, match
  from textwrap import indent
  from typing import TYPE_CHECKING, Any, TypeVar
  from docutils import nodes
  from docutils.io import StringInput
  from sphinx import addnodes
  from sphinx.domains.std import make_glossary_term, split_term_classifiers
  from sphinx.errors import ConfigError
  from sphinx.locale import __
  from sphinx.locale import init
  from sphinx.transforms import SphinxTransform
  from sphinx.util import get_filetype, logging
  from sphinx.util.i18n import docname_to_domain
  from sphinx.util.index_entries import split_index_msg
  from sphinx.util.nodes import IMAGE_TYPE_NODES, LITERAL_TYPE_NODES, NodeMatcher, extract_messages, traverse_translatable_index
label_desc: Use image node_id 1 for calling the TranslationProgressTotaliser obj's underlying member method code with example usage: obj.apply() without return types