Skip to content

Latest commit

 

History

History
192 lines (112 loc) · 7.76 KB

File metadata and controls

192 lines (112 loc) · 7.76 KB

phrase.MachineTranslationApi

All URIs are relative to https://api.phrase.com/v2

Method HTTP request Description
MachineTranslationLocaleProviderMappingsCreate Post /accounts/{account_id}/machine_translation_locale_provider_mappings Create a locale provider mapping
MachineTranslationLocaleProviderMappingsDestroy Delete /accounts/{account_id}/machine_translation_locale_provider_mappings Delete a locale provider mapping
MachineTranslationSettingsShow Get /accounts/{account_id}/machine_translation_settings Get machine translation settings
MachineTranslationSettingsUpdate Patch /accounts/{account_id}/machine_translation_settings Update machine translation settings

MachineTranslationLocaleProviderMappingsCreate

MachineTranslationLocaleProviderMapping MachineTranslationLocaleProviderMappingsCreate(ctx, accountId, machineTranslationLocaleProviderMappingsCreateParameters, optional)

Create a locale provider mapping

Creates a locale-pair-specific machine translation provider override for the account. When a mapping exists for a given source/target locale pair, that provider is used instead of the account default. Only one mapping may exist per source/target locale pair; attempting to create a duplicate returns a validation error. The source and target locale codes must differ.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
accountId string Account ID
machineTranslationLocaleProviderMappingsCreateParameters MachineTranslationLocaleProviderMappingsCreateParameters
optional *MachineTranslationLocaleProviderMappingsCreateOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a MachineTranslationLocaleProviderMappingsCreateOpts struct

Name Type Description Notes
xPhraseAppOTP optional.String Two-Factor-Authentication token (optional)

Return type

MachineTranslationLocaleProviderMapping

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

MachineTranslationLocaleProviderMappingsDestroy

MachineTranslationLocaleProviderMappingsDestroy(ctx, accountId, sourceLocaleCode, targetLocaleCode, optional)

Delete a locale provider mapping

Removes the machine translation provider override for the specified source and target locale pair. The mapping is identified by locale codes supplied as query parameters rather than a path ID.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
accountId string Account ID
sourceLocaleCode string The locale code of the source language of the mapping to delete.
targetLocaleCode string The locale code of the target language of the mapping to delete.
optional *MachineTranslationLocaleProviderMappingsDestroyOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a MachineTranslationLocaleProviderMappingsDestroyOpts struct

Name Type Description Notes
xPhraseAppOTP optional.String Two-Factor-Authentication token (optional)

Return type

(empty response body)

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

MachineTranslationSettingsShow

MachineTranslationSettings MachineTranslationSettingsShow(ctx, accountId, optional)

Get machine translation settings

Returns the machine translation configuration for the account, including the default translation service, current machine translation unit usage, and any locale-pair-specific provider mappings.

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
accountId string Account ID
optional *MachineTranslationSettingsShowOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a MachineTranslationSettingsShowOpts struct

Name Type Description Notes
xPhraseAppOTP optional.String Two-Factor-Authentication token (optional)

Return type

MachineTranslationSettings

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

MachineTranslationSettingsUpdate

MachineTranslationSettings MachineTranslationSettingsUpdate(ctx, accountId, machineTranslationSettingsUpdateParameters, optional)

Update machine translation settings

Sets the default machine translation service for the account. Requires write access to the account's machine translation settings. Passing an empty or absent value for default_service resets the account to its plan default (Microsoft Translate).

Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
accountId string Account ID
machineTranslationSettingsUpdateParameters MachineTranslationSettingsUpdateParameters
optional *MachineTranslationSettingsUpdateOpts optional parameters nil if no parameters

Optional Parameters

Optional parameters are passed through a pointer to a MachineTranslationSettingsUpdateOpts struct

Name Type Description Notes
xPhraseAppOTP optional.String Two-Factor-Authentication token (optional)

Return type

MachineTranslationSettings

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]