Skip to content

Latest commit

 

History

History
105 lines (80 loc) · 1.78 KB

README.md

File metadata and controls

105 lines (80 loc) · 1.78 KB

Shared Language

Gabryell Corrêa | Author

theSpiderDev | GitHub

[email protected] | Contact Email

This is a JavaScript (ES6) folder that contains generic translations for your system.

Summary

Getting Started

Importing

import Translator from "your_project_root_folder/shared-lang";

Using default library

const sharedLang = new Translator(); // Default en-US object

Choosing language library

const sharedLang = new Translator('pt-BR'); // Default pt-BR object

Using custom libraries

import en from 'your_own_en_file'; // { ... }
import es from 'your_own_es_file'; // { ... }
import nl from 'your_own_nl_file'; // { ... }
import pt from 'your_own_pt_file'; // { ... }

const sharedLang = new Translator('pt-BR', { en, es, nl, pt }); // your pt-BR object

Modules

Greetings:

Used to make some nice phrases

const {
  hi,
  hello,
  good_morning,
  good_afternoon,
  good_evening,
  good_night
} = sharedLang.greetings;

Labels:

Used in input labels

const {
  email,
  password,
  send,
  sign_up,
  to_filter
} = sharedLang.labels;

Placeholders

Used in input's placeholders

const {
  email,
  password
} = sharedLang.placeholders;

Validations:

Used in input's validations or messages to the client

const {
  empty_email,
  empty_password,
  wrong_email,
  wrong_password,
  wrong_credentials
} = sharedLang.validations;

Available Languages

  • en-US (Default)
  • pt-BR
  • nl
  • es

Made with love by @theSpiderDev <3