Go utils for working with OneSky translation service.
$ go get github.com/SebastianCzoch/onesky-go
or via Godep
$ godep get github.com/SebastianCzoch/onesky-go
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
fmt.Println(onesky.DownloadFile("filename", "locale"))
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
_, err := onesky.UploadFile("messages.yml", "YAML", "en-US", true)
if err != nil {
fmt.Println("Can not upload file")
}
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
err := onesky.DeleteFile("messages.yml")
if err != nil {
fmt.Println("Can not delete file")
}
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
list, err := onesky.ListFiles(1, 100)
if err != nil {
fmt.Println("Can not download list of uploaded files")
}
fmt.Println(list)
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
list, err := onesky.ImportTasks(map[string]interface{}{
"per_page": 50,
"status": "completed", // all, completed, in-progress, failed
})
if err != nil {
fmt.Println("Can not download list of import tasks")
}
fmt.Println(list)
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
task, err := onesky.ImportTask(773572) // import id
if err != nil {
fmt.Println(err)
}
fmt.Println(task)
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
status, err := onesky.GetTranslationsStatus("string.po", "ja-JP")
if err != nil {
fmt.Println(err)
}
fmt.Println(status)
}
package main
import (
"fmt"
"github.com/SebastianCzoch/onesky-go"
)
func main() {
onesky := onesky.Client{APIKey: "abcdef", Secret: "abcdef", ProjectID: 1}
languages, err := onesky.GetLanguages()
if err != nil {
fmt.Println("Can not get languages")
}
fmt.Println(languages)
}
Downloads translation file from OneSky.
Returns file content via string.
Upload translation file to OneSky.
file
should be a full path to file
Permanently remove file from OneSky service (with translations)!
Get informations about files uploaded to OneSky
List import tasks. (Default params: {"page": 1, "per_page": 50, "status": "all"}
)
Show an import task.
Shows a project's translations status.
Get informations about available languages in project
$ go test ./...
Issues for this project should be reported on GitHub issues