Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/DragoniteSpam/GMLocalize2

now with a visual interface, plus gms2
https://github.com/DragoniteSpam/GMLocalize2

Last synced: 2 months ago
JSON representation

now with a visual interface, plus gms2

Awesome Lists containing this project

README

        

# GMLocalize (version number two)

Extract text strings for localization from a GameMaker Studio 2 project, and save it to a JSON file.

I might make this a proper text localization tool later. Who knows.

In case you're wondering, Version 1 was [this thing](https://github.com/DragoniteSpam/GMLocalize). It worked, kinda.

### Usage

This tool will pull out any bare string passed as the first parameter to a **localization** function.

var localized_text = __("The quick brown fox jumped over Donald Trump");

The localization function can be named anything. The default is two underscores (`__`).

Anything that is not a bare string **will not work,** and will probably cause the output to break:

var localized_text = __("The quick brown fox " + "jumped over Donald Trump");
/* name = "Donald Trump" */
var localized_text = __("The quick brown fox jumped over " + name);
/* text = "The quick brown fox jumped over Donald Trump" */
var localized_text = __(text);

In any event, if you actually want to translate a game to different languages, you're going to need some kind of string formatter anyway, because most languages don't follow the same rules as whatever language you are developing in.

/* name = "Donald Trump" */
var localized_text = __("The quick brown fox jumped over %0");
var formatted_text = format(localized_text, name);

From there, you can save it to a json file.

### Building

It's a Visual Studio project, or something

### Credits

- Program icon - Language by The Icon Z from the Noun Project