Search in sources :

Example 1 with CombinedTranslationManager

use of org.lanternpowered.server.text.translation.CombinedTranslationManager in project LanternServer by LanternPowered.

the class TranslationManagerRegistryModule method registerDefaults.

@EarlyRegistration
@Override
public void registerDefaults() {
    this.translationManager = new CombinedTranslationManager();
    // Get the asset repository
    final AssetRepository assetRepository = Lantern.getAssetRepository();
    // Add the translation manager as a reload listener
    assetRepository.addReloadListener(this.translationManager);
    // Add the minecraft language file for defaults and
    // the client translations
    this.translationManager.addManager(new MinecraftTranslationManager());
    final LanternTranslationManager lanternTranslationManager = new LanternTranslationManager();
    // Add the lantern languages
    lanternTranslationManager.addResourceBundle(assetRepository.get("lantern", "lang/en_us.properties").get(), Locale.ENGLISH);
    this.translationManager.addManager(lanternTranslationManager);
    this.translationManager.setDelegateManager(lanternTranslationManager);
}
Also used : MinecraftTranslationManager(org.lanternpowered.server.text.translation.MinecraftTranslationManager) AssetRepository(org.lanternpowered.server.asset.AssetRepository) CombinedTranslationManager(org.lanternpowered.server.text.translation.CombinedTranslationManager) LanternTranslationManager(org.lanternpowered.server.text.translation.LanternTranslationManager) EarlyRegistration(org.lanternpowered.server.game.registry.EarlyRegistration)

Aggregations

AssetRepository (org.lanternpowered.server.asset.AssetRepository)1 EarlyRegistration (org.lanternpowered.server.game.registry.EarlyRegistration)1 CombinedTranslationManager (org.lanternpowered.server.text.translation.CombinedTranslationManager)1 LanternTranslationManager (org.lanternpowered.server.text.translation.LanternTranslationManager)1 MinecraftTranslationManager (org.lanternpowered.server.text.translation.MinecraftTranslationManager)1