Skip to content

Commit

Permalink
merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekith committed Feb 8, 2017
2 parents fc6c89d + 09cdb5c commit 5722e8c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,31 @@

A flexible internationalization library working with JSON files in Haxe.

Flexible?

* Translations files don't need to be in a specific location.
* It can work with or without OpenFL.
* They don't even need to be files.
* It work with or without OpenFL.

## Installation

In a shell, execute:
Haxelib:

```
haxelib install jsoni18n
```

If you use an OpenFL XML file (Project.xml), add:
OpenFL project XML file:

```
```xml
<haxelib name="jsoni18n" />
```

If you use the haxe command and its flags, add:
OpenFL project HXP file:

```haxe
haxelibs.push(new Haxelib("jsoni18n"));
```

Haxe command line arguments:

```
haxe -lib jsoni18n ...
Expand Down Expand Up @@ -70,7 +75,7 @@ If you use OpenFL, you can load a file:
I18n.loadFromFile("assets/data/i18n_" + lang + ".json");
```

Or/else directly from a string:
Or directly from a string:

```haxe
var jsonFileContent : String = myLangFileLoader();
Expand Down Expand Up @@ -102,18 +107,11 @@ I18n.tr("welcome/subtitle", [ "name" => "Nekith" ]); // Welcome, Nekith!

### Configuration

Default depth delimiter is "/". You can change it like this:

```haxe
I18n.depthDelimiter = "_";
```

Default variable prefix is ":". You can change it like this:

```haxe
I18n.varPrefix = "@";
I18n.depthDelimiter = "_"; // default: "/"
I18n.varPrefix = "@"; // default: ":"
```

## License

New-BSD licensed. See LICENSE file.
3-clause BSD. See LICENSE file.
2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jsoni18n",
"url": "https://github.com/Nekith/jsoni18n",
"license": "BSD",
"tags": ["cross", "i18n", "translation", "internationalization"],
"tags": ["cross", "i18n", "translation", "internationalization", "localization"],
"description": "A flexible internationalization library working with JSON files in Haxe.",
"version": "0.2.3",
"releasenote": "Fix the files architecture in release.",
Expand Down

0 comments on commit 5722e8c

Please sign in to comment.