99designs / 99designs/smartling

feat: locale aliases

Đang mở
#8 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
7
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

It would be nice to have ability to map `smartling` to `application` locales like [repository-connector](https://docs.smartling.com/pages/Repository-Connector/Translation-Settings/) does:

`project.go`

``` go
func resolveLocale(locales map[string]string, locale string) string {
if val, ok := locales[locale]; ok {
return val
}

return locale
}

func localPullFilePath(p, locales map[string]string, locale string) string {
parts := FilenameParts{
Path: p,
Dir: path.Dir(p),
Base: path.Base(p),
Ext: path.Ext(p),
Locale: resolveLocale(locales, locale),
}
// ...
}
```

`smartling.yml`

``` yml
PullFilePath: '{{ .Dir }}/{{.Locale}}{{.Ext}}'
Locales:
en-US: en_US
ru-RU: ru
# etc
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.