Skip to content

Commit

Permalink
Use the MetaClassLoader.debugLoader to find localized resources
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-beck committed Nov 12, 2018
1 parent 7d5c630 commit 492bb16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
@Symbol("localizationMonitor")
@Restricted(NoExternalUse.class)
public class LocalizationMonitor extends AdministrativeMonitor {

// TODO extend with a check for the Metaclassloader.debugLoader

private PluginWrapper plugin;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.MetaClassLoader;
import org.kohsuke.stapler.WebApp;
import org.kohsuke.stapler.jelly.JellyFacet;

Expand All @@ -39,5 +40,9 @@ public static void initialize() {
// Override where the Jelly views look for resource bundles
JellyFacet facet = webApp.getFacet(JellyFacet.class);
facet.resourceBundleFactory = new ResourceBundleFactoryImpl();

// Provide a fallback source for resources
// TODO restrict to localization plugins only, or perhaps add a dedicated feature to Stapler for this
MetaClassLoader.debugLoader = new MetaClassLoader(Jenkins.get().pluginManager.uberClassLoader);
}
}

0 comments on commit 492bb16

Please sign in to comment.