legacy-knowledge-base
公開されました Jun. 30, 2025

Language Keys are processed as Literal Text in custom MVC Portlets

written-by

Michael Tran

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

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

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

 

 

 

 

did-this-article-resolve-your-issue

legacy-knowledge-base