99designs / 99designs/smartling

feat: locale aliases

未关闭
#8 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
7
派生
2
PR 合并指标
30 天内没有已合并 PR

描述

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
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。