Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/exodusdevs/translation

A translation library for your code from PocketMine-MP 4.0.0 or higher
https://github.com/exodusdevs/translation

pm4 pmmp-4 pmmp-5 pmmp-servers pmmp-virion

Last synced: about 1 month ago
JSON representation

A translation library for your code from PocketMine-MP 4.0.0 or higher

Awesome Lists containing this project

README

        

# TranslationAPI
A translation library for your code from PocketMine-MP 4.0.0 or earlier
## How to use it?
First you initialize the class, then use its methods
```php
//$this = PluginBase class
$translation = new Translation($this);
```
First choose the default language to use if that language does not exist
```php
//use class
use exodus\translation\Language;

//i will use the language of the USA
$translation->setDefaultLanguage(new Language("en_US", "English Language", ["welcome-message" => "%username% joined!!"]));
```
after this...
```php

$translation->send($player, "welcome-message", ["username" => $player->getName()]);
```
this beautiful code xd