Documentation
¶
Index ¶
- type Payload
- func (P *Payload) Debug()
- func (P *Payload) Get(property string) string
- func (P *Payload) GetBool(property string) (bool, error)
- func (P *Payload) GetBoolofCategory(property string, category string) (bool, error)
- func (P *Payload) GetFloat(property string) (float64, error)
- func (P *Payload) GetFloatofCategory(property string, category string) (float64, error)
- func (P *Payload) GetInt(property string) (int, error)
- func (P *Payload) GetIntofCategory(property string, category string) (int, error)
- func (P *Payload) GetList(property string) ([]string, error)
- func (P *Payload) GetListBool(property string) ([]bool, error)
- func (P *Payload) GetListBoolofCategory(property string, category string) ([]bool, error)
- func (P *Payload) GetListFloat(property string) ([]float64, error)
- func (P *Payload) GetListFloatofCategory(property string, category string) ([]float64, error)
- func (P *Payload) GetListInt(property string) ([]int, error)
- func (P *Payload) GetListIntofCategory(property string, category string) ([]int, error)
- func (P *Payload) GetListString(property string) ([]string, error)
- func (P *Payload) GetListStringofCategory(property string, category string) ([]string, error)
- func (P *Payload) GetListofCategory(property string, category string) ([]string, error)
- func (P *Payload) GetLocalised(property, locale string) string
- func (P *Payload) GetMap(property string) (map[string]string, error)
- func (P *Payload) GetMapofCategory(property string, category string) (map[string]string, error)
- func (P *Payload) GetString(property string) (string, error)
- func (P *Payload) GetStringofCategory(property string, category string) (string, error)
- func (P *Payload) GetValue(property string, category string) string
- func (P *Payload) Normal()
- func (P *Payload) ToString() string
- func (P *Payload) Update(key string, value string) *Payload
- func (P *Payload) Verbose()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Payload ¶
type Payload struct {
// contains filtered or unexported fields
}
The Payload type represents a set of data used for translation, including flags, a map of translations, and file-related information. @property {bool} verbose - A boolean flag indicating whether verbose logging should be enabled or not. @property data - The `data` property is a map of translations, where the keys are strings representing the original text and the values are strings representing the translated text. This map is shared by all instances of the translate package. @property {string} filename - The filename property is a string that represents the name of the file. @property {string} extension - The extension property represents the file extension of the payload file. @property {string} path - The "path" property is a string that represents the directory path where the file is located. @property {string} absolutepath - The `absolutepath` property represents the absolute path of a file.
func (*Payload) Debug ¶
func (P *Payload) Debug()
The function Debug provide debug output for the current payload.
func (*Payload) Get ¶
Get returns a translated string or the original string if no translation is found The Get function returns the result of the get function when given a string inpuP.
func (*Payload) GetBoolofCategory ¶
The function GetBoolofCategory returns a boolean value based on the given property and category.
func (*Payload) GetFloatofCategory ¶
The GetFloatofCategory function retrieves a float value based on a given property and category.
func (*Payload) GetIntofCategory ¶
The function GetIntofCategory retrieves an integer value based on a given property and category.
func (*Payload) GetListBool ¶
The function GetListBool returns a list of boolean values and an error.
func (*Payload) GetListBoolofCategory ¶
The function GetListBoolofCategory returns a list of boolean values based on the given property and category.
func (*Payload) GetListFloat ¶
The function GetListFloat returns a list of float64 values and an error, based on a given property.
func (*Payload) GetListFloatofCategory ¶
The function GetListFloatofCategory returns a list of float64 values based on the given property and category.
func (*Payload) GetListInt ¶
The function GetListInt returns a list of integers and an error based on a given property.
func (*Payload) GetListIntofCategory ¶
The function GetListIntofCategory returns a list of integers based on the given property and category.
func (*Payload) GetListString ¶
The function GetListString returns a list of strings based on a given property.
func (*Payload) GetListStringofCategory ¶
The function GetListStringofCategory retrieves a list of strings based on a given property and category.
func (*Payload) GetListofCategory ¶
The function GetListofCategory returns a list of strings based on the given property and category.
func (*Payload) GetLocalised ¶
func (*Payload) GetMap ¶
The GetMap function returns a map of string key-value pairs and an error, based on the provided property.
func (*Payload) GetMapofCategory ¶
The function GetMapofCategory returns a map of strings and an error based on the given property and category.
func (*Payload) GetStringofCategory ¶
The GetStringofCategory function returns a string value based on the given property and category.
func (*Payload) GetValue ¶
GetValue returns translated string for a given property and name The GetValue function returns the value associated with a given property and name.
func (*Payload) Normal ¶
func (P *Payload) Normal()
Normal turns off verbose logging The function "Normal" sets the verbose flag to false.