Skip to content

Commit

Permalink
fix: string metadatas
Browse files Browse the repository at this point in the history
  • Loading branch information
ConsoleTVs committed Oct 2, 2023
1 parent 8da90ed commit 463278d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions translate/entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ func Simple(message string) golidate.Entry {
continue
}

if value, err := cast.ToStringE(val); err == nil {
message = strings.ReplaceAll(message, "@"+key, value)
continue
}
value := fmt.Sprintf("%+v", val)
message = strings.ReplaceAll(message, "@"+key, value)
}

result.Message = message
Expand Down
4 changes: 2 additions & 2 deletions translate/language/english.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ import (
// Try finding alternative words if there is the need to write those
// keywords in the message without triggering the special behavior.`
var English = golidate.Dictionary{
"accepted": translate.Simple("the :attribute field must be accepted"),
"accepted": translate.Simple("the :attribute field must be one of @values"),
"alpha": translate.Simple("the :attribute field must only contain letters"),
"alpha_dash": translate.Simple("the :attribute field must only contain letters, numbers, dashes, and underscores"),
"alpha_extended": translate.Simple("the :attribute field must only contain letters, numbers, dashes, underscores and dots"),
"alpha_numeric": translate.Simple("the :attribute field must only contain letters and numbers"),
"and": translate.SplitFromMetadata("operations", " and also "),
"ascii": translate.Simple("the :attribute field must only contain single-byte alphanumeric characters and symbols"),
"boolean": translate.Simple("the :attribute field must be @values"),
"boolean": translate.Simple("the :attribute field must be one of @values"),
"convertible": translate.Simple("the :attribute field must be convertible to @type"),
"declined": translate.Simple("the :attribute field must be declined"),
"domain": translate.Simple("the :attribute field must be a valid domain"),
Expand Down

0 comments on commit 463278d

Please sign in to comment.