Skip to content

Latest commit

 

History

History
38 lines (32 loc) · 1009 Bytes

README.md

File metadata and controls

38 lines (32 loc) · 1009 Bytes

Simple Localization™

My own localization system made from scratch!
Basically, it uses keys from .json files to translate text, and that's all there is to it!

Basic Usage

Initialization:

Localization.init({
    languages: ['en-us', 'es-es', 'fr-fr', 'pt-br', 'yr-hr'],
    directory: "languages", // this variable is optional
    default_language: "en-us" // this variable is optional
});

Switching to another language:

Localization.switchLanguage("en-us");

Retrieving a key:

Localization.get("greeting", "en-us"); // If the second parameter is empty, defaults to current language

Basic .json setup:

{
    "greeting": "Hello world!",
    "farewell": "Goodbye!"
}

Documentation

For futher documentation, check out Localization.hx.

Other Stuff

You can check out this system in action in the samples/flixel folder.
If you need localization tags, go here.