Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type I18n ¶
type I18n struct {
// contains filtered or unexported fields
}
func GetInstance ¶
func GetInstance() *I18n
func (*I18n) Get ¶
Get is a method of the I18n type that allows for dynamic string localization. It retrieves the translation string associated with the provided key. The method also supports pluralization of the translation based on the first argument in args, when it's an integer and different from 1 (which stands for singular form).
Parameters:
- key: The key associated with the translation string in the dictionary.
- args: The optional arguments which can be used for string formatting and pluralization.
Returns:
- The formatted translation string associated with the key if it exists, otherwise "Key not found".
Click to show internal directories.
Click to hide internal directories.