1.3.19 • Published 6 years ago

translatejson v1.3.19

Weekly downloads
2
License
MIT
Repository
github
Last release
6 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

6 years ago

1.3.18

6 years ago

1.3.17

6 years ago

1.3.16

6 years ago

1.3.15

6 years ago

1.3.14

6 years ago

1.3.13

6 years ago

1.3.12

6 years ago

1.3.11

6 years ago

1.3.9

6 years ago

1.3.8

6 years ago

1.3.7

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.9

6 years ago

1.1.8

7 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.0

8 years ago