Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

16.3. Labels


JSF supports the internationalization of user interface labels and descriptive text with the <f:loadBundle />. In Seam applications, you can either take this approach, or use the Seam messages component to display templated labels with embedded EL expressions.

16.3.1. Defining labels

Make your internationalized labels available with Seam's java.util.ResourceBundle, available to the application as a org.jboss.seam.core.resourceBundle. By default, Seam uses a resource bundle named messages, so you will need to define your labels in files named messages.properties, messages_en.properties, messages_en_AU.properties, etc. These files usually belong in the WEB-INF/classes directory.
So, in messages_en.properties:
Hello=Hello
Copy to Clipboard Toggle word wrap
And in messages_en_AU.properties:
Hello=G'day
Copy to Clipboard Toggle word wrap
You can select a different name for the resource bundle by setting the Seam configuration property named org.jboss.seam.core.resourceLoader.bundleNames. You can even specify a list of resource bundle names to be searched (depth first) for messages.
<core:resource-loader> 
  <core:bundle-names> 
    <value>mycompany_messages</value> 
    <value>standard_messages</value>       
  </core:bundle-names> 
</core:resource-loader>
Copy to Clipboard Toggle word wrap
To define a message for one particular page, specify it in a resource bundle with the same name as the JSF view ID, with the leading / and trailing file extension removed. So, we could put our message in welcome/hello_en.properties if we only needed to display the message on /welcome/hello.jsp.
You can even specify an explicit bundle name in pages.xml:
<page view-id="/welcome/hello.jsp" bundle="HelloMessages"/>
Copy to Clipboard Toggle word wrap
Then we could use messages defined in HelloMessages.properties on /welcome/hello.jsp.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat