Documentation ¶
Index ¶
- Variables
- type ARBFileFormatSettings
- type AddLanguageRequest
- type AdocFileFormatSettings
- type AdocFileImportOptions
- type Alignment
- type AndroidFileFormatSettings
- type Approval
- type ApprovalsGetResponse
- type ApprovalsListOptions
- type ApprovalsListResponse
- type Branch
- type BranchMerge
- type BranchMergeSummary
- type BranchesAddRequest
- type BranchesCloneRequest
- type BranchesGetResponse
- type BranchesListOptions
- type BranchesListResponse
- type BranchesMergeRequest
- type BranchesMergeResponse
- type BranchesMergeSummaryResponse
- type BuildProjectDirectoryTranslation
- type BuildProjectDirectoryTranslationRequest
- type BuildProjectFileTranslationRequest
- type BuildProjectRequest
- type BuildProjectTranslationRequest
- type CSVFileFormatSettings
- type ChromeFileFormatSettings
- type CommonFileFormatSettings
- type CommonFileImportOptions
- type DOCXFileImportOptions
- type Directory
- type DirectoryAddRequest
- type DirectoryGetResponse
- type DirectoryListOptions
- type DirectoryListResponse
- type DitaFileFormatSettings
- type DocxFileFormatSettings
- type DownloadLink
- type DownloadLinkResponse
- type Error
- type ErrorResponse
- type ExportTranslationRequest
- type FJSFileFormatSettings
- type FMHTMLFileFormatSettings
- type FMMDFileFormatSettings
- type File
- type FileAddRequest
- type FileExportOptions
- type FileFormatSettings
- type FileGetResponse
- type FileImportOptions
- type FileListOptions
- type FileListResponse
- type FileRevision
- type FileRevisionListResponse
- type FileRevisionResponse
- type FileUpdateRestoreRequest
- type GeneralFileExportOptions
- type Group
- type GroupsAddRequest
- type GroupsGetResponse
- type GroupsListOptions
- type GroupsListResponse
- type HTMLFileFormatSettings
- type HTMLFileImportOptions
- type HTMLWithFrontMatterFileImportOptions
- type IDMLFileFormatSettings
- type JSONFileFormatSettings
- type JavaScriptFileExportOptions
- type JavaScriptFileFormatSettings
- type Language
- type LanguageTranslation
- type LanguageTranslationPlural
- type LanguageTranslationsListOptions
- type LanguageTranslationsListResponse
- type LanguagesGetResponse
- type LanguagesListResponse
- type ListOptions
- type MDFileFormatSettings
- type MDXV1FileFormatSettings
- type MDXV1FileImportOptions
- type MDXV2FileFormatSettings
- type MDXV2FileImportOptions
- type MIFFileFormatSettings
- type MacOSFileFormatSettings
- type MadCapFLSNPFileFormatSettings
- type MediaWikiFileFormatSettings
- type OtherFileFormatSettings
- type OtherFileImportOptions
- type Pagination
- type PaginationResponse
- type PatchOp
- type PreTranslation
- type PreTranslationAttributes
- type PreTranslationRequest
- type PreTranslationsResponse
- type Project
- type ProjectMTPreTranslate
- type ProjectMTs
- type ProjectProgressListOptions
- type ProjectTMPenalties
- type ProjectTMPreTranslate
- type ProjectsAddFileFormatSettingsRequest
- type ProjectsAddRequest
- type ProjectsFileFormatSettings
- type ProjectsFileFormatSettingsListResponse
- type ProjectsFileFormatSettingsResponse
- type ProjectsGetResponse
- type ProjectsListOptions
- type ProjectsListResponse
- type ProjectsStringsExporterSettings
- type ProjectsStringsExporterSettingsListResponse
- type ProjectsStringsExporterSettingsRequest
- type ProjectsStringsExporterSettingsResponse
- type PropertyFileExportOptions
- type PropertyFileFormatSettings
- type PseudoBuildProjectRequest
- type QACheck
- type QACheckListOptions
- type QAChecksResponse
- type ReactIntlFileFormatSettings
- type ReviewedBuild
- type ReviewedBuildListOptions
- type ReviewedBuildListResponse
- type ReviewedBuildRequest
- type ReviewedBuildResponse
- type RevisionInfo
- type SourceString
- type SourceStringsAddRequest
- type SourceStringsGetOptions
- type SourceStringsGetResponse
- type SourceStringsImportOptions
- type SourceStringsListOptions
- type SourceStringsListResponse
- type SourceStringsUpload
- type SourceStringsUploadRequest
- type SourceStringsUploadResponse
- type SpreadsheetFileImportOptions
- type Storage
- type StorageGetResponse
- type StorageListResponse
- type StringCanalogFileFormatSettings
- type StringCatalogFileImportOptions
- type StringTranslationsListOptions
- type TXTFileFormatSettings
- type Translation
- type TranslationAddRequest
- type TranslationAlignment
- type TranslationAlignmentRequest
- type TranslationAlignmentResponse
- type TranslationGetOptions
- type TranslationGetResponse
- type TranslationProgress
- type TranslationProgressResponse
- type TranslationsBuildsListOptions
- type TranslationsListResponse
- type TranslationsProjectBuild
- type TranslationsProjectBuildResponse
- type TranslationsProjectBuildsListResponse
- type UpdateRequest
- type UploadTranslations
- type UploadTranslationsRequest
- type UploadTranslationsResponse
- type User
- type ValidationError
- type ValidationErrorResponse
- type Vote
- type VoteAddRequest
- type VoteGetResponse
- type VoteType
- type VotesListOptions
- type VotesListResponse
- type WebXMLFileFormatSettings
- type WordAlignment
- type XLSXFileFormatSettings
- type XMLFileFormatSettings
- type XMLFileImportOptions
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNilRequest is returned when a request for a validation is nil. ErrNilRequest = errors.New("request cannot be nil") )
Functions ¶
This section is empty.
Types ¶
type ARBFileFormatSettings ¶
type ARBFileFormatSettings struct{ CommonFileFormatSettings }
type AddLanguageRequest ¶
type AddLanguageRequest struct { // Language name. Name string `json:"name"` // Custom language code. Code string `json:"code"` // Custom language locale code. LocaleCode string `json:"localeCode"` // Text direction in custom language. Enum: "ltr" "rtl". // "ltr" - left-to-right // "rtl" - right-to-left TextDirection string `json:"textDirection"` // Array with category names. PluralCategoryNames []string `json:"pluralCategoryNames"` // Custom language 3 letters code. Format: ISO 6393 code. ThreeLettersCode string `json:"threeLettersCode"` // Custom language 2 letters code. Format: ISO 6391 code. TwoLettersCode string `json:"twoLettersCode"` // Use if custom language is a dialect. DialectOf string `json:"dialectOf"` }
AddLanguageRequest defines the structure of a request to add a new custom language.
func (*AddLanguageRequest) Validate ¶
func (r *AddLanguageRequest) Validate() error
Validate checks if the add request is valid. It implements the RequestValidator interface.
type AdocFileFormatSettings ¶
type AdocFileFormatSettings struct { CommonFileFormatSettings // Skip Include Directives. Default: false. ExcludeIncludeDirectives *bool `json:"excludeIncludeDirectives,omitempty"` // Default: false }
type AdocFileImportOptions ¶
type AdocFileImportOptions struct { // Skip Include Directives. Default: false. ExcludeIncludeDirectives *bool `json:"excludeIncludeDirectives,omitempty"` }
AdocFileImportOptions implements the FileImportOptions interface.
func (*AdocFileImportOptions) ValidateFileImportOptions ¶
func (o *AdocFileImportOptions) ValidateFileImportOptions() error
type Alignment ¶
type Alignment struct { SourceWord string `json:"sourceWord"` SourceLemma string `json:"sourceLemma"` TargetWord string `json:"targetWord"` TargetLemma string `json:"targetLemma"` Match int `json:"match"` Probability int `json:"probability"` }
Alignment represents a word alignment.
type AndroidFileFormatSettings ¶
type AndroidFileFormatSettings struct{ CommonFileFormatSettings }
type Approval ¶
type Approval struct { ID int `json:"id"` User User `json:"user"` TranslationID int `json:"translationId"` StringID int `json:"stringId"` LanguageID string `json:"languageId"` CreatedAt string `json:"createdAt"` }
Approval represents a Crowdin translation approval.
type ApprovalsGetResponse ¶
type ApprovalsGetResponse struct {
Data *Approval `json:"data"`
}
ApprovalsGetResponse defines the structure of the response when getting a single translation approval.
type ApprovalsListOptions ¶
type ApprovalsListOptions struct { // File Identifier. // Note: Must be used together with `languageId`. FileID int `json:"fileId,omitempty"` // Label Identifiers. // Example: labelIds=1,2,3,4,5 LabelIDs []int `json:"labelIds,omitempty"` // Exclude Label Identifiers. ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"` // String Identifier. // Note: Must be used together with `languageId`. StringID int `json:"stringId,omitempty"` // Language Identifier. // Note: Must be used together with `stringId` or `fileId`. LanguageID string `json:"languageId,omitempty"` // Translation Identifier. // Note: If specified, `fileId`, `stringId` and `languageId` are ignored. TranslationID int `json:"translationId,omitempty"` ListOptions }
ApprovalsListOptions specifies the optional parameters to the StringTranslationsService.ListApprovals method.
type ApprovalsListResponse ¶
type ApprovalsListResponse struct {
Data []*ApprovalsGetResponse `json:"data"`
}
ApprovalsListResponse defines the structure of the response when getting a list of translation approvals.
type Branch ¶
type Branch struct { ID int `json:"id"` ProjectID int `json:"projectId"` Name string `json:"name"` Title string `json:"title"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` ExportPattern *string `json:"exportPattern,omitempty"` Priority *string `json:"priority,omitempty"` }
Branch represents a project branch.
type BranchMerge ¶
type BranchMerge struct { Identifier string `json:"identifier"` Status string `json:"status"` Progress int `json:"progress"` Attributes struct { SourceBranchID int `json:"sourceBranchId"` DeleteAfterMerge bool `json:"deleteAfterMerge"` } `json:"attributes"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` StartedAt string `json:"startedAt"` FinishedAt string `json:"finishedAt"` }
BranchMerge represents a branch merge status.
type BranchMergeSummary ¶
type BranchMergeSummary struct { Status string `json:"status"` SourceBranchID int `json:"sourceBranchId"` TargetBranchID int `json:"targetBranchId"` DryRun bool `json:"dryRun"` Details map[string]int `json:"details"` }
BranchMergeSummary represents a summary of a branch merge.
type BranchesAddRequest ¶
type BranchesAddRequest struct { // Branch name. // Note: Can't contain \ / : * ? " < > | symbols. Name string `json:"name"` // Use to provide more details for translators. // Title is available in UI only. Title string `json:"title,omitempty"` // Branch export pattern. Defines branch name and path in resulting // translations bundle. Note: Can't contain : * ? " < > | symbols. ExportPattern string `json:"exportPattern,omitempty"` // Defines priority level for each branch. // Enum: low, normal, high. Default: normal. Priority string `json:"priority,omitempty"` }
BranchesAddRequest defines the structure of a request to create a new branch.
func (*BranchesAddRequest) Validate ¶
func (r *BranchesAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BranchesCloneRequest ¶
type BranchesCloneRequest struct { // Branch name. Note: Can't contain \ / : * ? " < > | symbols. Name string `json:"name"` // Title is used to provide more details for translators. // It is available in UI only. Title string `json:"title,omitempty"` }
BranchesCloneRequest defines the structure of a request to clone a branch.
func (*BranchesCloneRequest) Validate ¶
func (r *BranchesCloneRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BranchesGetResponse ¶
type BranchesGetResponse struct {
Data *Branch `json:"data"`
}
BranchesGetResponse describes a response with a single branch.
type BranchesListOptions ¶
type BranchesListOptions struct { // Name of the branch (filter branch by name). Name string `json:"name,omitempty"` ListOptions }
BranchesListOptions specifies the optional parameters to the SourceFilesService.ListBranches method.
type BranchesListResponse ¶
type BranchesListResponse struct {
Data []*BranchesGetResponse `json:"data"`
}
BranchesListResponse describes a response with a list of branches.
type BranchesMergeRequest ¶
type BranchesMergeRequest struct { // Branch that will be merged. SourceBranchID int `json:"sourceBranchId"` // Whether to delete branch after merge. Default: false. DeleteAfterMerge *bool `json:"deleteAfterMerge,omitempty"` // Simulate merging without making any real changes. Default: false. DryRun *bool `json:"dryRun,omitempty"` }
BranchesMergeRequest defines the structure of a request to merge branches.
func (*BranchesMergeRequest) Validate ¶
func (r *BranchesMergeRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type BranchesMergeResponse ¶
type BranchesMergeResponse struct {
Data *BranchMerge `json:"data"`
}
BranchesMergeResponse describes a response with a single branch merge status.
type BranchesMergeSummaryResponse ¶
type BranchesMergeSummaryResponse struct {
Data *BranchMergeSummary `json:"data"`
}
BranchesMergeSummaryResponse describes a response with a single branch merge summary.
type BuildProjectDirectoryTranslation ¶
type BuildProjectDirectoryTranslation struct { ID int `json:"id"` ProjectID int `json:"projectId"` Status string `json:"status"` Progress int `json:"progress"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` FinishedAt string `json:"finishedAt,omitempty"` }
BuildProjectDirectoryTranslation represents a project directory build.
type BuildProjectDirectoryTranslationRequest ¶
type BuildProjectDirectoryTranslationRequest struct { // Specify target languages for build. // Leave this field empty to build all target languages. TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"` // Defines whether to export only translated strings. Default: false. // Note: true value can't be used with `skipUntranslatedFiles=true` in same request . SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"` // Defines whether to export only translated file. Default: false. // Note: true value can't be used with `skipUntranslatedStrings=true“ in same request. SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"` // Defines whether to export only approved strings. Default: false. ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"` // Preserve folder hierarchy. Default: false. PreserveFolderHierarchy *bool `json:"preserveFolderHierarchy,omitempty"` }
BuildProjectDirectoryTranslationRequest defines the structure of a request to build project directory translation.
func (*BuildProjectDirectoryTranslationRequest) Validate ¶
func (r *BuildProjectDirectoryTranslationRequest) Validate() error
Validate checks if the build project directory translation request is valid. It implements the crowdin.RequestValidator interface.
type BuildProjectFileTranslationRequest ¶
type BuildProjectFileTranslationRequest struct { // Target Language Identifier. TargetLanguageID string `json:"targetLanguageId"` // Defines whether to export only translated strings. Default: false. // Note: true value can't be used with `skipUntranslatedFiles=true“ in same request. SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"` // Defines whether to export only translated file. Default: false. // Note: true value can't be used with skipUntranslatedStrings=true in same request. SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"` // Defines whether to export only approved strings. Default: false. ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"` }
BuildProjectFileTranslationRequest defines the structure of a request to build project file translation.
func (*BuildProjectFileTranslationRequest) Validate ¶
func (r *BuildProjectFileTranslationRequest) Validate() error
Validate checks if the build project file translation request is valid. It implements the crowdin.RequestValidator interface.
type BuildProjectRequest ¶
type BuildProjectRequest struct { // Branch Identifier. BranchID int `json:"branchId,omitempty"` // Specify target languages for build. // Leave this field empty to build all target languages TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"` // Defines whether to export only translated strings. // Note: true value can't be used with `skipUntranslatedFiles=true` in same request. SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"` // Defines whether to export only translated files. // Note: true value can't be used with `skipUntranslatedStrings=true` in same request. SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"` // Defines whether to export only approved strings. ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"` }
BuildProjectRequest defines the structure of a request to build a project.
func (*BuildProjectRequest) Validate ¶
func (r *BuildProjectRequest) Validate() error
Validate checks if the build project request is valid. It implements the crowdin.RequestValidator interface.
func (*BuildProjectRequest) ValidateBuildRequest ¶
func (r *BuildProjectRequest) ValidateBuildRequest() error
ValidateBuildRequest implements the BuildProjectTranslationRequest interface.
type BuildProjectTranslationRequest ¶
type BuildProjectTranslationRequest interface {
ValidateBuildRequest() error
}
BuildProjectTranslationRequest interface that allows accepting BuildProjectRequest and PseudoBuildProjectRequest types.
type CSVFileFormatSettings ¶
type CSVFileFormatSettings struct{ CommonFileFormatSettings }
type ChromeFileFormatSettings ¶
type ChromeFileFormatSettings struct{ CommonFileFormatSettings }
type CommonFileFormatSettings ¶
type CommonFileFormatSettings struct { // Defines whether to split long texts into smaller text segments. Default: true. // Important! This option disables the possibility to upload existing translations for XML files when enabled. ContentSegmentation *bool `json:"contentSegmentation,omitempty"` // Storage identifier of the SRX segmentation rules file. Default: null. SRXStorageID *int `json:"srxStorageId,omitempty"` // File format export pattern. Default: null. // Defines file name and path in resulting translations bundle. // Note: Can't contain : * ? " < > | symbols. ExportPattern *string `json:"exportPattern,omitempty"` }
func (*CommonFileFormatSettings) ValidateSettings ¶
func (p *CommonFileFormatSettings) ValidateSettings() error
type CommonFileImportOptions ¶
type CommonFileImportOptions struct { // Defines whether to split long texts into smaller text segments. Default: true. ContentSegmentation *bool `json:"contentSegmentation,omitempty"` // Storage identifier of the SRX segmentation rules file. Default: null. SRXStorageID *int `json:"srxStorageId,omitempty"` }
CommonFileImportOptions implements the FileImportOptions interface.
func (*CommonFileImportOptions) ValidateFileImportOptions ¶
func (o *CommonFileImportOptions) ValidateFileImportOptions() error
type DOCXFileImportOptions ¶
type DOCXFileImportOptions struct { // When checked, strips additional formatting tags related to text spacing. Default: false // Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, // *.dotm, *.xlsx, *.xltx, *.xlsm, *.xltm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. CleanTagsAggressively *bool `json:"cleanTagsAggressively,omitempty"` // When checked, exposes hidden text for translation. Default: false // Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm. TranslateHiddenText *bool `json:"translateHiddenText,omitempty"` // When checked, exposes hidden hyperlinks for translation. Default: false // Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm, // *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. TranslateHyperlinkURLs *bool `json:"translateHyperlinkUrls,omitempty"` // When checked, exposes hidden rows and columns for translation. Default: false // Note: Works only for files with the following extensions: *.xlsx, *.xltx, *.xlsm, *.xltm. TranslateHiddenRowsAndColumns *bool `json:"translateHiddenRowsAndColumns,omitempty"` // When checked, expose slide notes for translation. Default: true // Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. ImportNotes *bool `json:"importNotes,omitempty"` // When checked, exposes hidden slides for translation. Default: false // Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. ImportHiddenSlides *bool `json:"importHiddenSlides,omitempty"` // Important: ContentSegmentation option disables the possibility to upload existing translations // for XML files when enabled. CommonFileImportOptions }
DOCXFileImportOptions implements the FileImportOptions interface.
type Directory ¶
type Directory struct { ID int `json:"id"` ProjectID int `json:"projectId"` BranchID int `json:"branchId"` DirectoryID int `json:"directoryId"` Name string `json:"name"` Title string `json:"title"` ExportPattern string `json:"exportPattern"` Path string `json:"path"` Priority string `json:"priority"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` }
Directory represents a project directory.
type DirectoryAddRequest ¶
type DirectoryAddRequest struct { // Directory name. // Note: Can't contain \ / : * ? " < > | symbols. Name string `json:"name"` // Branch identifier. // Note: Can't be used with `directoryId` in same request. BranchID int `json:"branchId,omitempty"` // Parent Directory Identifier. // Note: Can't be used with `branchId` in same request. DirectoryID int `json:"directoryId,omitempty"` // Title is used to provide more details for translators. // It is available in UI only. Title string `json:"title,omitempty"` // Directory export pattern. Defines directory name and path in resulting // translations bundle. // Note: Can't contain : * ? " < > | symbols. ExportPattern string `json:"exportPattern,omitempty"` // Defines priority level for each branch. // Enum: low, normal, high. Default: normal. Priority string `json:"priority,omitempty"` }
DirectoryAddRequest defines the structure of a request to create a new directory.
func (*DirectoryAddRequest) Validate ¶
func (r *DirectoryAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type DirectoryGetResponse ¶
type DirectoryGetResponse struct {
Data *Directory `json:"data"`
}
DirectoryGetResponse describes a response with a single directory.
type DirectoryListOptions ¶
type DirectoryListOptions struct { // BranchID is the ID of the branch to filter directories by. // Note: Can't be used with `directoryID` in the same request. // To list the directories from all the nested levels within the branch, // ensure to use the `recursion` parameter with the `branchID` parameter. BranchID int `json:"branchId,omitempty"` // DirectoryID is the ID of the directory to filter directories by. // Note: Can't be used with `branchID` in the same request. // To list the directories from all the nested levels within the directory, // ensure to use the `recursion` parameter with the `directoryID` parameter. DirectoryID int `json:"directoryId,omitempty"` // Filter directories by name. Filter string `json:"filter,omitempty"` // Recursion is used to list directories recursively. // Note: Works only when `directoryID` or `branchID` parameter is specified. Recursion any `json:"recursion,omitempty"` ListOptions }
DirectoryListOptions specifies the optional parameters to the SourceFilesService.ListDirectories method.
type DirectoryListResponse ¶
type DirectoryListResponse struct {
Data []*DirectoryGetResponse `json:"data"`
}
DirectoryListResponse describes a response with a list of directories.
type DitaFileFormatSettings ¶
type DitaFileFormatSettings struct{ CommonFileFormatSettings }
type DocxFileFormatSettings ¶
type DocxFileFormatSettings struct { CommonFileFormatSettings // When checked, strips additional formatting tags related to text spacing. Default: false. // Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm, // *.xlsx, *.xltx, *.xlsm, *.xltm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. CleanTagsAggressively *bool `json:"cleanTagsAggressively,omitempty"` // When checked, exposes hidden text for translation. Default: false. // Note: Works only for files with the following extensions: *.docx, *.dotx, *.docm, *.dotm. TranslateHiddenText *bool `json:"translateHiddenText,omitempty"` // When checked, exposes hidden hyperlinks for translation. Default: false. // Note: Works only for files with the following extensions: *.docx, *.dotx, // *.docm, *.dotm, *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. TranslateHyperlinkUrls *bool `json:"translateHyperlinkUrls,omitempty"` // When checked, exposes hidden rows and columns for translation. Default: false. // Note: Works only for files with the following extensions: *.xlsx, *.xltx, *.xlsm, *.xltm. TranslateHiddenRowsAndColumns *bool `json:"translateHiddenRowsAndColumns,omitempty"` // When checked, expose slide notes for translation. Default: true. // Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. ImportNotes *bool `json:"importNotes,omitempty"` // When checked, exposes hidden slides for translation. Default: false. // Note: Works only for files with the following extensions: *.pptx, *.potx, *.ppsx, *.pptm, *.potm, *.ppsm. ImportHiddenSlides *bool `json:"importHiddenSlides,omitempty"` }
type DownloadLink ¶
type DownloadLink struct { URL string `json:"url"` ExpireIn string `json:"expireIn"` Etag *string `json:"etag,omitempty"` }
DownloadLink represents a download link.
type DownloadLinkResponse ¶
type DownloadLinkResponse struct {
Data *DownloadLink `json:"data"`
}
DownloadLinkResponse defines the structure of a response when getting a download URL with its expiration time.
type ErrorResponse ¶
ErrorResponse is the error response structure from the API.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
Error implements the Error interface.
type ExportTranslationRequest ¶
type ExportTranslationRequest struct { // Specify target language for export. TargetLanguageID string `json:"targetLanguageId"` // Defines export file format. Use API Type feature specified at the // corresponding file format from Crowdin Store. // Note: the `format` parameter is required in all cases except when you'd like // to export translations for a single file in its original format. Format string `json:"format,omitempty"` // Label Identifiers. LabelIDs []int `json:"labelIds,omitempty"` // Branch Identifiers. // Note: Can't be used with `directoryIds` or `fileIds` in same request. BranchIDs []int `json:"branchIds,omitempty"` // Directory Identifiers. // Note: Can't be used with `branchIds` or `fileIds` in same request. DirectoryIDs []int `json:"directoryIds,omitempty"` // File Identifiers. // Note: Can't be used with `branchIds` or `directoryIds` in same request. FileIDs []int `json:"fileIds,omitempty"` // Defines whether to export only translated strings. Default is false. // Note: Can't be used with `skipUntranslatedFiles` in same request. SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"` // Defines whether to export only approved strings. Default is false. ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"` }
ExportTranslationRequest defines the structure of a request to export translations.
func (*ExportTranslationRequest) Validate ¶
func (r *ExportTranslationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FJSFileFormatSettings ¶
type FJSFileFormatSettings struct{ CommonFileFormatSettings }
type FMHTMLFileFormatSettings ¶
type FMHTMLFileFormatSettings struct{ CommonFileFormatSettings }
type FMMDFileFormatSettings ¶
type FMMDFileFormatSettings struct{ CommonFileFormatSettings }
type File ¶
type File struct { ID int `json:"id"` ProjectID int `json:"projectId"` BranchID *int `json:"branchId,omitempty"` DirectoryID *int `json:"directoryId,omitempty"` Name string `json:"name"` Title *string `json:"title,omitempty"` Context *string `json:"context,omitempty"` Type string `json:"type"` Path string `json:"path"` Status string `json:"status"` RevisionID int `json:"revisionId"` Priority string `json:"priority"` ImportOptions map[string]any `json:"importOptions,omitempty"` ExportOptions map[string]any `json:"exportOptions,omitempty"` ExcludeTargetLanguages []string `json:"excludedTargetLanguages,omitempty"` ParserVersion *int `json:"parserVersion,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` }
File represents a project file.
type FileAddRequest ¶
type FileAddRequest struct { // Storage Identifier. StorageID int `json:"storageId"` // File name. // Note: Can't contain \ / : * ? " < > | symbols. ZIP files are not allowed. Name string `json:"name"` // Branch Identifier — defines branch to which file will be added. // Note: Can't be used with directoryId in same request. BranchID int `json:"branchId,omitempty"` // Directory Identifier — defines directory to which file will be added. // Note: Can't be used with branchId in same request. DirectoryID int `json:"directoryId,omitempty"` // Title is used to provide more details for translators. // It is available in UI only. Title string `json:"title,omitempty"` // Context is used to provide context about whole file. Context string `json:"context,omitempty"` // Type of the file. Default: auto. // Enum: auto, android, macosx, resx, properties, gettext, yaml, php, json, // xml, ini, rc, resw, resjson, qtts, joomla, chrome, dtd, dklang, // flex, nsh, wxl, xliff, xliff_two, html, haml, txt, csv, md, mdx_v1, // mdx_v2, flsnp, fm_html, fm_md, mediawiki, docx, xlsx, sbv, properties_play, // properties_xml, maxthon, go_json, dita, idml, mif, stringsdict, plist, vtt, // vdf, srt, stf, toml, contentful_rt, svg, js, coffee, ts, i18next_json, xaml, // arb, adoc, fbt, webxml, nestjs_i18n. Type string `json:"type,omitempty"` // Using latest parser version by default. // Note: Must be used together with type. ParserVersion int `json:"parserVersion,omitempty"` // File import options. ImportOptions FileImportOptions `json:"importOptions,omitempty"` // File export options. ExportOptions FileExportOptions `json:"exportOptions,omitempty"` // Set Target Languages the file should not be translated into. // Do not use this option if the file should be available for all project languages. ExcludedTargetLanguages []string `json:"excludedTargetLanguages,omitempty"` // Attach labels to strings. AttachLabelIDs []int `json:"attachLabelIds,omitempty"` }
FileAddRequest defines the structure of a request to create a new file.
func (*FileAddRequest) Validate ¶
func (r *FileAddRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type FileExportOptions ¶
type FileExportOptions interface{ ValidateFileExportOptions() error }
type FileFormatSettings ¶
type FileFormatSettings interface {
ValidateSettings() error
}
type FileGetResponse ¶
type FileGetResponse struct {
Data *File `json:"data"`
}
FileGetResponse describes a response with a single file.
type FileImportOptions ¶
type FileImportOptions interface{ ValidateFileImportOptions() error }
type FileListOptions ¶
type FileListOptions struct { // BranchID is the ID of the branch to filter files by. // Note: Can't be used with `directoryId` in the same request. // To list the files from all the nested levels within the branch, // ensure to use the `recursion` parameter with the `branchId` parameter. BranchID int `json:"branchId,omitempty"` // DirectoryID is the ID of the directory to filter files by. // Note: Can't be used with `branchId` in the same request. // To list the files from all the nested levels within the directory, // ensure to use the `recursion` parameter with the `directoryId` parameter. DirectoryID int `json:"directoryId,omitempty"` // Filter files by name. Filter string `json:"filter,omitempty"` // Recursion is used to list files recursively. // Note: Works only when `directoryID` or `branchID` parameter is specified. Recursion any `json:"recursion,omitempty"` ListOptions }
FileListOptions specifies the optional parameters to the SourceFilesService.ListFiles method.
type FileListResponse ¶
type FileListResponse struct {
Data []*FileGetResponse `json:"data"`
}
FileListResponse describes a response with a list of files.
type FileRevision ¶
type FileRevision struct { ID int `json:"id"` ProjectID int `json:"projectId"` FileID int `json:"fileId"` RestoreToRevision *int `json:"restoreToRevision,omitempty"` Info struct { Added RevisionInfo `json:"added"` Deleted RevisionInfo `json:"deleted"` Updated RevisionInfo `json:"updated"` } `json:"info"` Date string `json:"date"` }
FileRevision represents a file revision.
type FileRevisionListResponse ¶
type FileRevisionListResponse struct {
Data []*FileRevisionResponse `json:"data"`
}
FileRevisionListResponse describes a response with a list of file revisions.
type FileRevisionResponse ¶
type FileRevisionResponse struct {
Data *FileRevision `json:"data"`
}
FileRevisionResponse describes a response with a single file revision.
type FileUpdateRestoreRequest ¶
type FileUpdateRestoreRequest struct { // Revision Identifier. RevisionID int `json:"revisionId,omitempty"` // Storage Identifier. StorageID int `json:"storageId,omitempty"` // File name. // Note: Can't contain \ / : * ? " < > | symbols. Name string `json:"name,omitempty"` // Update Option defines whether to keep existing translations and // approvals for updated strings. Default: `clear_translations_and_approvals`. // Enum: `clear_translations_and_approvals`, `keep_translations`, `keep_translations_and_approvals`. UpdateOption string `json:"updateOption,omitempty"` // File import options. ImportOptions FileImportOptions `json:"importOptions,omitempty"` // File export options. ExportOptions FileExportOptions `json:"exportOptions,omitempty"` // Attach labels to updated strings. AttachLabelIDs []int `json:"attachLabelIds,omitempty"` // Detach labels from updated strings. DetachLabelIDs []int `json:"detachLabelIds,omitempty"` // Enable to replace context, that have been modified in Crowdin. // Default: false. ReplaceModifiedContext *bool `json:"replaceModifiedContext,omitempty"` }
FileUpdateRestoreRequest defines the structure of a request to update or restore a file.
func (*FileUpdateRestoreRequest) Validate ¶
func (r *FileUpdateRestoreRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type GeneralFileExportOptions ¶
type GeneralFileExportOptions struct { // File export pattern. Defines file name and path in resulting translations bundle. // Note: Can't contain : * ? " < > | symbols. ExportPattern string `json:"exportPattern,omitempty"` }
SpreadsheetsFileExportOptions implements the FileExportOptions interface.
func (*GeneralFileExportOptions) ValidateFileExportOptions ¶
func (o *GeneralFileExportOptions) ValidateFileExportOptions() error
type Group ¶
type Group struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` ParentID int `json:"parentId"` OrganizationID int `json:"organizationId"` UserID int `json:"userId"` SubgroupsCount int `json:"subgroupsCount"` ProjectsCount int `json:"projectsCount"` WebURL string `json:"webUrl"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` }
Group represents a Crowdin group.
type GroupsAddRequest ¶
type GroupsAddRequest struct { // Group Name (required). Name string `json:"name"` // Parent Group Identifier. ParentID int `json:"parentId,omitempty"` // Group description. Description string `json:"description,omitempty"` }
GroupsAddRequest defines the structure of a request to add a group.
func (*GroupsAddRequest) Validate ¶
func (r *GroupsAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type GroupsGetResponse ¶
type GroupsGetResponse struct {
Data *Group `json:"data"`
}
GroupsGetResponse defines the structure of a response when retrieving a group.
type GroupsListOptions ¶
type GroupsListOptions struct { ListOptions ParentID int `json:"parentId,omitempty"` }
GroupsListOptions specifies the optional parameters to the GroupsService.List method.
type GroupsListResponse ¶
type GroupsListResponse struct { Data []*GroupsGetResponse `json:"data"` Pagination *Pagination `json:"pagination"` }
GroupsListResponse defines the structure of a response when getting a list of groups.
type HTMLFileFormatSettings ¶
type HTMLFileFormatSettings struct { CommonFileFormatSettings // Specify CSS selectors for elements that should not be imported ExcludedElements []string `json:"excludedElements,omitempty"` }
type HTMLFileImportOptions ¶
type HTMLFileImportOptions struct { // Specify CSS selectors for elements that should not be imported. ExcludedElements []string `json:"excludedElements,omitempty"` CommonFileImportOptions }
HTMLFileImportOptions implements the FileImportOptions interface.
type HTMLWithFrontMatterFileImportOptions ¶
type HTMLWithFrontMatterFileImportOptions struct { // Specify CSS selectors for elements that should not be imported. ExcludedElements []string `json:"excludedElements,omitempty"` // Specify elements that should not be imported. ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"` CommonFileImportOptions }
HTMLWithFrontMatterFileImportOptions implements the FileImportOptions interface.
type IDMLFileFormatSettings ¶
type IDMLFileFormatSettings struct{ CommonFileFormatSettings }
type JSONFileFormatSettings ¶
type JSONFileFormatSettings struct { CommonFileFormatSettings // Enum: "i18next_json", "nestjs_i18n". Type string `json:"type,omitempty"` }
type JavaScriptFileExportOptions ¶
type JavaScriptFileExportOptions struct { // File export pattern. Defines file name and path in resulting translations bundle. // Note: Can't contain : * ? " < > | symbols. ExportPattern string `json:"exportPattern,omitempty"` // Acceptable values are: `single`, `double`. Default is `single`. // `single` - Output will be enclosed in single quotes. // `double` - Output will be enclosed in double quotes. ExportQuotes string `json:"exportQuotes,omitempty"` }
JavaScriptFileExportOptions implements the FileExportOptions interface.
func (*JavaScriptFileExportOptions) ValidateFileExportOptions ¶
func (o *JavaScriptFileExportOptions) ValidateFileExportOptions() error
type JavaScriptFileFormatSettings ¶
type JavaScriptFileFormatSettings struct { // File export pattern. Defines file name and path in resulting translations bundle. // Note: Can't contain : * ? " < > | symbols. ExportPattern string `json:"exportPattern,omitempty"` // Enum: "single" "double". Default: "single". // single - Output will be enclosed in single quotes. // double - Output will be enclosed in double quotes. ExportQuotes string `json:"exportQuotes,omitempty"` }
func (*JavaScriptFileFormatSettings) ValidateSettings ¶
func (p *JavaScriptFileFormatSettings) ValidateSettings() error
type Language ¶
type Language struct { ID string `json:"id"` Name string `json:"name"` EditorCode string `json:"editorCode"` TwoLettersCode string `json:"twoLettersCode"` ThreeLettersCode string `json:"threeLettersCode"` Locale string `json:"locale"` AndroidCode string `json:"androidCode"` OSXCode string `json:"osxCode"` OSXLocale string `json:"osxLocale"` PluralCategoryNames []string `json:"pluralCategoryNames"` PluralRules string `json:"pluralRules"` PluralExamples []string `json:"pluralExamples"` TextDirection string `json:"textDirection"` DialectOf string `json:"dialectOf"` }
Language represents a language in Crowdin.
type LanguageTranslation ¶
type LanguageTranslation struct { StringID int `json:"stringId"` ContentType string `json:"contentType"` TranslationID *int `json:"translationId,omitempty"` Text *string `json:"text,omitempty"` User *User `json:"user,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Plurals []*LanguageTranslationPlural `json:"plurals,omitempty"` }
LanguageTranslation represents a language translation. Contains the plain, plural, or ICU translation.
type LanguageTranslationPlural ¶
type LanguageTranslationPlural struct { TranslationID int `json:"translationId"` Text string `json:"text"` PluralForm string `json:"pluralForm"` User User `json:"user"` CreatedAt string `json:"createdAt"` }
LanguageTranslationPlural represents a plural language translation and is part of the LanguageTranslation.
type LanguageTranslationsListOptions ¶
type LanguageTranslationsListOptions struct { // String Identifiers. Filter translations by `stringIds`. // Example: stringIds=1,2,3,4,5 StringIDs []int `json:"stringIds,omitempty"` // Label Identifiers. Filter translations by `labelIds`. // Example: labelIds=1,2,3,4,5 LabelIDs []int `json:"labelIds,omitempty"` // File Identifier. Filter translations by `fileId`. // Note: Can't be used with `branchId` or `directoryId` in the same request. FileID int `json:"fileId,omitempty"` // Branch Identifier. Filter translations by `branchId`. // Note: Can't be used with `fileId` or `directoryId` in the same request. BranchID int `json:"branchId,omitempty"` // Directory Identifier. Filter translations by `directoryId`. // Note: Can't be used with `fileId` or `branchId` in the same request. DirectoryID int `json:"directoryId,omitempty"` // Filter translations by CroQL. // Note: Can't be used with `stringIds`, `labelIds` or `fileId` // in the same request. CroQL string `json:"croql,omitempty"` // Enable denormalize placeholders. // Enum: 0, 1. Default: 0. DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"` ListOptions }
LanguageTranslationsListOptions specifies the optional parameters to the StringTranslationsService.ListLanguageTranslations method.
type LanguageTranslationsListResponse ¶
type LanguageTranslationsListResponse struct { Data []struct { Data *LanguageTranslation `json:"data"` } `json:"data"` }
LanguageTranslationsGetResponse defines the structure of the response when retrieving a list of language translations.
type LanguagesGetResponse ¶
type LanguagesGetResponse struct {
Data *Language `json:"data"`
}
LanguagesGetResponse defines the structure of a response when getting a single language.
type LanguagesListResponse ¶
type LanguagesListResponse struct { Data []*LanguagesGetResponse `json:"data"` Pagination *Pagination `json:"pagination"` }
LanguagesListResponse defines the structure of a response when getting a list of languages.
type ListOptions ¶
type ListOptions struct { // A maximum number of items to retrieve (default 25, max 500). Limit int `json:"limit,omitempty"` // A starting offset in the collection of items (default 0). Offset int `json:"offset,omitempty"` }
ListOptions specifies the optional parameters to methods that support pagination.
type MDFileFormatSettings ¶
type MDFileFormatSettings struct{ CommonFileFormatSettings }
type MDXV1FileFormatSettings ¶
type MDXV1FileFormatSettings struct { CommonFileFormatSettings // Specify elements that should not be imported. ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"` // Defines whether to import code blocks. Default: false. ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"` // Default: "mdx_v1". Enum: "mdx_v1", "mdx_v2" Type string `json:"type,omitempty"` }
type MDXV1FileImportOptions ¶
type MDXV1FileImportOptions struct { // Specify elements that should not be imported ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"` // Defines whether to import code blocks. Default: false. ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"` CommonFileImportOptions }
MDXV1FileImportOptions implements the FileImportOptions interface.
type MDXV2FileFormatSettings ¶
type MDXV2FileFormatSettings struct { CommonFileFormatSettings // Specify elements that should not be imported. ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"` // Defines whether to import code blocks. Default: false. ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"` }
type MDXV2FileImportOptions ¶
type MDXV2FileImportOptions struct { // Specify elements that should not be imported ExcludedFrontMatterElements []string `json:"excludedFrontMatterElements,omitempty"` // Defines whether to import code blocks. Default: false. ExcludeCodeBlocks *bool `json:"excludeCodeBlocks,omitempty"` CommonFileImportOptions }
MDXV2FileImportOptions implements the FileImportOptions interface.
type MIFFileFormatSettings ¶
type MIFFileFormatSettings struct{ CommonFileFormatSettings }
type MacOSFileFormatSettings ¶
type MacOSFileFormatSettings struct{ CommonFileFormatSettings }
type MadCapFLSNPFileFormatSettings ¶
type MadCapFLSNPFileFormatSettings struct{ CommonFileFormatSettings }
type MediaWikiFileFormatSettings ¶
type MediaWikiFileFormatSettings struct { // Storage identifier of the SRX segmentation rules file. Default: null. SRXStorageID *int `json:"srxStorageId,omitempty"` // File format export pattern. Defines file name and path in resulting // translations bundle. // Default: null. Note: Can't contain : * ? " < > | symbols. ExportPattern *string `json:"exportPattern,omitempty"` }
func (*MediaWikiFileFormatSettings) ValidateSettings ¶
func (p *MediaWikiFileFormatSettings) ValidateSettings() error
type OtherFileFormatSettings ¶
type OtherFileFormatSettings struct { // File format export pattern. Defines file name and path in resulting translations bundle. // Default: null. Can't contain : * ? " < > | symbols. ExportPattern *string `json:"exportPattern,omitempty"` }
func (*OtherFileFormatSettings) ValidateSettings ¶
func (p *OtherFileFormatSettings) ValidateSettings() error
type OtherFileImportOptions ¶
type OtherFileImportOptions struct { // Only for xml, md, flsnp, docx, mif, idml, dita, android8 files. // // Note: When Content segmentation is enabled, the translation upload is handled by an // experimental machine learning technology. To achieve the best results, we recommend // uploading translation files with the same or as close as possible file structure // as in source files. CommonFileImportOptions }
OtherFileImportOptions implements the FileImportOptions interface.
type Pagination ¶
Pagination represents the pagination information.
type PaginationResponse ¶
type PaginationResponse struct {
Pagination Pagination `json:"pagination"`
}
PaginationResponse is the pagination response structure from the API.
type PreTranslation ¶
type PreTranslation struct { Identifier string `json:"identifier"` Status string `json:"status"` Progress int `json:"progress"` Attributes *PreTranslationAttributes `json:"attributes"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` StartedAt string `json:"startedAt,omitempty"` FinishedAt string `json:"finishedAt,omitempty"` }
PreTranslation represents a pre-translation status.
type PreTranslationAttributes ¶
type PreTranslationAttributes struct { LanguageIDs []string `json:"languageIds"` FileIDs []int `json:"fileIds"` Method *string `json:"method,omitempty"` AutoApproveOption *string `json:"autoApproveOption,omitempty"` DuplicateTranslations *bool `json:"duplicateTranslations,omitempty"` SkipApprovedTranslations *bool `json:"skipApprovedTranslations,omitempty"` TranslateUntranslatedOnly *bool `json:"translateUntranslatedOnly,omitempty"` TranslateWithPerfectMatchOnly *bool `json:"translateWithPerfectMatchOnly,omitempty"` }
type PreTranslationRequest ¶
type PreTranslationRequest struct { // Set of languages to which pre-translation should be applied. LanguageIDs []string `json:"languageIds"` // Files array that should be translated. FileIDs []int `json:"fileIds"` // Defines pre-translation method. Enum: "tm", "mt". Default: "tm". // - tm – pre-translation via Translation Memory. // - mt – pre-translation via Machine Translation. "mt" should be used with `engineId` parameter. Method string `json:"method,omitempty"` // Machine Translation engine Identifier. Required if `method` is set to "mt". EngineID int `json:"engineId,omitempty"` // Defines which translations added by TM pre-translation should be auto-approved. Default: "none". // Enum: "all", "exceptAutoSubstituted", "perfectMatchApprovedOnly", "perfectMatchOnly", "none" // - all – all // - perfectMatchOnly – with perfect TM match // - exceptAutoSubstituted – all (skip auto-substituted suggestions) // - perfectMatchApprovedOnly - with perfect TM match (approved previously) // - none – no auto-approve AutoApproveOption string `json:"autoApproveOption,omitempty"` // Adds translations even if the same translation already exists. Default is false. // Note: Works only with TM pre-translation method. DuplicateTranslations *bool `json:"duplicateTranslations,omitempty"` // Skip approved translations. Default is false. // Note: Works only with TM pre-translation method. SkipApprovedTranslations *bool `json:"skipApprovedTranslations,omitempty"` // Applies pre-translation for untranslated strings only. Default is true. // Note: Works only with TM pre-translation method. TranslateUntranslatedOnly *bool `json:"translateUntranslatedOnly,omitempty"` // Applies pre-translation only for the strings with perfect match // (source text and contextual information are identical). Default is false. // Note: Works only with TM pre-translation method. TranslateWithPerfectMatchOnly *bool `json:"translateWithPerfectMatchOnly,omitempty"` // Defines fallback languages mapping. The passed value should contain a map of // language ID as a key and an array of fallback language IDs as a value. // Note: Available only for TM Pre-Translation. FallbackLanguages map[string][]string `json:"fallbackLanguages,omitempty"` // Label Identifiers. LabelIDs []int `json:"labelIds,omitempty"` // Exclude Label Identifiers. ExcludeLabelIDs []int `json:"excludeLabelIds,omitempty"` }
PreTranslationRequest defines the structure of a request to apply pre-translation.
func (*PreTranslationRequest) Validate ¶
func (r *PreTranslationRequest) Validate() error
Validate checks if the request is valid. It implements the crowdin.RequestValidator interface.
type PreTranslationsResponse ¶
type PreTranslationsResponse struct {
Data *PreTranslation `json:"data"`
}
PreTranslationsResponse defines the structure of a response when getting a pre-translation status.
type Project ¶
type Project struct { ID int `json:"id"` Type int `json:"type"` UserID int `json:"userId"` SourceLanguageID string `json:"sourceLanguageId"` TargetLanguageIDs []string `json:"targetLanguageIds"` LanguageAccessPolicy string `json:"languageAccessPolicy"` Name string `json:"name"` Cname *string `json:"cname"` Identifier string `json:"identifier"` Description string `json:"description"` Visibility string `json:"visibility"` Logo string `json:"logo"` PublicDownloads *bool `json:"publicDownloads"` CreatedAt *string `json:"createdAt"` UpdatedAt *string `json:"updatedAt"` LastActivity *string `json:"lastActivity"` SourceLanguage *Language `json:"sourceLanguage"` TargetLanguages []*Language `json:"targetLanguages"` TranslateDuplicates int `json:"translateDuplicates,omitempty"` TagsDetection int `json:"tagsDetection,omitempty"` GlossaryAccess bool `json:"glossaryAccess,omitempty"` IsMTAllowed bool `json:"isMtAllowed,omitempty"` TaskBasedAccessControl bool `json:"taskBasedAccessControl,omitempty"` HiddenStringsProofreadersAccess bool `json:"hiddenStringsProofreadersAccess,omitempty"` AutoSubstitution bool `json:"autoSubstitution,omitempty"` ExportTranslatedOnly bool `json:"exportTranslatedOnly,omitempty"` SkipUntranslatedStrings bool `json:"skipUntranslatedStrings,omitempty"` ExportApprovedOnly bool `json:"exportApprovedOnly,omitempty"` AutoTranslateDialects bool `json:"autoTranslateDialects,omitempty"` UseGlobalTM bool `json:"useGlobalTm,omitempty"` TMContextType string `json:"tmContextType,omitempty"` ShowTMSuggestionsDialects bool `json:"showTmSuggestionsDialects,omitempty"` IsSuspended bool `json:"isSuspended,omitempty"` QACheckIsActive bool `json:"qaCheckIsActive,omitempty"` QACheckCategories map[string]bool `json:"qaCheckCategories,omitempty"` QAChecksIgnorableCategories map[string]bool `json:"qaChecksIgnorableCategories,omitempty"` LanguageMapping map[string]map[string]string `json:"languageMapping,omitempty"` NotificationSettings map[string]bool `json:"notificationSettings,omitempty"` DefaultTMID int `json:"defaultTmId,omitempty"` DefaultGlossaryID int `json:"defaultGlossaryId,omitempty"` AssignedTMs map[int]map[string]int `json:"assignedTms,omitempty"` AssignedGlossaries []int `json:"assignedGlossaries,omitempty"` TMPenalties any `json:"tmPenalties,omitempty"` NormalizePlaceholder bool `json:"normalizePlaceholder,omitempty"` TMPreTranslate *ProjectTMPreTranslate `json:"tmPreTranslate,omitempty"` MTPreTranslate *ProjectMTPreTranslate `json:"mtPreTranslate,omitempty"` SaveMetaInfoInSource bool `json:"saveMetaInfoInSource,omitempty"` SkipUntranslatedFiles bool `json:"skipUntranslatedFiles,omitempty"` InContext bool `json:"inContext,omitempty"` InContextProcessHiddenStrings bool `json:"inContextProcessHiddenStrings,omitempty"` InContextPseudoLanguageID *string `json:"inContextPseudoLanguageId,omitempty"` InContextPseudoLanguage *Language `json:"inContextPseudoLanguage,omitempty"` }
Project represents a Crowdin project.
type ProjectMTPreTranslate ¶
type ProjectMTPreTranslate struct { Enabled *bool `json:"enabled,omitempty"` MTs []ProjectMTs `json:"mts,omitempty"` }
type ProjectMTs ¶
type ProjectMTs struct { MTID int `json:"mtId,omitempty"` // Specify an array of languageIds to use specific languages, or use the string all // to include all supported languages. // Retrieve languageIds via the `List Supported Languages` endpoint LanguageIDs []string `json:"languageIds,omitempty"` }
type ProjectProgressListOptions ¶
type ProjectProgressListOptions struct { // Filter progress by Language Identifier. LanguageIDs string `json:"languageIds,omitempty"` ListOptions }
ProjectProgressListOptions specifies the optional parameters to the TranslationStatusService.GetProjectProgress method.
type ProjectTMPenalties ¶
type ProjectTMPenalties struct { AutoSubstitution int `json:"autoSubstitution,omitempty"` TMPriority struct { Priority int `json:"priority,omitempty"` Penalty int `json:"penalty,omitempty"` } `json:"tmPriority,omitempty"` MultipleTranslations int `json:"multipleTranslations,omitempty"` TimeSinceLastUsage struct { Months int `json:"months,omitempty"` Penalty int `json:"penalty,omitempty"` } `json:"timeSinceLastUsage,omitempty"` TimeSinceLastModified struct { Months int `json:"months,omitempty"` Penalty int `json:"penalty,omitempty"` } `json:"timeSinceLastModified,omitempty"` }
type ProjectTMPreTranslate ¶
type ProjectTMPreTranslate struct { Enabled *bool `json:"enabled,omitempty"` // Enum: "all", "perfectMatchOnly", "exceptAutoSubstituted", "perfectMatchApprovedOnly", "none". AutoApproveOption string `json:"autoApproveOption,omitempty"` // Enum: "perfect", "100". MinimumMatchRatio string `json:"minimumMatchRatio,omitempty"` }
type ProjectsAddFileFormatSettingsRequest ¶
type ProjectsAddFileFormatSettingsRequest struct { // Defines file format. Format string `json:"format"` // Defines file format settings. Settings FileFormatSettings `json:"settings"` }
ProjectsFileFormatSettingsRequest defines the structure of a request to add a project file format settings.
type ProjectsAddRequest ¶
type ProjectsAddRequest struct { // Project Name. Name string `json:"name"` // Project Identifier. Identifier string `json:"identifier,omitempty"` // Source Language Identifier. SourceLanguageID string `json:"sourceLanguageId"` // Target Languages Identifiers. TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"` // Defines how users can join the project. Enum: open, private. Default: private. // open – anyone can join the project // private – only invited users can join the project Visibility string `json:"visibility,omitempty"` // Defines access to project languages. Enum: open, moderate. Default: open. // open – each project user can access all project languages // moderate – users should join each project language separately LangAccessPolicy string `json:"languageAccessPolicy,omitempty"` // Custom domain name. Cname string `json:"cname,omitempty"` // Project description. Description string `json:"description,omitempty"` // Values available: 0 - Auto, 1 - Count tags, 1 - Skip tags. Default: 0. TagsDetection *int `json:"tagsDetection,omitempty"` // Allows machine translations (Microsoft Translator, Google Translate) be visible // for translators in the Editor. Default: true. IsMTAllowed *bool `json:"isMtAllowed,omitempty"` // Allow project members work with tasks they assigned to, even if they do not have // full access to the language. Default: false. TaskBasedAccessControl *bool `json:"taskBasedAccessControl,omitempty"` // Allows auto-substitution. Default: true. AutoSubstitution *bool `json:"autoSubstitution,omitempty"` // Automatically fill in regional dialects. Default: false. // If true, all untranslated strings in regional dialects (e.g. Argentine Spanish) // will automatically include translations completed in the primary language (e.g. Spanish). AutoTranslateDialects *bool `json:"autoTranslateDialects,omitempty"` // Allows translators to download source files to their machines and upload translations back into the project. // Project owner and managers can always download sources and upload translations. Default: true. PublicDownloads *bool `json:"publicDownloads,omitempty"` // Allows proofreaders to work with hidden strings. // Project owner and managers can always access hidden strings. Default: true. HiddenStringsProofreadersAccess *bool `json:"hiddenStringsProofreadersAccess,omitempty"` // If true - machine translations from connected MT engines (e.g. Microsoft Translator, Google Translate) // will appear as suggestions in the Editor. Default: false. // Note: If your organization plan is free or opensource - default value of this one will be true UseGlobalTM *bool `json:"useGlobalTm,omitempty"` // If true - show primary language TM suggestions for dialects if there are no dialect-specific ones. Default: true. ShowTMSuggestionsDialects *bool `json:"showTmSuggestionsDialects,omitempty"` // Defines whether to skip untranslated strings. SkipUntranslatedStrings *bool `json:"skipUntranslatedStrings,omitempty"` // Defines whether to export only approved strings. ExportApprovedOnly *bool `json:"exportApprovedOnly,omitempty"` // If true - QA checks are active. Default: true. QACheckIsActive *bool `json:"qaCheckIsActive,omitempty"` QACheckCategories map[string]bool `json:"qaCheckCategories,omitempty"` QAChecksIgnorableCategories map[string]bool `json:"qaChecksIgnorableCategories,omitempty"` // Language Mapping. LanguageMapping map[string]map[string]string `json:"languageMapping,omitempty"` // Allow project members to manage glossary terms. // The project owner and managers always can add and edit terms. Default: false. GlossaryAccess *bool `json:"glossaryAccess,omitempty"` // Enable the transformation of the placeholders to the unified format to improve the work with TM suggestions. NormalizePlaceholder *bool `json:"normalizePlaceholder,omitempty"` // Notification Settings. NotificationSettings struct { // Notify translators about new strings. Default: false. TranslatorNewStrings *bool `json:"translatorNewStrings,omitempty"` // Notify project managers about new strings. Default: false. ManagerNewStrings *bool `json:"managerNewStrings,omitempty"` // Notify project managers about language translation/validation completion. Default: false. ManagerLanguageCompleted *bool `json:"managerLanguageCompleted,omitempty"` } `json:"notificationSettings,omitempty"` // TM perfect match searching mode. Enum: "segmentContext" "auto" "prevAndNextSegment". Default: "segmentContext". // segmentContext - searching by context. // auto - context search for key-value formats and segment search for others. // prevAndNextSegment - search by previous and next segment. TMContextType string `json:"tmContextType,omitempty"` TMPreTranslate ProjectTMPreTranslate `json:"tmPreTranslate,omitempty"` MTPreTranslate ProjectMTPreTranslate `json:"mtPreTranslate,omitempty"` // Context and max.length added in Crowdin will be visible in the downloaded files. SaveMetaInfoInSource *bool `json:"saveMetaInfoInSource,omitempty"` // Defines the project type. Use 0 for a file-based project and 1 for a string-based project. // Enum: 0, 1. Default: 0. Type *int `json:"type,omitempty"` // Defines whether to export only translated file. SkipUntranslatedFiles *bool `json:"skipUntranslatedFiles,omitempty"` // Enable In-Context translations. Default: false. // Note: Must be used together with `inContextPseudoLanguageId` InContext *bool `json:"inContext,omitempty"` // Export hidden strings via pseudo-language. Default: true. // Note: If true - hidden strings included in the pseudo-language archive will be translatable via In-Context. InContextProcessHiddenStrings *bool `json:"inContextProcessHiddenStrings,omitempty"` // In-Context pseudo-language id. // Note: Must be different from project source and target languages InContextPseudoLanguageID string `json:"inContextPseudoLanguageId,omitempty"` }
ProjectsAddRequest defines the structure of a request to add a project.
func (*ProjectsAddRequest) Validate ¶
func (r *ProjectsAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type ProjectsFileFormatSettings ¶
type ProjectsFileFormatSettings struct { ID int `json:"id"` Name string `json:"name"` Format string `json:"format"` Extensions []string `json:"extensions"` Settings struct { ContentSegmentation bool `json:"contentSegmentation"` CustomSegmentation bool `json:"customSegmentation"` } `json:"settings"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` }
ProjectsFileFormatSettings represents a Crowdin project file format settings.
type ProjectsFileFormatSettingsListResponse ¶
type ProjectsFileFormatSettingsListResponse struct {
Data []*ProjectsFileFormatSettingsResponse `json:"data"`
}
ProjectsFileFormatSettingsListResponse defines the structure of a response when getting a list of project file format settings.
type ProjectsFileFormatSettingsResponse ¶
type ProjectsFileFormatSettingsResponse struct {
Data *ProjectsFileFormatSettings `json:"data"`
}
ProjectsFileFormatSettingsResponse defines the structure of a response when retrieving a project file format settings.
type ProjectsGetResponse ¶
type ProjectsGetResponse struct {
Data *Project `json:"data"`
}
ProjectGetResponse defines the structure of a response when retrieving a project.
type ProjectsListOptions ¶
type ProjectsListOptions struct { ListOptions // User Identifier. UserID int `json:"userId,omitempty"` // Projects with Manager Access. Enum: 0, 1. Default: 0. HasManagerAccess *int `json:"hasManagerAccess,omitempty"` // Set type to 0 to get all file based projects. Enum: 0, 1. Type *int `json:"type,omitempty"` }
ProjectsListOptions specifies the optional parameters to the ProjectsService.List method.
type ProjectsListResponse ¶
type ProjectsListResponse struct { Data []*ProjectsGetResponse `json:"data"` Pagination *Pagination `json:"pagination"` }
GroupListResponse defines the structure of a response when getting a list of groups.
type ProjectsStringsExporterSettings ¶
type ProjectsStringsExporterSettings struct { ID int `json:"id"` Format string `json:"format"` Settings struct { ConvertPlaceholders bool `json:"convertPlaceholders,omitempty"` LanguagePairMapping map[string]string `json:"languagePairMapping,omitempty"` } `json:"settings"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` }
ProjectsStringsExporterSettings represents a Crowdin project strings exporter settings.
type ProjectsStringsExporterSettingsListResponse ¶
type ProjectsStringsExporterSettingsListResponse struct {
Data []*ProjectsStringsExporterSettingsResponse `json:"data"`
}
ProjectsStringsExporterSettingsListResponse defines the structure of a response when getting a list of project strings exporter settings.
type ProjectsStringsExporterSettingsRequest ¶
type ProjectsStringsExporterSettingsRequest struct { // Defines strings exporter format. Enum: "android", "macosx", "xliff". Format string `json:"format"` // Defines strings exporter settings. Settings struct { // Convert placeholders to MacOSX format. Default: false. // Note: Only for Android and MacOSX formats. ConvertPlaceholders *bool `json:"convertPlaceholders,omitempty"` // Defines language pair mapping the target language for the specified source language. // Note: Only for XLIFF format. LanguagePairMapping map[string]string `json:"languagePairMapping,omitempty"` } `json:"settings"` }
ProjectsStringsExporterSettingsRequest defines the structure of a request to update a project strings exporter settings.
func (*ProjectsStringsExporterSettingsRequest) Validate ¶
func (r *ProjectsStringsExporterSettingsRequest) Validate() error
Validate checks if the update request is valid. It implements the crowdin.RequestValidator interface.
type ProjectsStringsExporterSettingsResponse ¶
type ProjectsStringsExporterSettingsResponse struct {
Data *ProjectsStringsExporterSettings `json:"data"`
}
ProjectsStringsExporterSettingsResponse defines the structure of a response when retrieving a project strings exporter settings.
type PropertyFileExportOptions ¶
type PropertyFileExportOptions struct { // File export pattern. Defines file name and path in resulting translations bundle. // Note: Can't contain : * ? " < > | symbols. ExportPattern string `json:"exportPattern,omitempty"` // Values available: // 0 - Do not escape single quote. // 1 - Escape single quote by another single quote. // 2 - Escape single quote by a backslash. // 3 - Escape single quote by another single quote only in strings containing variables ({0}). EscapeQuotes *int `json:"escapeQuotes,omitempty"` // Defines whether any special characters (=, :, ! and #) should be escaped by // backslash in exported translations. You can add escape_special_characters per-file option. // Acceptable values are: 0, 1. Default is 0. // 0 - Do not escape special characters. // 1 - Escape special characters by a backslash. EscapeSpecialCharacters *int `json:"escapeSpecialCharacters,omitempty"` }
PropertiesFileExportOptions implements the FileExportOptions interface.
func (*PropertyFileExportOptions) ValidateFileExportOptions ¶
func (o *PropertyFileExportOptions) ValidateFileExportOptions() error
type PropertyFileFormatSettings ¶
type PropertyFileFormatSettings struct { // File export pattern. Default: null. // Defines file name and path in resulting translations bundle. // Note: Can't contain : * ? " < > | symbols ExportPattern *string `json:"exportPattern,omitempty"` // Enum: 0, 1, 2, 3. Default: 1. // 0 - Do not escape single quote. // 1 - Escape single quote by another single quote. // 2 - Escape single quote by a backslash. // 3 - Escape single quote by another single quote only in strings containing variables ({0}). EscapeQuotes *int `json:"escapeQuotes,omitempty"` // Enum: 0, 1. Default: 1. // Defines whether any special characters (=, :, ! and #) should be escaped by backslash in exported translations. // You can add escape_special_characters per-file option. * // Acceptable values are: 0, 1. Default is 0. // 0 - Do not escape special characters. // 1 - Escape special characters by a backslash. EscapeSpecialCharacters *int `json:"escapeSpecialCharacters,omitempty"` }
func (*PropertyFileFormatSettings) ValidateSettings ¶
func (p *PropertyFileFormatSettings) ValidateSettings() error
type PseudoBuildProjectRequest ¶
type PseudoBuildProjectRequest struct { // Flag for detecting pseudo translation. Default: false. Pseudo *bool `json:"pseudo"` // Branch Identifier. BranchID int `json:"branchId,omitempty"` // Add special characters at the beginning of each string to show // where messages have been concatenated together. Prefix string `json:"prefix,omitempty"` // Add special characters at the end of each string to show where // messages have been concatenated together. Suffix string `json:"suffix,omitempty"` // Make string larger or shorter. // Acceptable values must be from -50 to 100. Default is 0. LengthTransformation *int `json:"lengthTransformation,omitempty"` // Transforms characters to other languages. // Enum: "asian", "cyrillic", "european", "arabic". CharTransformation string `json:"charTransformation,omitempty"` }
PsuedoBuildProjectRequest defines the structure of a request to build a project with pseudo translations.
func (*PseudoBuildProjectRequest) Validate ¶
func (r *PseudoBuildProjectRequest) Validate() error
Validate checks if the build project request is valid. It implements the crowdin.RequestValidator interface.
func (*PseudoBuildProjectRequest) ValidateBuildRequest ¶
func (r *PseudoBuildProjectRequest) ValidateBuildRequest() error
PseudoBuildProjectRequest implements the BuildProjectTranslationRequest interface.
type QACheck ¶
type QACheck struct { StringID int64 `json:"stringId"` LanguageID string `json:"languageId"` Category string `json:"category"` CategoryDescription string `json:"categoryDescription"` Validation string `json:"validation"` ValidationDescription string `json:"validationDescription"` PluralID int64 `json:"pluralId"` Text string `json:"text"` }
QACheck represents a QA check issue.
type QACheckListOptions ¶
type QACheckListOptions struct { // Defines category of QA check issue. It can be one category or a list of comma-separated ones. // Example: category=variables,tags // Enum: empty, variables, tags, punctuation, symbol_register, spaces, size, special_symbols, // wrong_translation, spellcheck, icu Category string `json:"category,omitempty"` // Defines the QA check issue validation type. It can be one validation type or a list // of comma-separated ones. Example: validation=capitalize_check,punctuation_check // Enum: empty_string_check, empty_suggestion_check, max_length_check, tags_check, // mismatch_ids_check, cdata_check, specials_symbols_check, leading_newlines_check, // trailing_newlines_check, leading_spaces_check, trailing_spaces_check, multiple_spaces_check, // custom_blocked_variables_check, highest_priority_custom_variables_check, // highest_priority_variables_check, c_variables_check, python_variables_check, // rails_variables_check, java_variables_check, dot_net_variables_check, twig_variables_check, // php_variables_check, freemarker_variables_check, lowest_priority_variable_check, // lowest_priority_custom_variables_check, punctuation_check, spaces_before_punctuation_check, // spaces_after_punctuation_check, non_breaking_spaces_check, capitalize_check, // multiple_uppercase_check, parentheses_check, entities_check, escaped_quotes_check, // wrong_translation_issue_check, spellcheck, icu_check Validation string `json:"validation,omitempty"` // Filter progress by Language Identifier. LanguageIDs string `json:"languageIds,omitempty"` ListOptions }
QACheckListOptions specifies the optional parameters to the TranslationStatusService.ListQAChecks method.
type QAChecksResponse ¶
type QAChecksResponse struct { Data []struct { Data *QACheck `json:"data"` } `json:"data"` }
QAChecksResponse defines the structure of a response when getting a list of QA check issues.
type ReactIntlFileFormatSettings ¶
type ReactIntlFileFormatSettings struct{ CommonFileFormatSettings }
type ReviewedBuild ¶
type ReviewedBuild struct { ID int `json:"id"` ProjectID int `json:"projectId"` Status string `json:"status"` Progress int `json:"progress"` Attributes struct { BranchID *int `json:"branchId,omitempty"` TargetLanguageID string `json:"targetLanguageId"` } `json:"attributes"` }
ReviewedBuild represents a reviewed source file build.
type ReviewedBuildListOptions ¶
type ReviewedBuildListOptions struct { // BranchID is the ID of the branch to filter reviewed builds by. BranchID int `json:"branchId,omitempty"` ListOptions }
ReviewedBuildListOptions specifies the optional parameters to the SourceFilesService.ListReviewedBuilds method.
type ReviewedBuildListResponse ¶
type ReviewedBuildListResponse struct {
Data []*ReviewedBuildResponse `json:"data"`
}
ReviewedBuildListResponse describes a response with a list of reviewed builds.
type ReviewedBuildRequest ¶
type ReviewedBuildRequest struct { // Branch Identifier. BranchID int `json:"branchId,omitempty"` }
ReviewedBuildRequest defines the structure of a request to create a new reviewed build.
func (*ReviewedBuildRequest) Validate ¶
func (r *ReviewedBuildRequest) Validate() error
Validate checks if the reviewed build request is valid. It implements the crowdin.RequestValidator interface.
type ReviewedBuildResponse ¶
type ReviewedBuildResponse struct {
Data *ReviewedBuild `json:"data"`
}
ReviewedBuildResponse describes a response with a single reviewed build.
type RevisionInfo ¶
RevisionInfo contains the number of strings and words in a file revision.
type SourceString ¶
type SourceString struct { ID int `json:"id"` ProjectID int `json:"projectId"` BranchID *int `json:"branchId,omitempty"` Identifier string `json:"identifier"` Text string `json:"text"` Type string `json:"type"` Context string `json:"context"` MaxLength int `json:"maxLength"` IsHidden bool `json:"isHidden"` IsDuplicate bool `json:"isDuplicate"` MasterStringID *int `json:"masterStringId,omitempty"` LabelIDs []int `json:"labelIds"` WebURL string `json:"webUrl"` CreatedAt *string `json:"createdAt,omitempty"` UpdatedAt *string `json:"updatedAt,omitempty"` FileID int `json:"fileId"` DirectoryID *int `json:"directoryId,omitempty"` Revision int `json:"revision"` }
SourceString represents the text units for translation.
type SourceStringsAddRequest ¶
type SourceStringsAddRequest struct { // Text for translation. // It can be a string or map of strings. // Example: // "text": "Not all videos are shown to users. See more" // or // "text": { // "one": "string", // "other": "strings" // } Text any `json:"text"` // File identifier. FileID int `json:"fileId"` // Defines unique string identifier. Identifier string `json:"identifier,omitempty"` // Use to provide additional information for better source text understanding. Context string `json:"context,omitempty"` // Defines whether to make string unavailable for translation. Default: false. IsHidden *bool `json:"isHidden,omitempty"` // Max. length of translated text (0 – unlimited). MaxLength *int `json:"maxLength,omitempty"` // Label Identifiers. LabelIDs []int `json:"labelIds,omitempty"` // Fields (enterprises only). Fields map[string]string `json:"fields,omitempty"` }
SourcseStringsAddRequest defines the structure of a request to add a string.
func (*SourceStringsAddRequest) Validate ¶
func (r *SourceStringsAddRequest) Validate() error
Validate checks if the add request is valid. It implements the crowdin.RequestValidator interface.
type SourceStringsGetOptions ¶
type SourceStringsGetOptions struct { // Enable denormalize placeholders. Enum: 0 1. Default: 0. DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"` }
SourceStringsGetOptions specifies the optional parameters to the SourceStringsService.Get method.
type SourceStringsGetResponse ¶
type SourceStringsGetResponse struct {
Data *SourceString `json:"data"`
}
SourceStringsGetResponse describes the response when getting a source string.
type SourceStringsImportOptions ¶
type SourceStringsImportOptions struct { // Defines whether the file includes a first-row header that should // not be imported. Default: false. FirstLineContainsHeader *bool `json:"firstLineContainsHeader,omitempty"` // Defines whether to import translations from the file. Default: false. ImportTranslations *bool `json:"importTranslations,omitempty"` // Defines data columns mapping. The key is the column name and the value // is the column index. The column numbering starts at 0. Scheme map[string]int `json:"scheme,omitempty"` }
SourceStringsImportOptions defines the options for importing strings.
type SourceStringsListOptions ¶
type SourceStringsListOptions struct { // Enable denormalize placeholders. Enum: 0 1. Default: 0. DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"` // Filter strings by labelIds (Label Identifiers). // Example: labelIds=1,2,3,4,5. LabelIDs []string `json:"labelIds,omitempty"` // File Identifier. // Note: Can't be used with `directoryId` or `branchId` in same request. FileID int `json:"fileId,omitempty"` // Branch Identifier. // Note: Can't be used with `fileId` or `directoryId` in the same request. BranchID int `json:"branchId,omitempty"` // Directory Identifier. // Note: Can't be used with `fileId` or `branchId` in same request. DirectoryID int `json:"directoryId,omitempty"` // Filter strings by CroQL. // Note: Can be used only with `denormalizePlaceholders`, `offset` and // `limit` in same request. CroQL string `json:"croql,omitempty"` // Filter strings by `identifier`, `text` or `context`. Filter string `json:"filter,omitempty"` // Specify field to be the target of filtering. It can be one scope or // a list of comma-separated scopes. Enum: "identifier" "text" "context". Scope string `json:"scope,omitempty"` ListOptions }
SourceStringsListOptions specifies the optional parameters to the SourceStringsService.List method.
type SourceStringsListResponse ¶
type SourceStringsListResponse struct {
Data []*SourceStringsGetResponse `json:"data"`
}
SourceStringsListResponse describes the response when getting a list of source strings.
type SourceStringsUpload ¶
type SourceStringsUpload struct { Identifier string `json:"identifier"` Status string `json:"status"` Progress int `json:"progress"` Attributes struct { BranchID int `json:"branchId"` SotrageID int `json:"storageId"` FileType string `json:"fileType"` ParserVersion int `json:"parserVersion"` LabelIDs []int `json:"labelIds"` ImportOptions struct { FirstLineContainsHeader bool `json:"firstLineContainsHeader"` ImportTranslations bool `json:"importTranslations"` Scheme map[string]int `json:"scheme"` } `json:"importOptions"` UpdateStrings bool `json:"updateStrings"` CleanupMode bool `json:"cleanupMode"` } `json:"attributes"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` StartedAt string `json:"startedAt"` FinishedAt string `json:"finishedAt"` }
SourceStringsService represents the upload strings status.
type SourceStringsUploadRequest ¶
type SourceStringsUploadRequest struct { // Storage Identifier. StorageID int `json:"storageId"` // Branch Identifier. // Defines branch to which file will be added. BranchID int `json:"branchId"` // Default: auto // Enum: auto, android, macosx, arb, csv, json, xlsx, xliff, xliff_two // - empty value or `auto` — Try to detect file type by extension or MIME type // - `android` — Android (*.xml) // - `macosx` — Mac OS X / iOS (*.strings) // - `arb` — Application Resource Bundle (*.arb) // - `csv` — Comma Separated Values (*.csv) // - `json` — Generic JSON (*.json) // - `xliff` — XLIFF (*.xliff, *.xlf) // - `xliff_two` — XLIFF 2.0 (*.xliff, *.xlf) // - `xlsx` — Microsoft Excel (*.xlsx) Type string `json:"type,omitempty"` // Using latest parser version by default. // Note: Must be used together with `type`. ParserVersion int `json:"parserVersion,omitempty"` // Attach labels to strings. LabelIDs []int `json:"labelIds,omitempty"` // Update strings that have the same keys. Default: false. UpdateStrings *bool `json:"updateStrings,omitempty"` // If true, all strings with a system label that do not exist in the file // will be deleted. Default: false. CleanupMode *bool `json:"cleanupMode,omitempty"` // Options for importing strings. ImportOptions *SourceStringsImportOptions `json:"importOptions,omitempty"` }
SourceStringsUploadRequest defines the structure of a request to upload strings.
func (*SourceStringsUploadRequest) Validate ¶
func (o *SourceStringsUploadRequest) Validate() error
Validate checks if the upload request is valid. It implements the crowdin.RequestValidator interface.
type SourceStringsUploadResponse ¶
type SourceStringsUploadResponse struct {
Data *SourceStringsUpload `json:"data"`
}
SourceStringsUploadResponse defines the response when uploading strings.
type SpreadsheetFileImportOptions ¶
type SpreadsheetFileImportOptions struct { // Defines whether the file includes a first-row header that should not be imported. // Default: false. FirstLineContainsHeader *bool `json:"firstLineContainsHeader,omitempty"` // Defines whether hidden sheets that should be imported. Default: true. ImportHiddenSheets *bool `json:"importHiddenSheets,omitempty"` // Defines whether to import translations from the file. Default: false. ImportTranslations *bool `json:"importTranslations,omitempty"` // Defines data columns mapping. The column numbering starts at 0. // Acceptable values are: none, identifier, sourcePhrase, sourceOrTranslation, // translation, context, maxLength, labels and specified languages (ex. "en", "uk"). Scheme map[string]int `json:"scheme,omitempty"` // Important: ContentSegmentation option disables the possibility to upload existing translations // for Spreadsheet files when enabled. CommonFileImportOptions }
SpreadsheetsFileImportOptions implements the FileImportOptions interface.
type StorageGetResponse ¶
type StorageGetResponse struct {
Data *Storage `json:"data"`
}
StorageGetResponse defines the structure of a response when retrieving a storage.
type StorageListResponse ¶
type StorageListResponse struct { Data []*StorageGetResponse `json:"data"` Pagination *Pagination `json:"pagination"` }
StorageListResponse defines the structure of a response when getting a list of storages.
type StringCanalogFileFormatSettings ¶
type StringCanalogFileFormatSettings struct { // Determines whether to import the key as source string if it does not exist. // Default: false. ImportKeyAsSource *bool `json:"importKeyAsSource,omitempty"` // File format export pattern. Defines file name and path in resulting translations bundle. // Default: null. Can't contain : * ? " < > | symbols. ExportPattern *string `json:"exportPattern,omitempty"` }
func (*StringCanalogFileFormatSettings) ValidateSettings ¶
func (p *StringCanalogFileFormatSettings) ValidateSettings() error
type StringCatalogFileImportOptions ¶
type StringCatalogFileImportOptions struct { // Determines whether to import the key as source string if it does not exist. // Default: false. ImportKeyAsSource *bool `json:"importKeyAsSource,omitempty"` }
StringCatalogFileImportOptions implements the FileImportOptions interface.
func (*StringCatalogFileImportOptions) ValidateFileImportOptions ¶
func (o *StringCatalogFileImportOptions) ValidateFileImportOptions() error
type StringTranslationsListOptions ¶
type StringTranslationsListOptions struct { // String Identifier. // Note: Must be used together with `languageId`. StringID int `json:"stringId,omitempty"` // Language Identifier. // Note: Must be used together with `stringId`. LanguageID string `json:"languageId,omitempty"` // Denormalize Placeholders. // Enum: 0, 1. Default: 0. DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"` ListOptions }
StringTranslationsListOptions specifies the optional parameters to the StringTranslationsService.ListTranslations method.
type TXTFileFormatSettings ¶
type TXTFileFormatSettings struct { // Storage identifier of the SRX segmentation rules file. Default: null. SRXStorageID *int `json:"srxStorageId,omitempty"` // File format export pattern. Defines file name and path in resulting // translations bundle. // Default: null. Note: Can't contain : * ? " < > | symbols ExportPattern *string `json:"exportPattern,omitempty"` }
func (*TXTFileFormatSettings) ValidateSettings ¶
func (p *TXTFileFormatSettings) ValidateSettings() error
type Translation ¶
type Translation struct { ID int `json:"id"` Text string `json:"text"` PluralCategoryName string `json:"pluralCategoryName"` User User `json:"user"` Rating int `json:"rating"` Provider *string `json:"provider,omitempty"` IsPreTranslated bool `json:"isPreTranslated"` CreatedAt string `json:"createdAt"` }
Translation represents a Crowdin translation.
type TranslationAddRequest ¶
type TranslationAddRequest struct { // String Identifier. // Note: Must be used together with `languageId`. StringID int `json:"stringId"` // Language Identifier. // Note: Must be used together with `stringId`. LanguageID string `json:"languageId"` // Translation text. Text string `json:"text"` // Plural form. Enum: zero, one, two, few, many, and other. // Note: Will be saved only if the source string has plurals and `pluralCategoryName` // is equal to the one available for the language you add translations to. PluralCategoryName string `json:"pluralCategoryName,omitempty"` }
TranslationAddRequest defines the structure of the request to add a translation.
func (*TranslationAddRequest) Validate ¶
func (r *TranslationAddRequest) Validate() error
Validate checks if the TranslationAddRequest is valid. It implements the crowdin.RequestValidator interface.
type TranslationAlignment ¶
type TranslationAlignment struct {
Words []*WordAlignment `json:"words"`
}
TranslationAlignment represents a translation alignment.
type TranslationAlignmentRequest ¶
type TranslationAlignmentRequest struct { // Source Language Identifier. SourceLanguageID string `json:"sourceLanguageId"` // Target Language Identifier. TargetLanguageID string `json:"targetLanguageId"` // Text for alignment. Text string `json:"text"` }
TranslationAlignmentRequest defines the structure of the request to align translations.
func (*TranslationAlignmentRequest) Validate ¶
func (r *TranslationAlignmentRequest) Validate() error
Validate checks if the TranslationAlignmentRequest is valid. It implements the crowdin.RequestValidator interface.
type TranslationAlignmentResponse ¶
type TranslationAlignmentResponse struct {
Data *TranslationAlignment `json:"data"`
}
TranslationAlignmentResponse defines the structure of the response when aligning translations.
type TranslationGetOptions ¶
type TranslationGetOptions struct { // Enable denormalize placeholders. // Enum: 0, 1. Default: 0. DenormalizePlaceholders *int `json:"denormalizePlaceholders,omitempty"` }
TranslationGetOptions specifies the optional parameters to the StringTranslationsService.GetTranslation method.
type TranslationGetResponse ¶
type TranslationGetResponse struct {
Data *Translation `json:"data"`
}
TranslationGetResponse defines the structure of the response when getting a single translation.
type TranslationProgress ¶
type TranslationProgress struct { Words map[string]int64 `json:"words"` Phrases map[string]int64 `json:"phrases"` TranslationProgress int64 `json:"translationProgress"` ApprovalProgress int64 `json:"approvalProgress"` LanguageID *string `json:"languageId,omitempty"` BranchID *int64 `json:"branchId,omitempty"` FileID *int64 `json:"fileId,omitempty"` Language *Language `json:"language,omitempty"` Etag *string `json:"etag,omitempty"` }
TranslationProgress defines the structure of a translations status progress.
type TranslationProgressResponse ¶
type TranslationProgressResponse struct { Data []struct { Data *TranslationProgress `json:"data"` } `json:"data"` }
TranslationStatusProgressResponse defines the structure of a response when getting a translation status progress (for a branch, directory, file, language or project).
type TranslationsBuildsListOptions ¶
type TranslationsBuildsListOptions struct { ListOptions // Branch Identifier. Filter builds by branchId. BranchID int `url:"branchId,omitempty"` }
TranslationsBuildsListOptions specifies the optional parameters to the TranslationsService.ListProjectBuilds method.
type TranslationsListResponse ¶
type TranslationsListResponse struct {
Data []*TranslationGetResponse `json:"data"`
}
TranslationsListResponse defines the structure of the response when getting a list of translations.
type TranslationsProjectBuild ¶
type TranslationsProjectBuild struct { ID int `json:"id"` ProjectID int `json:"projectId"` Status string `json:"status"` Progress int `json:"progress"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` FinishedAt string `json:"finishedAt,omitempty"` Attributes struct { BranchID *int `json:"branchId,omitempty"` DirectoryID *int `json:"directoryId,omitempty"` TargetLanguageIDs []string `json:"targetLanguageIds,omitempty"` SkipUntranslatedStrings bool `json:"skipUntranslatedStrings,omitempty"` SkipUntranslatedFiles bool `json:"skipUntranslatedFiles,omitempty"` ExportApprovedOnly bool `json:"exportApprovedOnly,omitempty"` } `json:"attributes,omitempty"` }
TranslationsProjectBuild represents a project build.
type TranslationsProjectBuildResponse ¶
type TranslationsProjectBuildResponse struct {
Data *TranslationsProjectBuild `json:"data"`
}
TranslationsProjectBuildResponse defines the structure of a response when getting a project build.
type TranslationsProjectBuildsListResponse ¶
type TranslationsProjectBuildsListResponse struct { Data []*TranslationsProjectBuildResponse `json:"data"` Pagination *Pagination `json:"pagination"` }
TranslationsProjectBuildsListResponse defines the structure of a response when getting a list of project builds.
type UpdateRequest ¶
type UpdateRequest struct { // Patch operation to perform. Op PatchOp `json:"op"` // A JSON Pointer as defined by RFC 6901. Path string `json:"path"` // Value must be one of boolean, integer, string, array of strings, // array of integers or map. Value any `json:"value,omitempty"` }
UpdateRequest defines the structure of a request to update a resource.
func (*UpdateRequest) Validate ¶
func (r *UpdateRequest) Validate() error
Validate checks if the update request is valid. It implements the crowdin.RequestValidator interface.
type UploadTranslations ¶
type UploadTranslations struct { ProjectID int `json:"projectId"` StorageID int `json:"storageId"` LanguageID string `json:"languageId"` FileID int `json:"fileId"` }
UploadTranslations represents the uploaded translations.
type UploadTranslationsRequest ¶
type UploadTranslationsRequest struct { // Storage Identifier. StorageID int `json:"storageId"` // File Identifier for import. // Note: Required for content in all formats except XLIFF. FileID int `json:"fileId,omitempty"` // Branch Identifier for import. // Note: Required for string based API. BranchID int `json:"branchId,omitempty"` // Defines whether to add translation if it's the same as the source string. // Default: false. ImportEqSuggestions *bool `json:"importEqSuggestions,omitempty"` // Mark uploaded translations as approved. Default: false. AutoApproveImported *bool `json:"autoApproveImported,omitempty"` // Allow translations upload to hidden source strings. Default: false. TranslateHidden *bool `json:"translateHidden,omitempty"` }
UploadTranslationsRequest defines the structure of a request to upload translations.
func (*UploadTranslationsRequest) Validate ¶
func (r *UploadTranslationsRequest) Validate() error
Validate checks if the upload translations request is valid. It implements the crowdin.RequestValidator interface.
type UploadTranslationsResponse ¶
type UploadTranslationsResponse struct {
Data *UploadTranslations `json:"data"`
}
UploadTranslationsResponse defines the structure of a response when uploading translations.
type ValidationError ¶
type ValidationError struct { Error struct { Key string `json:"key"` Errors []struct { Code string `json:"code"` Message string `json:"message"` } `json:"errors"` } `json:"error"` }
ValidationError represents the schema for the invalid request error response.
type ValidationErrorResponse ¶
type ValidationErrorResponse struct { Response *http.Response `json:"-"` Errors []ValidationError `json:"errors"` Status int }
ValidationErrorResponse is the validation error response structure from the API.
func (*ValidationErrorResponse) Error ¶
func (r *ValidationErrorResponse) Error() string
Error implements the Error interface.
type Vote ¶
type Vote struct { ID int `json:"id"` User User `json:"user"` TranslationID int `json:"translationId"` VotedAt string `json:"votedAt"` Mark string `json:"mark"` }
Vote represents a Crowdin translation vote.
type VoteAddRequest ¶
type VoteAddRequest struct { // Enum: up, down. Mark VoteType `json:"mark"` // Translation Identifier. TranslationID int `json:"translationId"` }
VoteAddRequest defines the structure of the request to add a translation vote.
func (*VoteAddRequest) Validate ¶
func (r *VoteAddRequest) Validate() error
Validate checks if the VotesAddRequest is valid. It implements the crowdin.RequestValidator interface.
type VoteGetResponse ¶
type VoteGetResponse struct {
Data *Vote `json:"data"`
}
VoteGetResponse defines the structure of the response when getting a single translation vote.
type VotesListOptions ¶
type VotesListOptions struct { // String Identifier. // Note: Must be used together with `languageId`. StringID int `json:"stringId,omitempty"` // Language Identifier. // Note: Must be used together with `stringId`. LanguageID string `json:"languageId,omitempty"` // Translation Identifier. // Note: If specified, `stringId` and `languageId` are ignored. TranslationID int `json:"translationId,omitempty"` // File Identifier. // Note: Must be used together with `languageId`. FileID int `json:"fileId,omitempty"` // Label Identifiers. // Example: labelIds=1,2,3,4,5 LabelIDs []int `json:"labelIds,omitempty"` // Exclude Label Identifiers. EcludeLabelIDs []int `json:"excludeLabelIds,omitempty"` ListOptions }
VotesListOptions specifies the optional parameters to the StringTranslationsService.ListVotes method.
type VotesListResponse ¶
type VotesListResponse struct {
Data []*VoteGetResponse `json:"data"`
}
VotesListResponse defines the structure of the response when getting a list of translation votes.
type WebXMLFileFormatSettings ¶
type WebXMLFileFormatSettings struct{ CommonFileFormatSettings }
type WordAlignment ¶
WordAlignment represents a word alignments.
type XLSXFileFormatSettings ¶
type XLSXFileFormatSettings struct{ CommonFileFormatSettings }
type XMLFileFormatSettings ¶
type XMLFileFormatSettings struct { // Defines whether to translate texts placed inside the tags. Default: true. TranslateContent *bool `json:"translateContent,omitempty"` // Defines whether to translate tags attributes. Default: true. TranslateAttributes *bool `json:"translateAttributes,omitempty"` // This is an array of strings, where each item is the XPaths to DOM element // that should be imported. Default: []. Enum: "/path/to/node", "/path/to/attribute[@attr]", // "//node", "//[@attr]", "nodeone/nodetwo", "/nodeone//nodetwo", "//node[@attr]" TranslatableElements []string `json:"translatableElements,omitempty"` // Defines whether to split long texts into smaller text segments. Default: true. // Important! This option disables the possibility to upload existing translations for XML files when enabled. ContentSegmentation *bool `json:"contentSegmentation,omitempty"` // Storage Identifier of the SRX segmentation rules file. Default: null. SRXStorageID *int `json:"srxStorageId,omitempty"` // File format export pattern. Defines file name and path in resulting translations bundle. // Default: null. Note: Can't contain : * ? " < > | symbols. ExportPattern *string `json:"exportPattern,omitempty"` }
func (*XMLFileFormatSettings) ValidateSettings ¶
func (p *XMLFileFormatSettings) ValidateSettings() error
type XMLFileImportOptions ¶
type XMLFileImportOptions struct { // Defines whether to translate texts placed inside the tags. Default: true. TranslateContent *bool `json:"translateContent,omitempty"` // Defines whether to translate tags attributes. Default: true. TranslateAttributes *bool `json:"translateAttributes,omitempty"` // This is an array of strings, where each item is the XPaths to DOM element that should be imported. TranslatableElements []string `json:"translatableElements,omitempty"` // Important: ContentSegmentation option disables the possibility to upload existing translations // for XML files when enabled. CommonFileImportOptions }
XMLFileImportOptions implements the FileImportOptions interface.