Legacy Knowledge Base
Published 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 supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

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