Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/exodusdevs/translation
- Owner: ExodusDevs
- License: gpl-3.0
- Created: 2022-06-24T00:59:08.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T15:00:06.000Z (9 months ago)
- Last Synced: 2024-03-27T16:10:00.910Z (9 months ago)
- Topics: pm4, pmmp-4, pmmp-5, pmmp-servers, pmmp-virion
- Language: PHP
- Homepage: https://discord.com/invite/9NyEwxjd7w
- Size: 69.3 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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