code: def get_language_pack(locale: str) -> Optional[dict[str, Any]]:
      """Get/cache a language pack
  
      Returns the language pack from cache if it exists, caches otherwise
  
      >>> get_language_pack('fr')['Dashboards']
      "Tableaux de bords"
      """
      pack = ALL_LANGUAGE_PACKS.get(locale)
      if not pack:
          filename = DIR + f"/{locale}/LC_MESSAGES/messages.json"
          try:
              with open(filename, encoding="utf8") as f:
                  pack = json.load(f)
                  ALL_LANGUAGE_PACKS[locale] = pack or {}
          except Exception:  # pylint: disable=broad-except
              # Assuming english, client side falls back on english
              pass
      return pack
  
imports: import json
  import os
  from typing import Any, Optional
label_desc: Use image node_id 1 for calling a global function with example usage: get_language_pack(locale) and returns: pack