♻️ Only hand in L10n to l10n filter
[Sone.git] / src / main / java / net / pterodactylus / sone / web / WebInterface.java
index cd776d7..e7ea688 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - WebInterface.java - Copyright © 2010–2016 David Roden
+ * Sone - WebInterface.java - Copyright © 2010–2019 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -72,11 +72,11 @@ import net.pterodactylus.sone.freenet.L10nFilter;
 import net.pterodactylus.sone.freenet.wot.Identity;
 import net.pterodactylus.sone.freenet.wot.Trust;
 import net.pterodactylus.sone.main.Loaders;
+import net.pterodactylus.sone.main.PluginHomepage;
+import net.pterodactylus.sone.main.PluginVersion;
+import net.pterodactylus.sone.main.PluginYear;
 import net.pterodactylus.sone.main.ReparseFilter;
 import net.pterodactylus.sone.main.SonePlugin;
-import net.pterodactylus.sone.main.SonePlugin.PluginHomepage;
-import net.pterodactylus.sone.main.SonePlugin.PluginVersion;
-import net.pterodactylus.sone.main.SonePlugin.PluginYear;
 import net.pterodactylus.sone.notify.ListNotification;
 import net.pterodactylus.sone.notify.ListNotificationFilter;
 import net.pterodactylus.sone.notify.PostVisibilityFilter;
@@ -260,7 +260,7 @@ public class WebInterface implements SessionProvider {
        private final ElementLoader elementLoader;
        private final LinkedElementRenderFilter linkedElementRenderFilter;
        private final TimeTextConverter timeTextConverter = new TimeTextConverter();
-       private final L10nFilter l10nFilter = new L10nFilter(this);
+       private final L10nFilter l10nFilter;
 
        /** The “new Sone” notification. */
        private final ListNotification<Sone> newSoneNotification;
@@ -320,6 +320,7 @@ public class WebInterface implements SessionProvider {
                this.elementLoader = elementLoader;
                formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword();
                soneTextParser = new SoneTextParser(getCore(), getCore());
+               l10nFilter = new L10nFilter(getL10n());
 
                templateContextFactory = new TemplateContextFactory();
                templateContextFactory.addAccessor(Object.class, new ReflectionAccessor());
@@ -337,7 +338,7 @@ public class WebInterface implements SessionProvider {
                templateContextFactory.addFilter("html", new HtmlFilter());
                templateContextFactory.addFilter("replace", new ReplaceFilter());
                templateContextFactory.addFilter("store", new StoreFilter());
-               templateContextFactory.addFilter("l10n", new L10nFilter(this));
+               templateContextFactory.addFilter("l10n", l10nFilter);
                templateContextFactory.addFilter("substring", new SubstringFilter());
                templateContextFactory.addFilter("xml", new XmlFilter());
                templateContextFactory.addFilter("change", new RequestChangeFilter());
@@ -753,7 +754,7 @@ public class WebInterface implements SessionProvider {
                pageToadlets.add(pageToadletFactory.createPageToadlet(new LogoutPage(emptyTemplate, this), "Logout"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new OptionsPage(optionsTemplate, this), "Options"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new RescuePage(rescueTemplate, this), "Rescue"));
-               pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, new PluginVersion(SonePlugin.getPluginVersion()), new PluginYear(SonePlugin.getYear()), new PluginHomepage(SonePlugin.getHomepage())), "About"));
+               pageToadlets.add(pageToadletFactory.createPageToadlet(new AboutPage(aboutTemplate, this, new PluginVersion(SonePlugin.getPluginVersion()), new PluginYear(sonePlugin.getYear()), new PluginHomepage(sonePlugin.getHomepage())), "About"));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("noPermission.html", this, noPermissionTemplate, "Page.NoPermission.Title")));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("emptyImageTitle.html", this, emptyImageTitleTemplate, "Page.EmptyImageTitle.Title")));
                pageToadlets.add(pageToadletFactory.createPageToadlet(new SoneTemplatePage("emptyAlbumTitle.html", this, emptyAlbumTitleTemplate, "Page.EmptyAlbumTitle.Title")));