Issue
- When creating a MVC Portlet that leverages language keys, language key output is presenting as the literal text, rather than the key value
- For example:
- Language key in view.jsp:
-
<b><liferay-ui:message key="languagekeys.caption"/></b>
-
- Language Key Value in language.properties:
-
languagekeys.caption=Hello from LanguageKeys!
-
- Expected Output: "Hello from LanguageKeys!"
- Actual Output: Languagekeys.caption
- Language key in view.jsp:
Environment
- Liferay 2024.Q1.12
- Liferay Workspace
Resolution
- This issue has been verified on lower versions of Liferay Workspace
- Updating Liferay Workspace to the most recent version (for example: 10.1.9) and rebuilding the modules may resolve the issue
- To check if the correct fix is applied, check if the following "Provide-Capability" section is added to the bnd.bnd file
-
Bundle-Name: Test2Portlet
Bundle-SymbolicName: test2portlet
Bundle-Version: 1.0.0
Export-Package: test2portlet.constants
Provide-Capability:\
liferay.language.resources;\
resource.bundle.base.name="content.Language"
Additional Information