Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: locale aliases #8

Open
mdreizin opened this issue Aug 12, 2016 · 0 comments
Open

feat: locale aliases #8

mdreizin opened this issue Aug 12, 2016 · 0 comments

Comments

@mdreizin
Copy link

It would be nice to have ability to map smartling to application locales like repository-connector does:

project.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

PullFilePath: '{{ .Dir }}/{{.Locale}}{{.Ext}}'
Locales:
  en-US: en_US
  ru-RU: ru
  # etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant