You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Paulo Cristovão de Araújo Silva Filho (Jira)" <de...@myfaces.apache.org> on 2022/10/30 15:02:00 UTC

[jira] [Created] (MYFACES-4491) Composite component does not reflect locale changes

Paulo Cristovão de Araújo Silva Filho created MYFACES-4491:
--------------------------------------------------------------

             Summary:  Composite component does not reflect locale changes
                 Key: MYFACES-4491
                 URL: https://issues.apache.org/jira/browse/MYFACES-4491
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 3.0.2, 2.3.10, 4.0.0-RC3
            Reporter: Paulo Cristovão de Araújo Silva Filho


*Bug*

According to VDL documentation ([2.3|https://jakarta.ee/specifications/faces/2.3/vdldoc/overview-summary.html], [3.0|https://jakarta.ee/specifications/faces/3.0/vdldoc/], and [4.0|https://jakarta.ee/specifications/faces/4.0/vdldoc/]), "[t]he normal localization rules for ResourceBundle would apply" for composite components localized with <composite_component_name>.properties files that uses #{cc.resourceBundleMap}. As such, when using a composite component named custom_button.xhtml and its associated custom_button.properties and custom_button_fr.properties, the change in locale definition should change the displayed messages.

In mojarra and myfaces (2.3, 2.3-next (myfaces), 3.0 and 4.0), the expected behaviour does not occur ([as recognized by BalusC in 2013|https://stackoverflow.com/questions/18134378/how-to-localize-jsf-composite-component]). His proposed hack still works for MyFaces, but I couldn't use it in recent versions of mojarra.

*To reproduce*

Example projects [localized-components|https://github.com/cristof/localized-components] and [localized-web|https://github.com/cristof/localized-web] are available to show the issue. Please install the first one into your local maven and then compile the second.
You may deploy localized-web into a tomee-plus versions 8.0.13 (jakarta8) and 9.0.0-MX (jakarta9) and check the behavior. Go to localhost:8080/localized-web and change the language.

Expected behavior

The button label should change reflecting the desired language, but it doesn't.

Solution

I'm opening three pull requests that fixes the issue for branches 2.3.18, 3.0.2 and 4.0



--
This message was sent by Atlassian Jira
(v8.20.10#820010)