Skip to content

Commit

Permalink
feat: Update Lokalise API package to version 4
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyLV committed May 20, 2024
1 parent 4ee9533 commit 3ab9a15
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cmd/branch.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/comment.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/contributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"encoding/json"
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sync"
"time"

"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"encoding/json"
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/language.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/order.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/paymentcard.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"encoding/json"
"fmt"
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"os"

"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/spf13/pflag"
Expand Down
2 changes: 1 addition & 1 deletion cmd/screenshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"os"

"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/snapshot.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
7 changes: 3 additions & 4 deletions cmd/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"encoding/json"
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -35,8 +35,8 @@ var taskListCmd = &cobra.Command{
RunE: func(*cobra.Command, []string) error {
t := Api.Tasks()
pageOpts := lokalise.TaskListOptions{
Title: filterTitle,
Limit: t.ListOpts().Limit,
FilterTitle: filterTitle,
Limit: t.ListOpts().Limit,
}

return repeatableList(
Expand Down Expand Up @@ -137,7 +137,6 @@ func init() {
_ = taskCreateCmd.MarkFlagRequired("languages")
fs.BoolVar(&autoCloseLang, "auto-close-languages", true, "Whether languages should be closed automatically upon completion of the last item (default true). Use --auto-close-languages=false to disable.")
fs.BoolVar(&autoCloseTask, "auto-close-task", true, "Whether the task should be automatically closed upon all language completion (default true). Use --auto-close-task=false to disable.")
fs.BoolVar(&newTask.InitialTMLeverage, "initial-tm-leverage", false, "Enable to calculate and save initial TM leverage with this task.")
fs.StringVar(&taskType, "task-type", "", "Specify if task type is `translation` (default) or `review`.")
fs.Int64Var(&newTask.ParentTaskID, "parent-task-id", 0, "If task_type is review, it can have a parent task. Current task will be opened when parent task is closed.")
fs.StringSliceVar(&newTask.ClosingTags, "closing-tags", []string{}, "Tags that will be added to affected keys when task is closed.")
Expand Down
2 changes: 1 addition & 1 deletion cmd/team.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/teamuser.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/teamusergroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"encoding/json"
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/translation.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -59,7 +59,7 @@ var translationUpdateCmd = &cobra.Command{
Long: "Updates a translation.",
RunE: func(*cobra.Command, []string) error {
// processing opts
translationUpdate.IsFuzzy = &translationUpdateIsFuzzy
translationUpdate.IsUnverified = &translationUpdateIsFuzzy

resp, err := Api.Translations().Update(projectId, translationId, translationUpdate)
if err != nil {
Expand All @@ -79,9 +79,9 @@ func init() {
// List
fs := translationListCmd.Flags()
fs.Uint8Var(&translationListOpts.DisableReferences, "disable-references", 0, "Whether to disable key references.")
fs.StringVar(&translationListOpts.FilterLangID, "filter-lang-id", "", "Return translations only for presented language ID.")
fs.Int64Var(&translationListOpts.FilterLangID, "filter-lang-id", 0, "Return translations only for presented language ID.")
fs.Uint8Var(&translationListOpts.FilterIsReviewed, "filter-is-reviewed", 0, "Filter translations which are reviewed.")
fs.Uint8Var(&translationListOpts.FilterFuzzy, "filter-fuzzy", 0, "Filter translations which are unverified (fuzzy).")
fs.Uint8Var(&translationListOpts.FilterUnverified, "filter-fuzzy", 0, "Filter translations which are unverified (fuzzy).")
fs.StringVar(&translationListOpts.FilterQAIssues, "filter-qa-issues", "", "One or more QA issues to filter by. Possible values are spelling_and_grammar, placeholders, html, url_count, url, email_count, email, brackets, numbers, leading_whitespace, trailing_whitespace, double_space and special_placeholder.")

// Retrieve
Expand Down
2 changes: 1 addition & 1 deletion cmd/translationprovider.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/translationstatus.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cmd

import (
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"encoding/json"
"github.com/lokalise/go-lokalise-api/v3"
"github.com/lokalise/go-lokalise-api/v4"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/lokalise/lokalise-cli-2-go
go 1.21

require (
github.com/lokalise/go-lokalise-api/v3 v3.4.0
github.com/lokalise/go-lokalise-api/v4 v4.1.2
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
Expand Down
8 changes: 6 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,12 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lokalise/go-lokalise-api/v3 v3.4.0 h1:W1uVB6kD2bZeMknBGW2cDwZapg+fHzu6KDYfzM4C7G4=
github.com/lokalise/go-lokalise-api/v3 v3.4.0/go.mod h1:STLXSf6OiwRdBRpK+BtA6deHh1Qjb69mYnI99HnMRHo=
github.com/lokalise/go-lokalise-api/v4 v3.4.0 h1:W1uVB6kD2bZeMknBGW2cDwZapg+fHzu6KDYfzM4C7G4=
github.com/lokalise/go-lokalise-api/v4 v3.4.0/go.mod h1:STLXSf6OiwRdBRpK+BtA6deHh1Qjb69mYnI99HnMRHo=
github.com/lokalise/go-lokalise-api/v4 v4.1.1 h1:qM8HeGobvfltVXnWGUdFRc5tCLEkxR6SoPpfEl7mZaw=
github.com/lokalise/go-lokalise-api/v4 v4.1.1/go.mod h1:wBcA49IR9o4h3PLuNHbN2tu5BfY3xmO3fFyzTyD0XPs=
github.com/lokalise/go-lokalise-api/v4 v4.1.2 h1:qdzbj2lRWXF4YESy6PUkdnbDoEnOql82RXmv8pr54nU=
github.com/lokalise/go-lokalise-api/v4 v4.1.2/go.mod h1:wBcA49IR9o4h3PLuNHbN2tu5BfY3xmO3fFyzTyD0XPs=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
Expand Down

0 comments on commit 3ab9a15

Please sign in to comment.