Utils
hypha.apply.translate.utils
¶
get_available_translations
¶
Get languages available for translation
Parameters:
-
from_codes
(Optional[List[str]]
, default:None
) βoptionally specify a list of languages to view available translations to
Returns:
-
List[Package]
βA list of argostranslate package objects that are installed and available.
Source code in hypha/apply/translate/utils.py
get_translation_params
¶
Attempts to extract the fl
(from language) & tl
(to language) params from the provided URL or request object
Return values are not validated to ensure languages are valid & packages exist.
Parameters:
-
url
(str
, default:None
) βthe URL to extract the params from
Returns:
-
tuple
(Tuple[str, str] | None
) βin the format of (\<from langauge>, \<to language>)
Raises:
-
ValueError
βIf
url
/request
are not provided OR if both are provided