utils.go 295 B

1234567891011
  1. package parser
  2. import (
  3. go_path "path"
  4. "strings"
  5. )
  6. func getTranslationMapKey(path, keyName, projectPath string) string {
  7. var temp = strings.Split(projectPath, "/")
  8. return strings.TrimPrefix(go_path.Join(path, keyName), strings.TrimSuffix(strings.Join(temp[:len(temp)-1], "/"), "/")+"/")
  9. }