txapi

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLanguageDirectory

func CreateLanguageDirectory(
	languageMappings map[string]string,
	txLanguageCode string,
	cfgResource *config.Resource,
) (string, string)

func CreateResource

func CreateResource(
	api *jsonapi.Connection, project *jsonapi.Resource,
	resourceName, resourceSlug, Type string,
) (*jsonapi.Resource, error)

func CreateResourceStringsAsyncDownload

func CreateResourceStringsAsyncDownload(
	api *jsonapi.Connection, arguments CreateResourceStringDownloadArguments,
) (*jsonapi.Resource, error)

func CreateTranslationsAsyncDownload

func CreateTranslationsAsyncDownload(api *jsonapi.Connection,
	arguments CreateDownloadArguments) (*jsonapi.Resource, error)

func DeleteResource added in v0.0.2

func DeleteResource(
	api *jsonapi.Connection, resource *jsonapi.Resource,
) error

func GetI18nFormats

func GetI18nFormats(
	api *jsonapi.Connection, organization *jsonapi.Resource,
) ([]*jsonapi.Resource, error)

func GetLanguage

func GetLanguage(
	api *jsonapi.Connection, code string,
) (*jsonapi.Resource, error)

func GetLanguages

func GetLanguages(
	api *jsonapi.Connection,
) (map[string]*jsonapi.Resource, error)

func GetOrganization

func GetOrganization(
	api *jsonapi.Connection, organizationSlug string,
) (*jsonapi.Resource, error)

func GetOrganizations

func GetOrganizations(api *jsonapi.Connection) (
	[]*jsonapi.Resource, error,
)

func GetProject

func GetProject(
	api *jsonapi.Connection,
	organization *jsonapi.Resource,
	projectSlug string,
) (*jsonapi.Resource, error)

func GetProjectLanguages

func GetProjectLanguages(
	project *jsonapi.Resource,
) (map[string]*jsonapi.Resource, error)

func GetProjects

func GetProjects(
	api *jsonapi.Connection, organization *jsonapi.Resource,
) ([]*jsonapi.Resource, error)

func GetResource

func GetResource(
	api *jsonapi.Connection, project *jsonapi.Resource, resourceSlug string,
) (*jsonapi.Resource, error)

func GetResourceStats

func GetResourceStats(
	api *jsonapi.Connection, resource, language *jsonapi.Resource,
) (map[string]*jsonapi.Resource, error)

func GetResources

func GetResources(
	api *jsonapi.Connection, project *jsonapi.Resource,
) ([]*jsonapi.Resource, error)

func PollResourceStringsDownload

func PollResourceStringsDownload(
	download *jsonapi.Resource,
	duration time.Duration,
	cfgResource *config.Resource,
	fileType string) error

func PollSourceUpload

func PollSourceUpload(upload *jsonapi.Resource, duration time.Duration) error

func PollTranslationDownload

func PollTranslationDownload(languageMappings map[string]string,
	download *jsonapi.Resource,
	duration time.Duration,
	cfgResource *config.Resource,
	fileType string) error

func PollTranslationUpload

func PollTranslationUpload(
	upload *jsonapi.Resource, duration time.Duration,
) error

func UploadSource

func UploadSource(
	api *jsonapi.Connection, resource *jsonapi.Resource, file io.Reader,
) (*jsonapi.Resource, error)

func UploadTranslation

func UploadTranslation(
	api *jsonapi.Connection,
	resource,
	language *jsonapi.Resource,
	file io.Reader,
	xliff bool,
) (*jsonapi.Resource, error)

Types

type CreateDownloadArguments

type CreateDownloadArguments struct {
	OrganizationSlug string
	ProjectSlug      string
	ResourceSlug     string
	Resource         *jsonapi.Resource
	Language         *jsonapi.Resource
	FileType         string
	Mode             string
	ContentEncoding  string
}

type CreateResourceStringDownloadArguments

type CreateResourceStringDownloadArguments struct {
	OrganizationSlug string
	ProjectSlug      string
	ResourceSlug     string
	Resource         *jsonapi.Resource
	FileType         string
	ContentEncoding  string
}

type I18nFormatsAttributes

type I18nFormatsAttributes struct {
	Description    string   `json:"description"`
	FileExtensions []string `json:"file_extensions"`
	MediaType      string   `json:"media_type"`
	Name           string   `json:"name"`
}

type LanguageAttributes

type LanguageAttributes struct {
	Code           string `json:"code"`
	Name           string `json:"name"`
	PluralEquation string `json:"plural_equation"`
	PluralRules    struct {
		Zero  string `json:"zero"`
		One   string `json:"one"`
		Two   string `json:"two"`
		Few   string `json:"few"`
		Many  string `json:"many"`
		Other string `json:"other"`
	} `json:"plural_rules"`
	Rtl bool `json:"rtl"`
}

type OrganizationAttributes

type OrganizationAttributes struct {
	LogoUrl string `json:"logo_url"`
	Name    string `json:"name"`
	Private bool   `json:"private"`
	Slug    string `json:"slug"`
}

type ProjectAttributes

type ProjectAttributes struct {
	Archived        bool     `json:"archived"`
	Created         string   `json:"datetime_created"`
	Modified        string   `json:"datetime_modified"`
	Description     string   `json:"description"`
	HomepageURL     string   `json:"homepage_url"`
	InstructionsURL string   `json:"instructions_url"`
	License         string   `json:"license"`
	LongDescription string   `json:"long_description"`
	Name            string   `json:"name"`
	Private         bool     `json:"private"`
	RepositoryURL   string   `json:"repository_url"`
	Slug            string   `json:"slug"`
	Tags            []string `json:"tags"`
	TMFillup        bool     `json:"translation_memory_fillup"`
	Type            string   `json:"type"`
}

type ResourceAttributes

type ResourceAttributes struct {
	AcceptTranslation bool     `json:"accept_translations"`
	Categories        []string `json:"categories"`
	DatetimeCreated   string   `json:"datetime_created"`
	DatetimeModified  string   `json:"datetime_modified"`
	I18nOptions       struct {
		AllowDuplicateStrings bool `json:"allow_duplicate_strings"`
	} `json:"i18n_options"`
	I18nVersion int    `json:"i18n_version"`
	Mp4Url      string `json:"mp4_url"`
	Name        string `json:"name"`
	OggUrl      string `json:"ogg_url"`
	Priority    string `json:"priority"`
	Slug        string `json:"slug"`
	StringCount int    `json:"string_count"`
	WebmUrl     string `json:"webm_url"`
	WordCount   int    `json:"word_count"`
	YoutubeUrl  string `json:"youtube_url"`
}

type ResourceLanguageStatsAttributes

type ResourceLanguageStatsAttributes struct {
	LastProofreadUpdate   string `json:"last_proofread_update"`
	LastReviewUpdate      string `json:"last_review_update"`
	LastTranslationUpdate string `json:"last_translation_update"`
	LastUpdate            string `json:"last_update"`
	ProofreadStrings      int    `json:"proofread_strings"`
	ProofreadWords        int    `json:"proofread_words"`
	ReviewedStrings       int    `json:"reviewed_strings"`
	ReviewedWords         int    `json:"reviewed_words"`
	TotalStrings          int    `json:"total_strings"`
	TotalWords            int    `json:"total_words"`
	TranslatedStrings     int    `json:"translated_strings"`
	TranslatedWords       int    `json:"translated_words"`
	UntranslatedStrings   int    `json:"untranslated_strings"`
	UntranslatedWords     int    `json:"untranslated_words"`
}

type ResourceStringAsyncUploadAttributes

type ResourceStringAsyncUploadAttributes struct {
	DateCreated  string `json:"date_created"`
	DateModified string `json:"date_modified"`
	Status       string `json:"status"`
	Details      struct {
		StringsCreated int `json:"strings_created"`
		StringsDeleted int `json:"strings_deleted"`
		StringsSkipped int `json:"strings_skipped"`
		StringsUpdated int `json:"strings_updated"`
	} `json:"details"`
	Errors []struct {
		Code   string `json:"code"`
		Detail string `json:"detail"`
	} `json:"errors"`
}

func (*ResourceStringAsyncUploadAttributes) Error

type ResourceStringsAsyncDownloadAttributes

type ResourceStringsAsyncDownloadAttributes struct {
	ContentEncoding string `json:"content_encoding"`
	FileType        string `json:"file_type"`
	Pseudo          bool   `json:"pseudo"`
}

type ResourceTranslationsAsyncDownloadAttributes

type ResourceTranslationsAsyncDownloadAttributes struct {
	ContentEncoding string `json:"content_encoding"`
	FileType        string `json:"file_type"`
	Pseudo          bool   `json:"pseudo"`
	Mode            string `json:"mode"`
}

type ResourceTranslationsAsyncUploadAttributes

type ResourceTranslationsAsyncUploadAttributes struct {
	DateCreated  string `json:"date_created"`
	DateModified string `json:"date_modified"`
	Status       string `json:"status"`
	Details      struct {
		TranslationsCreated int `json:"translations_created"`
		TranslationsUpdated int `json:"translations_updated"`
	} `json:"details"`
	Errors []struct {
		Code   string `json:"code"`
		Detail string `json:"detail"`
	} `json:"errors"`
}

func (*ResourceTranslationsAsyncUploadAttributes) Error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL