0.0.121 • Published 6 days ago

prodap-lore-locale v0.0.121

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
6 days ago

Prodap Lore Locale

Package used to perform the internationalization of Lore.

See below how to search for specific localization and translation according to the key:

Installation

This is a Node.js library available through the npm registry. Before installing, download and install Node.js. Node.js 18.10.0 or higher is required.

If this is a brand new project, make sure you create a package.json first with the command npm init.

Installation is done using the command yarn add or npm install:

$ yarn add prodap-lore-locale

or

$ npm install prodap-lore-locale

Usage

Below are some ways to get the locale information contained in this library:

Without the locale

Without passing the locale the class will return all locales.

import { Locales } from 'prodap-lore-locale'

const locales = new Locales()

console.log(getLocales) // { "en-US": { "hello": "Hello", ... }, "pt-BR": { "hello": "Olá", ... } }

Passing the locale

Passing the locale the class will return the corresponding locale.

import { Locales } from 'prodap-lore-locale'

const locales = new Locales({ locale: 'pt-BR' })

console.log(getLocales) // { "pt-BR": { "hello": "Olá", ... } }

Looking for a specific translation

When searching for a specific translation, simply enter the corresponding key.

import { Locales } from 'prodap-lore-locale'

const locales = new Locales({ locale: 'pt-BR' })
const hello = locales.translate('hello') // { "hello": "Olá" }

console.log(hello) // Olá

Looking for a specific translation and replace

When looking for a specific translation and want to replace some value, just type the corresponding key and use replace.

import { Locales } from 'prodap-lore-locale'

const locales = new Locales({ locale: 'pt-BR' })
const helloPeople = locales.translate('hello_people').replace('{{VALUE}}', 'Lore') // { "hello_people": "Olá {{VALUE}}" }

console.log(helloPeople) // Olá Lore

Get current library location

In this way it is possible to obtain the current library location.

import { Locales } from 'prodap-lore-locale'

const locales = new Locales({ locale: 'pt-BR' })
const getCurrentLocale = locales.getCurrentLocale()

console.log(getCurrentLocale) // pt-BR

Get library locations

In this way it is possible to obtain the library locations.

import { Locales } from 'prodap-lore-locale'

const locales = new Locales()
const getLocales = locales.getLocales()

console.log(getLocales) // [ "en-US", "pt-BR", ... ]
0.0.121

6 days ago

0.0.120

13 days ago

0.0.119

24 days ago

0.0.117

2 months ago

0.0.116

2 months ago

0.0.118

2 months ago

0.0.115

2 months ago

0.0.114

2 months ago

0.0.113

2 months ago

0.0.112

2 months ago

0.0.111

2 months ago

0.0.110

2 months ago

0.0.109

2 months ago

0.0.108

2 months ago

0.0.107

2 months ago

0.0.106

2 months ago

0.0.105

3 months ago

0.0.104

3 months ago

0.0.103

4 months ago

0.0.102

4 months ago

0.0.101

5 months ago

0.0.100

5 months ago

0.0.99

5 months ago

0.0.98

5 months ago

0.0.97

5 months ago

0.0.84

7 months ago

0.0.85

6 months ago

0.0.86

6 months ago

0.0.87

6 months ago

0.0.88

6 months ago

0.0.89

6 months ago

0.0.80

7 months ago

0.0.82

7 months ago

0.0.83

7 months ago

0.0.75

7 months ago

0.0.77

7 months ago

0.0.78

7 months ago

0.0.79

7 months ago

0.0.95

5 months ago

0.0.96

5 months ago

0.0.90

6 months ago

0.0.91

6 months ago

0.0.92

6 months ago

0.0.93

6 months ago

0.0.94

6 months ago

0.0.73

8 months ago

0.0.74

8 months ago

0.0.70

8 months ago

0.0.71

8 months ago

0.0.72

8 months ago

0.0.47

12 months ago

0.0.62

10 months ago

0.0.63

10 months ago

0.0.64

10 months ago

0.0.65

9 months ago

0.0.66

9 months ago

0.0.67

8 months ago

0.0.68

8 months ago

0.0.69

8 months ago

0.0.60

10 months ago

0.0.61

10 months ago

0.0.59

11 months ago

0.0.51

12 months ago

0.0.52

12 months ago

0.0.53

11 months ago

0.0.54

11 months ago

0.0.55

11 months ago

0.0.56

11 months ago

0.0.57

11 months ago

0.0.58

11 months ago

0.0.48

12 months ago

0.0.49

12 months ago

0.0.40

1 year ago

0.0.41

1 year ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.45

12 months ago

0.0.46

12 months ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.39

1 year ago

0.0.34

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago