We needed to create more payment options than what was provided out of the box. We created modules for check, credit card, and wire, copying all the code for the existing money order payment option and just changing the references. While doing this, we noticed that the names were not being localized but only on the site our options were scoped to. All other sites, the options localized fine.
While I am attaching one of our payment option modules that can be deployed to test this with, it is faster demonstrated with the groovy script I wrote that adds one of the existing payment options to a site.
Steps to Reproduce
- Make note of the titles of the payment options for the Liferay DXP site
- Grab the site id from the the Site Settings for the Liferay DXP site
- Set that id in the attached groovy script
- Execute the script
- Notice now that for the Liferay DXP site, the specified payment option (money-order) is no longer localized
It seems that https://github.com/liferay/com-liferay-commerce/blob/2.0.2/commerce-payment-web/src/main/java/com/liferay/commerce/payment/web/internal/display/context/CommercePaymentMethodGroupRelsDisplayContext.java#L228 is successfully localizing the names, which only happens for payment methods not scoped to the site.