Skip to content

Commit 8dc28cc

Browse files
authored
Merge pull request #14 from mojixcoder/main
feat: add support for Kurdish language in reverse
2 parents 4b26513 + 15c4b1c commit 8dc28cc

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

services/reverse/models.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ type FrequentAddress struct {
1414
EnglishAddress string `json:"address_en"`
1515
Shortname string `json:"shortname"`
1616
EnglishShortname string `json:"shortname_en"`
17+
KurdishAddress string `json:"address_ckb"`
18+
KurdishShortname string `json:"shortname_ckb"`
1719
}
1820

1921
// Request is the struct containing data on reverse request params

services/reverse/reverse_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package reverse
22

33
import (
44
"context"
5-
"github.com/snapp-incubator/smapp-sdk-go/config"
65
"net/http"
76
"net/http/httptest"
87
"testing"
98
"time"
9+
10+
"github.com/snapp-incubator/smapp-sdk-go/config"
1011
)
1112

1213
func TestNewReverseClient(t *testing.T) {
@@ -424,7 +425,7 @@ func TestClient_GetDisplayNameWithContext(t *testing.T) {
424425
func TestClient_GetFrequent(t *testing.T) {
425426
t.Run("valid", func(t *testing.T) {
426427
sv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
427-
_, _ = w.Write([]byte(`{"address":"استان تهران، شهرستان تهران، تهران","address_en":"Tehran Province, Tehran County, Tehran","shortname":"تهران","shortname_en":"Tehran"}`))
428+
_, _ = w.Write([]byte(`{"address":"استان تهران، شهرستان تهران، تهران","address_en":"Tehran Province, Tehran County, Tehran","shortname":"تهران","shortname_en":"Tehran","address_ckb":"استان کردستان، شهرستان سنندج","shortname_ckb":"سنندج"}`))
428429
}))
429430

430431
cfg, err := config.NewDefaultConfig("key")
@@ -447,6 +448,12 @@ func TestClient_GetFrequent(t *testing.T) {
447448
if result.Shortname != "تهران" {
448449
t.Fatalf("invalid_address")
449450
}
451+
if result.KurdishShortname != "سنندج" {
452+
t.Fatalf("invalid_kurdish_shortname")
453+
}
454+
if result.KurdishAddress != "استان کردستان، شهرستان سنندج" {
455+
t.Fatalf("invalid_kurdish_address")
456+
}
450457
})
451458
t.Run("invalid_response", func(t *testing.T) {
452459
sv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package version
33
import "fmt"
44

55
const (
6-
Version = "v0.9.24"
6+
Version = "v0.9.25"
77
UserAgentHeader = "User-Agent"
88
)
99

0 commit comments

Comments
 (0)