agilebits / go-crowdin

Crowdin API in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-crowdin

Crowdin API in Go - https://crowdin.com/page/api

Go Report Card Documentation

Install

go get github.com/medisafe/go-crowdin

Initialize
api := crowdin.New("token", "project-name")
API

📘 Check the doc - Documentation

Examples:

// get language status
files, err := api.GetLanguageStatus("ru")

// add file
result, err := api.AddFile(&crowdin.AddFileOptions{
    Type: "csv",
    Scheme: "identifier,source_or_translation,context",
    FirstLineContainsHeader: true,
    Files: map[string]string{
        "strings_profile_section.csv" : "local/path/to/strings_profile_section.csv",
    },
})
Debug

You can print the internal errors by enabling debug to true

api.SetDebug(true, nil)

You can also define your own io.Writer in case you want to persist the logs somewhere. For example keeping the errors on file

logFile, err := os.Create("crowdin.log")
api.SetDebug(true, logFile)
App Engine

Initialize app engine client and continue as usual

c := appengine.NewContext(r)
client := urlfetch.Client(c)

api := crowdin.New("token", "project-name")
api.SetClient(client)

Documentation

Author

Roman Kushnarenko - sromku

License

Apache License 2.0

About

Crowdin API in Go

License:Apache License 2.0


Languages

Language:Go 100.0%