// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gi18n import ( "errors" "fmt" "github.com/gogf/gf/internal/intlog" "strings" "sync" "github.com/gogf/gf/os/gfsnotify" "github.com/gogf/gf/text/gregex" "github.com/gogf/gf/util/gconv" "github.com/gogf/gf/encoding/gjson" "github.com/gogf/gf/os/gfile" "github.com/gogf/gf/os/gres" ) // Manager, it is concurrent safe, supporting hot reload. type Manager struct { mu sync.RWMutex data map[string]map[string]string // Translating map. pattern string // Pattern for regex parsing. options Options // configuration options. } // Options is used for i18n object configuration. type Options struct { Path string // I18n files storage path. Language string // Local language. Delimiters []string // Delimiters for variable parsing. } var ( // defaultDelimiters defines the default key variable delimiters. defaultDelimiters = []string{"{#", "}"} ) // New creates and returns a new i18n manager. // The optional parameter