99designs / 99designs/smartling

feat: locale aliases

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.