Google Translate API
Apps
Configuration of Google Translate API app
- class integreat_cms.google_translate_api.apps.GoogleTranslateApiClientConfig(app_name, app_module)[source]
Bases:
AppConfig
Google Translate API config inheriting the django AppConfig
- ready_v2(credentials: Credentials) None [source]
Preparing Google Translate with basic version
- Parameters:
credentials (Credentials)
- Return type:
None
- ready_v3(credentials: Credentials) None [source]
Preparing Google Translate with advanced version
- Parameters:
credentials (Credentials)
- Return type:
None
- verbose_name: Final[Promise] = 'Google Translate API'[source]
Human-readable name for the application
Google Translate API Client
- class integreat_cms.google_translate_api.google_translate_api_client.GoogleTranslateApiClient(request: HttpRequest, form_class: ModelFormMetaclass)[source]
Bases:
MachineTranslationApiClient
Google Translate API client to automatically translate selected objects.
- Parameters:
request (HttpRequest)
form_class (ModelFormMetaclass)
- __init__(request: HttpRequest, form_class: ModelFormMetaclass) None [source]
Initialize the Google Translate client
- Parameters:
region – The current region
form_class (ModelFormMetaclass) – The
CustomContentModelForm
subclass of the current content typerequest (HttpRequest)
- Return type:
None
- static get_target_language_key(target_language: Language) str [source]
This function decides the correct target language key
Google Translate Provider
- class integreat_cms.google_translate_api.google_translate_provider.GoogleTranslateProvider[source]
Bases:
MachineTranslationProvider
The provider for Google machine translations
- api_client[source]
The API client class for this provider
alias of
GoogleTranslateApiClient