WIP: feat: translation support
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
See #483
This commit is contained in:
@ -2,13 +2,14 @@ package envfile
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"errors"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"git.coopcloud.tech/toolshed/godotenv"
|
||||
"coopcloud.tech/abra/pkg/i18n"
|
||||
)
|
||||
|
||||
// AppEnv is a map of the values in an apps env config
|
||||
@ -38,7 +39,7 @@ func ReadEnvWithModifiers(filePath string) (AppEnv, AppModifiers, error) {
|
||||
return nil, mods, err
|
||||
}
|
||||
|
||||
log.Debugf("read %s from %s", envVars, filePath)
|
||||
log.Debug(i18n.G("read %s from %s", envVars, filePath))
|
||||
|
||||
return envVars, mods, nil
|
||||
}
|
||||
@ -69,16 +70,16 @@ func ReadAbraShEnvVars(abraSh string) (map[string]string, error) {
|
||||
envVarDef := splitVals[len(splitVals)-1]
|
||||
keyVal := strings.Split(envVarDef, "=")
|
||||
if len(keyVal) != 2 {
|
||||
return envVars, fmt.Errorf("couldn't parse %s", txt)
|
||||
return envVars, errors.New(i18n.G("couldn't parse %s", txt))
|
||||
}
|
||||
envVars[keyVal[0]] = keyVal[1]
|
||||
}
|
||||
}
|
||||
|
||||
if len(envVars) > 0 {
|
||||
log.Debugf("read %s from %s", envVars, abraSh)
|
||||
log.Debug(i18n.G("read %s from %s", envVars, abraSh))
|
||||
} else {
|
||||
log.Debugf("read 0 env var exports from %s", abraSh)
|
||||
log.Debug(i18n.G("read 0 env var exports from %s", abraSh))
|
||||
}
|
||||
|
||||
return envVars, nil
|
||||
|
Reference in New Issue
Block a user