class_docstr: Builds gettext-style message catalogs (.pot files).
class_docstr_tok: ["Builds","gettext-style","message","catalogs","(",".pot","files",")","."]
code: def finish(self) -> None:
      super().finish()
      context = {
          "version": self.config.version,
          "copyright": self.config.copyright,
          "project": self.config.project,
          "last_translator": self.config.gettext_last_translator,
          "language_team": self.config.gettext_language_team,
          "ctime": ctime,
          "display_location": self.config.gettext_location,
          "display_uuid": self.config.gettext_uuid,
      }
      for textdomain, catalog in status_iterator(
          self.catalogs.items(),
          __("writing message catalogs... "),
          "darkgreen",
          len(self.catalogs),
          self.app.verbosity,
          lambda textdomain__: textdomain__[0],
      ):
          # noop if config.gettext_compact is set
          ensuredir(path.join(self.outdir, path.dirname(textdomain)))
  
          context["messages"] = list(catalog)
          content = GettextRenderer(outdir=self.outdir).render(
              "message.pot_t", context
          )
  
          pofn = path.join(self.outdir, textdomain + ".pot")
          if should_write(pofn, content):
              with open(pofn, "w", encoding="utf-8") as pofile:
                  pofile.write(content)
  
imports: from __future__ import annotations
  import time
  from codecs import open
  from collections import defaultdict
  from os import getenv, path, walk
  from typing import TYPE_CHECKING, Any
  from uuid import uuid4
  from docutils import nodes
  from sphinx import addnodes, package_dir
  from sphinx.builders import Builder
  from sphinx.errors import ThemeError
  from sphinx.locale import __
  from sphinx.util import logging
  from sphinx.util.console import bold
  from sphinx.util.display import status_iterator
  from sphinx.util.i18n import CatalogInfo, docname_to_domain
  from sphinx.util.index_entries import split_index_msg
  from sphinx.util.nodes import extract_messages, traverse_translatable_index
  from sphinx.util.osutil import canon_path, ensuredir, relpath
  from sphinx.util.tags import Tags
  from sphinx.util.template import SphinxRenderer
label_desc: Use image node_id 5 for calling the MessageCatalogBuilder obj's underlying member method code with example usage: obj.finish() without return types