Locale / translation system for Lua or Love2D
local Locale = require("shard.locale")
If you are using Love2D then default is true otherwise false
Loads new locale .lua config file
return {
id = "en",
strings = {
sample_text = "Welcome"
}
}
Sets locale to use when string cannot be translated in current locale
Sets locale to use
Translates string to currently set locale or if cannot be translated then to fallback locale
Checks if locale is loaded
local Locale = require("shard/locale")
Locale.load("en.lua")
Locale.setLocale("en")
print(Locale("test"))