Sueta

[API] I18N - Translate your plugins easier than ever before!

1.4.0

Internationalization API for use with CraftBukkit / Spigot

·Plugin

I18N
Internationalization API for use with CraftBukkit / Spigot

If you are a plugin developer and just want to know exactly what I18N can do for you, simply skip to the section entitled "For plugin developers".

Quick-Links:
» Getting Started: https://github.com/BlackyPaw/I18N/wiki
» GitHub: https://github.com/BlackyPaw/I18N
» JavaDocs: https://www.blackypaw.com/docs/i18n/
» Maven Repository: http://repo.blackypaw.com/#view-repositories;public~browsestorage

Overview

The I18N project aims to be an easy-to-use API for plugin developers to internationalize their plugins. I18N takes away a lot of the repetitive and tedious work that must be done in order to have the right translations in place and exposes a simple but powerful API that blends into the official Bukkit / Spigot API nicely.

How does it work?

Just like any other plugin: simply put the .JAR file inside the plugins folder of your server and it will load during startup. Other plugins might depend on it as I18N exposes a translation API to plugin developers as well.

For server owners

If you are a server owner and you have been told that one of your plugin requires I18N to be installed in order to work properly you can download the latest version from this resource page. Please note, that I18N requires the latest version of ProtocolLib to be installed on your server.

If you need further assistance take a look at the project's GitHub wiki where you will find a lot of helpful guides that will get you started: https://github.com/BlackyPaw/I18N/wiki

For plugin developers

I18N will free you from the burden of checking a player's language before sending a message to him. Code that would usually have to be written like this:

if ( LanguageHelper.getLanguage( player ) == Language.ENGLISH ) {
    player.sendMessage( "Hello, world!" );
} else if ( LanguageHelper.getLanguage( player ) == Language.GERMAN ) {
    player.sendMessage( "Hallo, Welt!" );
}
...

simplifies to the following when using I18N:

player.sendMessage( localizer.inject( "hello.world" ) );

Furthermore, I18N grants your project a lot more flexibility as new languages and messages may be added simply by adding a new file containing the translated messages. You can even allow your users to customize the translated messages or translate your plugin into their native language without ever touching a single line of code. As if that was not enough already it does not only work with messages either: you can show the very same sign in each users native language, you can show the very same scoreboard to players in different languages you can even have the very same item stack inside a container shown in different languages for each player. I assume you're now convinced? ;)

If you would like to use I18N with your next plugin you should most certainly take a look at the project's GitHub wiki as well where you will find a lot of resources, tutorials and examples which will get you started in no time: https://github.com/BlackyPaw/I18N/wiki

License

The project is licensed under the BSD 3-Clause license found in the LICENSE file in the project's source tree on GitHub.

Put bluntly: it is free and there are almost no restrictions how you may use it.

Issues

Found a bug? Can't get it to work on your server? Feel free to create an issue on the project's GitHub repository: https://github.com/BlackyPaw/I18N/issues/new

Please keep in mind that this resource is still work in progress and will always be and may therefore contain some bugs. If you should encounter any such I would be pleased if you could drop me a message so that I can fix them.

Links

GitHub: https://github.com/BlackyPaw/I18N
JavaDoc: https://www.blackypaw.com/docs/i18n/
Download / Maven Repository: http://repo.blackypaw.com/#view-repositories;public~browsestorage

Similar projects

Plugin →