1 Reply Latest reply on Dec 13, 2012 6:34 AM by kenfinni

    Issue using @MessageBundle with .i18n.properties file

    a.andreev

      I am trying to configure internationalized messages using the following guide http://docs.jboss.org/seam/3/solder/latest/reference/en-US/html_single/#implementation-classes

      My Idea is to bind @MessageBundle interface with .i18n.properties file.

      However I can't make the configuration work properly.

       

      I created mypackage.ValidationMessages interface:

       

      @MessageBundle

      public interface ValidationMessages

      {

          String testMessage();

      }

       

      In the same package I created the properties file ValidationMessages.i18n.properties

      The file contains a single line:

       

      testMessage=This is test message

       

      According to the documentation I would expect that my interface method will be bound to the constant from i18n.properties file.

      But when I try to compile I get an error:

       

      error: All message bundles and message logger messageMethods must have or inherit a message.

       

      Which means that I probably should add @Message annotation to my method testMessage().

      When I do that, it compiles fine. But when I use interface ValidationMessages from my beans, I see only the hardcoded text - not from the properties file.

       

      I would appreciate any advice on how this setup can be configured properly.

       

      I am using Seam 3.1.0.Final

        • 1. Re: Issue using @MessageBundle with .i18n.properties file
          kenfinni

          From recollection the properties files are for configuring non english versions of the message text only.

           

          The english text is specified in the @MessageBundle interface, and non english versions in the property files.  So your property file would need to be something like ValidationMessages_fr.i18n.properties instead.