1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-07 20:17:05 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-01-09 05:41:20 +02:00
parent 72c2dafd2e
commit 8aedf6bc32
36 changed files with 99 additions and 130 deletions

View File

@@ -1,11 +1,8 @@
package internal
import (
"reflect"
"regexp"
"sort"
"golang.org/x/text/message/catalog"
)
// Var represents a message variable.
@@ -84,7 +81,7 @@ func getVars(loc *Locale, key string, src map[string]interface{}) []Var {
return vars
}
var unescapeVariableRegex = regexp.MustCompile("\\$\\{(.*?)}")
var unescapeVariableRegex = regexp.MustCompile(`\$\{(.*?)}`)
func sortVars(text string, vars []Var) (newVars []Var) {
argth := 1
@@ -122,6 +119,7 @@ func removeVarsDuplicates(elements []Var) (result []Var) {
return result
}
/*
func removeMsgVarsDuplicates(elements []catalog.Message) (result []catalog.Message) {
seen := make(map[string]struct{})
@@ -141,6 +139,7 @@ func removeMsgVarsDuplicates(elements []catalog.Message) (result []catalog.Messa
return
}
*/
func getCases(loc *Locale, src map[string]interface{}) []interface{} {
type PluralCase struct {