Skip to content

JavaScript folder with generic language translations

Notifications You must be signed in to change notification settings

GabryellPedroso/shared-lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

JavaScript folder with generic language translations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published