moonspeak - LÖVE game localization library
moonspeak is a basic internationalization library for the LÖVE engine. It makes your game easy to translate to multiple languages.
moonspeak does the following:
- Loads dictionary files for your game.
- Allows selecting one of the many available languages.
- Translates messages by id (and provides default fallback to English).
Dependencies
moonspeak uses df-serialize to read the dictionary file.
You may either doenload df-serialize manually and place it inside a lib subdirectory,
or use crush
to do this for you.
Using crush to download moonspeak dependencies
- Clone this repository.
git clone https://git.doublefourteen.io/lua/moonspeak
- Move to repository root directory:
cd moonspeak
- Resolve dependencies using crush.
lua crush.lua
You should now see a lib subdirectory containing the necessary dependencies.
Integrating moonspeak in my project using crush
-
Download the latest crush.lua file and place it in your project's root directory.
-
Create a
.lovedepstext file in your project's root with the following dependency entry:
{
moonspeak = "https://git.doublefourteen.io/lua/moonspeak",
-- ...more dependencies, if necessary...
}
moonspeakcan now be downloaded directly bycrushto the project'slibdirectory, along with any other dependency:
lua crush.lua
- You may now use
moonspeakin your project byrequire()-ing it.
local moonspeak = require 'lib.moonspeak'
- Any project depending on yours may now fetch your project's dependencies (including
moonspeak) automatically using crush, following the above procedure.
Documentation
Code is documented with LDoc.
Documentation may be generated running the command:
ldoc init.lua
ldoc outputs to a local doc directory, open index.html
with your favorite browser to read it.
License
Zlib, See LICENSE for details.