1.3.19 • Published 8 years ago

translatejson v1.3.19

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

TravisCoveralls githubnpmnpm

Translation and translation management system using json files

Table of Contents

Install

npm install --save translatejson

Create a local folder at the root of your project (or at another location but don't forget to configure it) Then create a en.json, fr.json and other xx.json file

API

Constructor

Initialize the class

Parameters

Examples

const translatejson = require("../index")

let Translate = new translatejson("fr", "./resources/locales/");

GetLine

Select the line defined by the key

Parameters

  • Lines string Key name
  • Replace string? Replace string in value (Optional, default null)

Examples

Translate.GetLine("hello");
Translate.GetLine("hello users", "deathart");

Returns string

GetBlock

Select block defined by the key

Parameters

  • Lines string Key name
  • Replace string? Replace string in value (Optional, default null)

Examples

Translate.GetBlock("block.first_block");
Translate.GetBlock("block.sec_block", "deathart");

Returns string

SetLine

Add a key to the json file

Parameters

Examples

Translate.SetLine("good bye", "Good Bye");

Returns boolean

Update

Update a key in the json file

Parameters

Examples

Translate.Update("hello", "Bonjour");

Returns boolean

Del

Deletes a key in the json file

Parameters

Examples

Translate.Del("hello");

Returns boolean

Resolve

finds a key in the json file

Parameters

Examples

Translate.resolve("hello");
Translate.resolve("block.first_bloc");

Returns (string | boolean)

Tests

npm test

Helps

Don't hesitate to help this project, to improve it to make it grow, even constructive criticism helps.

1.3.19

8 years ago

1.3.18

8 years ago

1.3.17

8 years ago

1.3.16

8 years ago

1.3.15

8 years ago

1.3.14

8 years ago

1.3.13

8 years ago

1.3.12

8 years ago

1.3.11

8 years ago

1.3.9

8 years ago

1.3.8

8 years ago

1.3.7

8 years ago

1.3.6

8 years ago

1.3.5

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.9

8 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.0

10 years ago