MCPcopy
hub / github.com/PaddlePaddle/ERNIE / get

Function get

erniekit/webui/lang.py:894–906  ·  view source on GitHub ↗

Retrieves the Chinese translation based on the given key. Args: key (str): The key used to look up the translation. Returns: str: The Chinese translation corresponding to the key.

(key, lang=None, prop=None)

Source from the content-addressed store, hash-verified

892
893
894def get(key, lang=None, prop=None):
895 """
896 Retrieves the Chinese translation based on the given key.
897
898 Args:
899 key (str): The key used to look up the translation.
900
901 Returns:
902 str: The Chinese translation corresponding to the key.
903 """
904 if prop and lang:
905 return LOCALES[key][lang][prop]
906 return LOCALES[key]["zh"]["label"]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected