Documentation
¶
Index ¶
- Constants
- Variables
- func GetGenshinLocale(nameable hash.Nameable) *string
- func GetGenshinLocaleOrHash(nameable hash.Nameable) string
- func GetHsrLocale(nameable hash.Nameable) *string
- func GetHsrLocaleOrHash(nameable hash.Nameable) string
- func Init(logger zerolog.Logger, caches ...Cache)
- func SetLocalization(locale LocalizationKey, flushOld ...bool)
- type Cache
- type Localization
- type LocalizationKey
Constants ¶
const ( HONKAI_BASE_URL = "https://gitlab.com/Dimbreath/turnbasedgamedata/-/raw/main/TextMap/TextMap%s.json" GENSHIN_BASE_URL = "https://gitlab.com/Dimbreath/AnimeGameData/-/raw/master/TextMap/TextMap%s.json" )
Variables ¶
var ( LoadGenshin = true LoadStarRail = true )
Functions ¶
func GetGenshinLocale ¶
GetGenshinLocale tries to retrieve the string for a hash in Genish impact. Takes a nameable and returns a nilable string
Methods on structs will use GetGensinLocaleOrHash, call this directly for full control over its behavior
func GetGenshinLocaleOrHash ¶
GetGenshinLocaleOrHash tries to retrieve the string for a hash in Genish impact
Returns the hash if the string is not found
func GetHsrLocale ¶ added in v0.6.0
GetHsrLocale tries to retrieve the string for a hash in Honkai: Star Rail. Takes a nameable and returns a nilable string
Methods on structs will use GetHsrLocaleOrHash, call this directly for full control over its behavior
func GetHsrLocaleOrHash ¶ added in v0.6.0
GetHsrLocaleOrHash tries to retrieve the string for a hash in Honkai: Star Rail
Returns the hash if string is not found
func SetLocalization ¶
func SetLocalization(locale LocalizationKey, flushOld ...bool)
SetLocalization updates the localization for the given language. Removes current locale if flushOld is true
Types ¶
type Localization ¶
type Localization struct {
// contains filtered or unexported fields
}
func Get ¶
func Get() *Localization
type LocalizationKey ¶
type LocalizationKey string
const ( TRADITIONAL_CHINESE LocalizationKey = "CHT" SIMPLIFIED_CHINESE LocalizationKey = "CHS" GERMAN LocalizationKey = "DE" ENGLISH LocalizationKey = "EN" ESPANOL LocalizationKey = "ES" FRANCAIS LocalizationKey = "FR" INDONESIAN LocalizationKey = "ID" // Do not use for Honkai: Star Rail ITALIAN LocalizationKey = "IT" JAPANESE LocalizationKey = "JP" KOREAN LocalizationKey = "KR" PORTUGUESE LocalizationKey = "PT" RUSSIAN LocalizationKey = "RU" THAI LocalizationKey = "TH" // Do not use for Honkai: Star Rail TURKISH LocalizationKey = "TR" VIETNAMESE LocalizationKey = "VI" )