This is a read-only mirror of the main moonspeak repository
Go to file
Lorenzo Cogotti 4cd4450352 [crush] Update crush.lua. 2022-11-06 17:41:48 +01:00
.gitignore [.gitignore] Add crush lib directory to .gitignore. 2022-08-15 23:35:37 +02:00
.lovedeps [README,.lovedeps] Update links. 2022-11-06 17:41:24 +01:00
LICENSE [*] Initial commit. 2022-08-10 17:23:18 +02:00
README.md [README,.lovedeps] Update links. 2022-11-06 17:41:24 +01:00
crush.lua [crush] Update crush.lua. 2022-11-06 17:41:48 +01:00
init.lua [init] handle the case in which translate() gets called with no dictionary. 2022-08-17 12:14:32 +02:00

README.md

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

  1. Clone this repository.
git clone https://gitea.it/1414codeforge/moonspeak
  1. Move to repository root directory:
cd moonspeak
  1. 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

  1. Download the latest crush.lua file and place it in your project's root directory.

  2. Create a .lovedeps text file in your project's root with the following dependency entry:

{
    moonspeak = "https://gitea.it/1414codeforge/moonspeak",

    -- ...more dependencies, if necessary...
}
  1. moonspeak can now be downloaded directly by crush to the project's lib directory:
lua crush.lua
  1. Now moonspeak can be require()d in your code, like this:
local moonspeak = require 'lib.moonspeak'
  1. Any project depending on yours will now fetch moonspeak automatically when 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.