prodap-lore-locale v0.8.19
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", ... ]
23 days ago
29 days ago
29 days ago
28 days ago
28 days ago
25 days ago
25 days ago
28 days ago
24 days ago
24 days ago
24 days ago
24 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
3 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
1 month ago
1 month ago
1 month ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
5 months ago
4 months ago
4 months ago
4 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
6 months ago
6 months ago
6 months ago
6 months ago
4 months ago
4 months ago
4 months ago
5 months ago
6 months ago
6 months ago
6 months ago
3 months ago
6 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
3 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago