You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2022/01/29 16:21:00 UTC

[jira] [Resolved] (WW-5112) Add ability (control flag) for TextProviders to prioritize reads from the default resource bundlest.

     [ https://issues.apache.org/jira/browse/WW-5112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart resolved WW-5112.
-------------------------------
    Resolution: Fixed

PR got merged

> Add ability (control flag) for TextProviders to prioritize reads from the default resource bundlest.
> ----------------------------------------------------------------------------------------------------
>
>                 Key: WW-5112
>                 URL: https://issues.apache.org/jira/browse/WW-5112
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.6
>            Reporter: James Chaplin
>            Assignee: Lukasz Lenart
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 2.6
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> This proposed improvement derives from a discussion on the Struts Developer List, with the general idea introduced by Greg Huber.
> Improvement: Introduce a new STRUTS_I18N_SEARCH_DEFAULTBUNDLES_FIRST control flag constant, and accompanying logic, with the default setting being _false_.
> The new control flag will be used by AbstractLocalizedTextProvider descendants to identify alternative I18N resource bundle lookup logic that prioritizes key lookup in the default resource bundles (in cases where such a distinction makes sense).
> The StrutsLocalizedTextProvider will use the flag to determine whether searches for resources will check the default bundles first (if the flag is _true_) or last (if the flag is _false_) for a match to a lookup key.  The GlobalLocalizedTextProvider only searches default bundles, so the flag will have no effect on it.
> The _false_ setting corresponds to the standard lookup logic for the TextProviders in Struts 2, and will be the default, so that there will be no impact to existing applications.  Applications that wish to enable the alternate lookup will do so by setting the flag to _true_ in their Struts configuration.
> With a _true_ setting, if a key exists in a default resource bundle (such as the application's default resource bundle), it will supersede any such key in other bundles (such as ones at the package or class level).  This will allow for a different resource bundle strategy when using the StrutsLocalizedTextProvider, and may be more efficient for applications that either only use a single global application resource bundle. or that use such a bundle for the vast majority of their I18N resource keys.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)