Skip to content

mberatsanli/multilangJAVA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multilangJAVA

Import the library

import com.multilang.*;

Using

> How to declare

Multilang mlang = new Multilang();

> Set Languages Directory

mlang.setLanguage(<String>);

> Getter and Setter function

value what is does ouput
language library selected language string
directory library selected directory string

> List the language in the defined direcory

mlang.getLanguages(<Boolean>);
paramters what is does output
false Getting for you language file(s) in directory array
true Print for you language file(s) in directory string

> How to create the language file (json)

For example, the folder with the language files: ../languages/ and we create a language folder in the directory. Create LANGUAGE.json for example ru.json and az.json "CALL_NAME": "TEXT or WORD"

// ru.json
{
	"merhaba": "Привет",
	"merhaba_kullanici": "Привет"
}

// az.json
{
	"merhaba": "Salamlar",
	"merhaba_kullanici": "Salam"
}

> How to get the text or word

mlang.call(<string> CALLED NAME)

Example Using

# src/test.java
import  com.multilang.*;

public  class  test  {
	public  static  void  main(String[] args) {
		Multilang  mlang  =  new  Multilang();
		mlang.setLanguage("en"); // Set "en" language
		System.out.println(mlang.call("test")); // Output (string): This is a test
	}
}

Releases

No releases published

Packages

 
 
 

Languages