Click 'read more' for summary of changes.
Languagy 1.1.5 has notable API changes. Instead of using
Code (Java):
new Translator
(JavaPlugin plugin,
File fallback
)
;
It is now preferred that your main class implements the LanguagyPluginHook interface (the method provided is where you put your translator-related methods, such as #setDisplay(Material material)), and on your translator field add the annotation @LanguagyImplementation. For example:
Code (Java):
public
class Main
extends JavaPlugin
implements LanguagyPluginHook
{
@LanguagyImplementation
(fallbackFile
=
"plugins/Merchants/lang/en_gb.yml"
)
@Getter
private Translator translator
;
@Override
public
void onLanguagyHook
(
)
{
translator.
setDisplay
(Material.
HAY_BLOCK
)
;
}
}
When your plugin has enabled, the translator class will be injected into your field and the method #onLanguagyHook will be called.
- Removed auto-updater as it was too difficult to maintain
- Made Languagy correctly use plugins logger instead of bukkit
- Changed API to make code more clean and less time consuming (see above)
- Added better documentation to Translator
- Added null checks (including check for invalid config path)
- This version maintains support for plugins using legacy Languagy versions