transifex

package
v0.0.0-...-353bbc6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const ApiUrl = "https://www.transifex.com/api/2"
View Source
const KeyValueJson = "KEYVALUEJSON"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResource

type BaseResource struct {
	Slug     string `json:"slug"`
	Name     string `json:"name"`
	I18nType string `json:"i18n_type"`
	Priority string `json:"priority"`
	Category string `json:"category"`
}

type Client

type Client struct {
	Project Project
	// contains filtered or unexported fields
}

func NewClient

func NewClient(project Project, username, password string) Client

func (Client) CreateResource

func (c Client) CreateResource(newResource UploadResourceRequest) (*Response, error)

func (Client) DownloadTranslations

func (c Client) DownloadTranslations(slug string) (map[string]string, error)

func (Client) Languages

func (c Client) Languages() ([]Language, error)

func (Client) ListResources

func (c Client) ListResources() ([]Resource, error)

func (*Client) RateLimit

func (c *Client) RateLimit(t time.Duration, requests int)

func (Client) SourceLanguage

func (c Client) SourceLanguage() (string, error)

func (Client) UpdateResourceContent

func (c Client) UpdateResourceContent(slug, content string) (*Response, error)

func (Client) UploadTranslationFile

func (c Client) UploadTranslationFile(slug, langCode, content string) (*Response, error)

func (Client) ValidateConfiguration

func (c Client) ValidateConfiguration() error

type Language

type Language struct {
	Coordinators []string `json:"coordinators"`
	LanguageCode string   `json:"language_code"`
	Translators  []string `json:"translators"`
	Reviewers    []string `json:"reviewers"`
}

type Project

type Project string

type Resource

type Resource struct {
	BaseResource
	SourceLanguage string `json:"source_language_code"`
}

type Response

type Response struct {
	Added   int `json:"strings_added"`
	Updated int `json:"strings_updated"`
	Deleted int `json:"strings_delete"`
}

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(raw []byte) error

type UploadResourceRequest

type UploadResourceRequest struct {
	BaseResource
	Content             string `json:"content"`
	Accept_translations string `json:"accept_translations"`
}

Jump to

Keyboard shortcuts

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