modulepackage
0.0.0-20200120112509-87f417ee48b1
Repository: https://github.com/melsoft-games/go-crowdin.git
Documentation: pkg.go.dev
# README
go-crowdin
Crowdin API in Go - https://crowdin.com/page/api
Install
go get github.com/medisafe/go-crowdin
Initialize
api := crowdin.New("token", "project-name")
API
:blue_book: 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)
Author
Roman Kushnarenko - sromku
License
Apache License 2.0
# Functions
New - create new instance of Crowdin API.
# Structs
AccountDetails is a response struct.
AddFileOptions used for AddFile() API call.
APIError holds data of errors returned from the API.
ChangeDirectoryOptions are options for ChangeDirectory api call.
CreateProjectOptions are options for CreateProject api call.
Crowdin API wrapper.
DownloadOptions are options for DownloadTranslations api call.
EditProjectOptions are options for EditProject api call.
ExportFileOptions are options for ExportFile api call.
ExportStatus is a response struct.
ProjectInfo is a response struct.
TranslationStatus is a response struct.
UpdateFileOptions used for UpdateFile() API call.
UploadTranslationsOptions are options for UploadTranslations api call.