This discussion is archived
3 Replies Latest reply: Sep 3, 2013 1:57 AM by user5636757 RSS

MissingResourceException for xliff bundle, same configuration works for properties bundle

user5636757 Newbie
Currently Being Moderated

hi,

it's seems very small issue but i am not able to figure out.

if i use properties file resource bundle, i do following:

1. create PortalBundle.properties file in portal package

2. in proect properties, specify resource bundle type as properties file

3. in faces-config.xml, add following entry:

<resource-bundle>

      <base-name>portal.PortalBundle</base-name>

      <var>portalBundle</var>

    </resource-bundle>

    <locale-config>

      <default-locale>en</default-locale>

    </locale-config>

4. in jspx, i can now use this resource bundle:

<f:loadBundle basename="portal.PortalBundle" var="portalBundle"/>

 

<af:goLink text="#{portalBundle.YOUR_COMPANY}" id="pt_ot4" destination="/"

                           inlineStyle="font-size:x-large; color:White;"/>

 

it all works fine.

 

however i want to use xliff (xlf file) type resource bundle, i did similar configuration:

1. create PortalBundle.xlf file in portal package. it has following content:

<?xml version="1.0" encoding="UTF-8" ?>

<xliff version="1.1" xmlns="urn:oasis:names:tc:xliff:document:1.1">

  <file source-language="en" original="portal.PortalBundle"

        datatype="x-oracle-adf">

    <body>

      <trans-unit id="YOUR_COMPANY">

        <source>Your Company</source>

        <target/>

      </trans-unit>

    </body>

  </file>

</xliff>

 

 

2. in project properties, specified bundle type as xliff.

3rd and 4th steps are same as above.

 

however surprisingly i get missing resource exception:

 

java.util.MissingResourceException: Can't find bundle for base name portal.PortalBundle, locale en

    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)

    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)

 

 

i am confused what else is required for xliff bundle?

 

thanks.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points