public final class EffectiveI18nDescriptors extends java.lang.Object
The message bundles that actually participate, in the order Spring Boot should consult them.
Filtering happens here, once, and both consumers read the result: the base-name list handed to
spring.messages.basename, and the locales AvailableLocaleResolver offers. Were they
to filter separately, a plugin excluded from message resolution could still advertise its language
in a locale picker — offering a translation whose messages cannot resolve.
Only plugins the application actually discovered contribute. A descriptor whose plugin was evicted, filtered out by environment, or failed to load is ignored even though its jar is still on the classpath.
Spring's ResourceBundleMessageSource resolves a code against base names in order and
takes the first match. The message source Grails used previously merged plugin bundles with
Map.putAll while iterating GrailsPluginManager.getAllPlugins(), so the last
plugin in that iteration overwrote earlier ones. getAllPlugins() returns plugins in
topological order, so reversing that order and letting the first match win reproduces the
previous precedence exactly.
Note this cannot be reasoned about by analogy with plugin configuration, which uses the opposite convention: there, earlier plugins take precedence.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public java.util.List<java.lang.String> |
basenames()Base names in precedence order: the application's own first, then each participating plugin's in reverse topological order. |
|
public java.util.List<java.lang.String> |
locales()The locale identifiers ( de, pt_BR) the participating bundles are translated
into, deduplicated and sorted. |
|
public static EffectiveI18nDescriptors |
of(java.util.List<I18nDescriptor> descriptors, java.util.List<java.lang.String> pluginNamesInTopologicalOrder, boolean includePluginBundles)Resolves the effective set. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Base names in precedence order: the application's own first, then each participating plugin's in reverse topological order.
null The locale identifiers (de, pt_BR) the participating bundles are translated
into, deduplicated and sorted.
nullResolves the effective set.
descriptors - every descriptor found on the classpath, in any orderpluginNamesInTopologicalOrder - the names of the plugins the application discovered, in
the topological order GrailsPluginManager.getAllPlugins() usesincludePluginBundles - whether plugin bundles participate at all