From 68926d6b9a4511492ad5d817c659818020139c7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 18 Nov 2019 21:18:41 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=8C=90=20Make=20new=20translation=20object?= =?utf8?q?=20available=20everywhere?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt | 2 ++ src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt b/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt index e754727..fb9156e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt @@ -10,6 +10,7 @@ import com.google.inject.spi.* import freenet.l10n.* import net.pterodactylus.sone.database.* import net.pterodactylus.sone.database.memory.* +import net.pterodactylus.sone.freenet.* import net.pterodactylus.sone.freenet.wot.* import net.pterodactylus.util.config.* import net.pterodactylus.util.config.ConfigurationException @@ -50,6 +51,7 @@ open class SoneModule(private val sonePlugin: SonePlugin, private val eventBus: bind(PluginYear::class.java).toInstance(PluginYear(sonePlugin.year)) bind(PluginHomepage::class.java).toInstance(PluginHomepage(sonePlugin.homepage)) bind(Database::class.java).to(MemoryDatabase::class.java).`in`(Singleton::class.java) + bind(Translation::class.java).toInstance(BaseL10nTranslation(sonePlugin.l10n().base)) bind(BaseL10n::class.java).toInstance(sonePlugin.l10n().base) loaders?.let { bind(Loaders::class.java).toInstance(it) } bind(MetricRegistry::class.java).`in`(Singleton::class.java) diff --git a/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt b/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt index a5efbe6..e7d843b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/main/SoneModuleTest.kt @@ -10,6 +10,7 @@ import freenet.pluginmanager.* import net.pterodactylus.sone.core.* import net.pterodactylus.sone.database.* import net.pterodactylus.sone.database.memory.* +import net.pterodactylus.sone.freenet.* import net.pterodactylus.sone.freenet.plugin.* import net.pterodactylus.sone.freenet.wot.* import net.pterodactylus.sone.test.* @@ -154,6 +155,11 @@ class SoneModuleTest { } @Test + fun `translation is bound correctly`() { + assertThat(injector.getInstance(), notNullValue()) + } + + @Test fun `default loader is used without dev options`() { assertThat(injector.getInstance(), instanceOf(DefaultLoaders::class.java)) } -- 2.7.4