Resource Bundles and Locales

Hi!!
I am researching Resource Bundles and how they work and have a question. Do you have to use Locales to determine which bundle to use? You see I am developing a product that will only be used in the US but will be used by several different companies. I would like to use a resource bundle for each company instead of for each country!! Is this possible? and if it is, how?
Thanks for your time

If you want to have default values, I would suggest using ResourceBundles and just sending in a Locale with the variant of the company. That way if your application ever needs to be localized it won't take much to change it. Your properties files would be named baseName_languageCode_CountryCode_Variant.properties.
It has been a great advantage for the program that I am developing.

Similar Messages

  • Resource Bundles and Embedded fonts - best practice

    Hello,
    I am in digging into creating a localized app and I would
    like to use embedded fonts.
    Ideally, I would like to have two locales (for example), each
    with a different embedded font and/or unicode range.
    For example, how do I set up my localized app so that EN uses
    Arial (Latin Range), and JP uses Arial Unicode MS with Japanese
    Kanji unicode range ?
    Note that I do know how to embed fonts with different ranges,
    I just don't know how to properly embed them into resource bundles
    and access them easily in style sheets.
    Thanks!
    -Daniel

    Hello!
    This is a very pertinent question, however as many things in life there is no one size fits all here.
    We basically recommend, as best practice, to allocate for each specific context only the estimated needed resources. These values should always come from a previous study on the network patterns/load.
    To accomodate for growth and scalability it is strongly advised to initially keep as many resources reserved as possible and allocate the unused resources as needed. To accomplish this goal, you should created a reserved resource class, as you did already, with a guarantee of 20 to 40 percent of all ACE resources and configure a virtual context solely with the purpose of ensuring that these resources are reserved.
    As you might already know ACE protects resources in use, this means that when decreasing a context's resources, the resources must be unused before then can be reused by other context. Although it is possible to decrease the resource allocations in real time, it typically requires additional overhead to clear any used resources before reducing them.
    Based on the traffic patterns, number of connections, throughput, concurrent SSL connections , etc, for each of the sites you will be deploying you will have a better idea on what might be the estimated needed resources and then assign them to each of the contexts. Thus this is something that greatly depends on customer's network environment.
    Hope this helps to clarify your doubts.

  • Unable to resolve resource bundle "myResources" locale "en_US" ?

    Hi All,
                        I have created two locales one is en_US and Second one is fr_FR. I placed these two files in locale file. These files directory structure is
                    ......\src\locale\en_US and .....\src\locale\fr_FR . After  placing these two files in the project i was compile my application and it is showing just like unable to resolve resource bundle "myResources" locale "en_US"...  can any one help me how to configure the resource bundle in my flex application... i dont have exposure to resource bundle earlier. So plese tell me the configurations step by step.. how to configure...
                           My resource property name is myResource.properties .
    Thanks
    Ram

    If you have already followed the correct directory structure. Then please check the following,
    1. change the compiler arguments, to "-locale=en_US,fr_FR -source-path=locale/{locale}"
    you can find the compiler arguments, by right-clicking over the project name on the flex builder, properties-> flex compiler->compiler options.
    2. please check whether both the locale properties files uses the correct encoding. If not change them to "UTF-8"
    you can find this, by right-clicking over the properties file on the flex builder, properties->resources->text file encoding

  • [svn:fx-trunk] 12663: Adding the resource bundle and fat-swc targets for osmf and textlayout.

    Revision: 12663
    Revision: 12663
    Author:   [email protected]
    Date:     2009-12-08 12:22:31 -0800 (Tue, 08 Dec 2009)
    Log Message:
    Adding the resource bundle and fat-swc targets for osmf and textlayout.  Also for osmf adding the doc target.  This new format that I added to the two project build files will be what we will use going forward for all projects.  I have all the other projects modified and plan on checking them in soon.  The format change will make adding new locales easier as well as adding the fat-swc target when needed.
    QE notes: no
    Doc notes: no
    Bugs: no
    Reviewer: gaurav
    Tests run: checkintests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/build.xml
        flex/sdk/trunk/frameworks/projects/osmf/build.xml
        flex/sdk/trunk/frameworks/projects/textLayout/build.xml
    Added Paths:
        flex/sdk/trunk/frameworks/projects/osmf/bundles/
        flex/sdk/trunk/frameworks/projects/osmf/bundles/en_US/
        flex/sdk/trunk/frameworks/projects/osmf/bundles/en_US/osmf.properties
        flex/sdk/trunk/frameworks/projects/textLayout/bundles/en_US/textLayout.properties
    Removed Paths:
        flex/sdk/trunk/frameworks/projects/osmf/src/OSMFDocClasses.as
        flex/sdk/trunk/frameworks/projects/textLayout/bundles/en_US/empty.properties

    Thats good news.

  • Resource bundles and sort order?

    I am wanting to use a resource bundle to store entries that can then be displayed sorted in a combo-box component in an HTML page, though it does not seem to be working out. Basically I am using JSTL and Struts2, and the select component can take various collection types including a Map. As an alternative I tried using a properties file, but this has two issues:
    - I loose the locale resolution mechanism provided by ResourceBundle
    - The order in which the entries appeared in the file is lost (it does not inherit from LinkedHashMap)
    What approach would you recommend to loading a localised list and then ensure it displays in the order of the display values. I looked around the net, but I am yet to find anything of use.

    If you want to have default values, I would suggest using ResourceBundles and just sending in a Locale with the variant of the company. That way if your application ever needs to be localized it won't take much to change it. Your properties files would be named baseName_languageCode_CountryCode_Variant.properties.
    It has been a great advantage for the program that I am developing.

  • Resource Bundle and EJB

    Hi All,
    Has anyone tried successfully loading a ResourceBundle properties file from within a EJB? I need to localize messages based on user locale. Hence the need for ResourceBundle.
    I read about set the EJB classloader's classpath with a reference to the resource bundle, but I don't know how and where to do this...
    Any help appreciated.
    Thanks and regards!

    Hi all,
    First, thanks all for your answers!! The suggestion from Warnerja has worked. I did packaged the resource files into a .jar file and imported it into my Enterprise App. Thus, I did make a reference in both web project and ejb project.
    Hello Dhinojosa, in answer to your question, my project objectives is provide full internationalization support to my application. My doubt is how to implement internationalization support on an application composed by one Web app project one Ejb project and both tiers have to access the resources...
    Thanks and regards,
    Flor.

  • Resource Bundle and encoding

    Hi,
    I'm too confused abt the encoding stuff that java does. First of all, I have a resource bundle written in chinese (Big5), in my program I've used getString(key) to retrieve the corresponding value to be displayed on the html page. I've got a few questions.
    1) From what I've understand, String is always in Unicode. Does that mean that when the string I've retrieved from Resource Bundle is converted to Unicode?
    2) When I do String a = ResourceBundle.getString(key), in order to display the correct Chinese character, I should do new String(a.getBytes("Big5")), right?? But i've got some weird characters. Why?
    3) It will work if I use new String(a.getBytes(), "Big5").
    I know that if I use a.getBytes(), it will return me bytes[] encoded using the system default encoding (in my case, Cp1252). But why is it returning me the correct string since my Resource Bundle is written in "Big5"? Or will getString(key) do some encoding?
    4) It will also work if I use this:
    BufferedReader reader = new BufferedReader(new InputStreamReader(new StringBufferInputStream(a),"Big5"));
    the display will be correct, why is this so? Is there any other class besides StringBufferInputStream as it is deprecated.
    I've been researching on this encoding topic for quite some time but didn't manage to understand it at all. Please help!! Thanks!

    Hi,
    I'm too confused abt the encoding stuff that java
    does. First of all, I have a resource bundle written
    in chinese (Big5), in my program I've used
    getString(key) to retrieve the corresponding value to
    be displayed on the html page. I've got a few
    questions.PropertyResourceBundles should be converted using the native2ascii tool. ListResourceBundles should be compiled with the -encoding flag. In your case:
    1. native2ascii -encoding Big5 resource.txt bundle.properties, or
    2. javac -encoding Big5 bundle.java
    >
    1) From what I've understand, String is always in
    Unicode. Does that mean that when the string I've
    retrieved from Resource Bundle is converted to
    Unicode?Once you have compiled the ResourceBundle, all text objects are represented as Unicode. Your retrieved String is Unicode text.
    2) When I do String a = ResourceBundle.getString(key),
    in order to display the correct Chinese character, I
    should do new String(a.getBytes("Big5")), right?? But
    i've got some weird characters. Why?No, you should not try to convert the String further. You have a perfectly good Unicode String at that point. You have weird characters after the above operation because you are converting Big5 text to a Unicode String using the default charset on your host...which may not be Big5 at all. In fact, it is not Big5 since you say you see strange characters.
    3) It will work if I use new String(a.getBytes(),
    "Big5").
    I know that if I use a.getBytes(), it will return me
    bytes[] encoded using the system default encoding (in
    my case, Cp1252). But why is it returning me the
    correct string since my Resource Bundle is written in
    "Big5"? Or will getString(key) do some encoding?Do not convert the String. Your operations with getBytes and new String() are an attempt to recreate the original String...which you already have...it is unnecessary.
    4) It will also work if I use this:
    BufferedReader reader = new BufferedReader(new
    InputStreamReader(new
    StringBufferInputStream(a),"Big5"));
    the display will be correct, why is this so? Is there
    any other class besides StringBufferInputStream as it
    is deprecated.Do not convert the String. It is already usable.
    >
    I've been researching on this encoding topic for quite
    some time but didn't manage to understand it at all.
    Please help!! Thanks!String a = bundle.getString(SOME_KEY);
    component.setText(a);
    This should be sufficient to retrieve and display the text, assuming all else is correct.
    Regards,
    John O'Conner

  • Error: Unable to resolve resource bundle "fiber" for locale "en_US".

    Hi all,
    Im trying to create a resources.swf file for the purpose of dynamic localization of our application. However, I keep getting this error thrown when I try to run the ant script.
    Im running Flash Builder 4, the sdk is Flex 4.5.1 with AIR 3.0 and a Windows 7-64 bit machine (just mentioning as a few posts associated it with the OS).
    After searching some of the forum posts, ( http://forums.adobe.com/thread/606383)
    1> I checked the eclipse.ini file and found the following lines already in there.
         -nl
         en_US
    2> My compiler options already has -locale en_US specified.
    3> I tried including the swc files as suggested in the referenced thread, both as a referenced library and by manually copying the swcs to the project, but neither of them helped.
         "import 2 swc folders (Under Properties -> Flex Build Path -> Library Path):
         /Applications/Adobe Flash Builder 4/plugins/com.adobe.flexbuilder.dcrad_4.0.0.272416/dcradSwcs/4.0/libs
         and
         /Applications/Adobe Flash Builder 4/plugins/com.adobe.flexbuilder.dcrad_4.0.0.272416/dcradSwcs/4.0/loca le"
    Thanks in advance for your help.
    My build.xml file looks as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <project name="appName" basedir="." default="main">
              <taskdef resource="flexTasks.tasks" classpath="${basedir}/lib/flexTasks.jar"/>
              <!-- CHANGE TO YOUR FLEX DIRECTORY //-->
              <property name="FLEX_HOME" value="C:/Users/abc/Documents/flex_sdk_4.5.1.21328_AIR3.0"/>
              <property name="APP_ROOT" value="appName"/>
              <target name="main">
                        <antcall target="en_US"></antcall>
    <!--                    <antcall target="de_DE"></antcall>-->
              </target>
              <target name="en_US">
                        <mxmlc>
                                  <locale>en_US</locale>
                                  <source-path>locale/{locale}</source-path>
                                  <include-resource-bundles>appResource</include-resource-bundles>
                                  <include-resource-bundles>SharedResources</include-resource-bundles>
                                  <include-resource-bundles>collections</include-resource-bundles>
                                  <include-resource-bundles>components</include-resource-bundles>
                                  <include-resource-bundles>containers</include-resource-bundles>
                                  <include-resource-bundles>controls</include-resource-bundles>
                                  <include-resource-bundles>core</include-resource-bundles>
                                  <include-resource-bundles>effects</include-resource-bundles>
                                  <include-resource-bundles>formatters</include-resource-bundles>
                                  <include-resource-bundles>layout</include-resource-bundles>
                                  <include-resource-bundles>logging</include-resource-bundles>
                                  <include-resource-bundles>messaging</include-resource-bundles>
                                  <include-resource-bundles>rpc</include-resource-bundles>
                                  <include-resource-bundles>skins</include-resource-bundles>
                                  <include-resource-bundles>sparkEffects</include-resource-bundles>
                                  <include-resource-bundles>styles</include-resource-bundles>
                                  <include-resource-bundles>textLayout</include-resource-bundles>
                                  <include-resource-bundles>utils</include-resource-bundles>
                                  <include-resource-bundles>validators</include-resource-bundles>
                                  <include-resource-bundles>fiber</include-resource-bundles>
                                  <output>locale/en_US/appName.swf</output>
                        </mxmlc>
              </target>
    </project>
    Thanks & Regards,
    AJ

    I did import the swcs first as a referenced library, by
    Project-> Properties -> Flex Build Path -> Library Path -> add swc folder.
    Secondly, I manually copied the swcs from the folders at
    1>
    C:\Program Files (x86)\Adobe\Adobe Flash Builder 4 Plug-in\eclipse\plugins\com.adobe.flexbuilder.dcrad_4.0.0.272416\dcradSwcs\4.0\libs
    files present: fds.swc, fiber.swc and serializers.swc
    2>
    C:\Program Files (x86)\Adobe\Adobe Flash Builder 4 Plug-in\eclipse\plugins\com.adobe.flexbuilder.dcrad_4.0.0.272416\dcradSwcs\4.0\locale
    files present: fds_rb.swc, fiber_rb.swc and serializers_rb.swc
    into the libs folder of my project .

  • I'm getting an error "Could not find compiled resource bundle 'layout' for locale 'en_US'."

    I thought I would update to the latest trunk version of the sdk.  When I run my code I keep getting this Error being thrown:
    "Error: Could not find compiled resource bundle 'layout' for locale 'en_US'."
    It worked fine with the beta sdk and nightly builds from a long time before that.  The error occured in builds 7573 and 7830, so what ever changed happened before then.  I put a break point in there, and other resource bundles are being loaded ok.
    My project uses RSLs and modules. I'm using Flash Builder beta.
    I'm not familiar with resource bundles and not sure what to look for.  Any ideas as to what to try or where to look?
    Is there something I need to update to run the latest code?
    Is the the appropriate place to post questions regarding the nightly builds?  Or should I be asking somewhere else?
    Thanks!
    PS Here is the full stack trace if it gives anyone more ideas:
    Error: Could not find compiled resource bundle 'layout' for locale 'en_US'.
        at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()[E:\dev\trunk\frameworks \projects\framework\src\mx\resources\ResourceManagerImpl.as:339]
        at mx.resources::ResourceManagerImpl/installCompiledResourceBundles()[E:\dev\trunk\framework s\projects\framework\src\mx\resources\ResourceManagerImpl.as:268]
        at mx.core::FlexModuleFactory/installCompiledResourceBundles()
        at mx.core::FlexModuleFactory/docFrameHandler()
        at flash.display::MovieClip/nextFrame()
        at mx.core::FlexModuleFactory/deferredNextFrame()
        at mx.core::FlexModuleFactory/update()
        at mx.core::FlexModuleFactory/moduleCompleteHandler()

    hi
    also add the following
    to my compiler auguments:
    -locale en_US    -source-path=locale/{locale}    -allow-source-path-overlap=true
    and to actionScriptProperties I have the following where path= is the location of your locale folder
    <compilerSourcePathEntry kind="1" linkType="1" path="/locale/{locale}"/>
    Not sure if this is the correct way to do it, but it stopped me getting any errors.

  • Resource Bundle issue in ATG 10 migration

    Hi,
    Migrating from ATG 2007.1 to 10 & getting issues with resource bundle for Merchandizing pages in BCC.Page is loading the StoreMerchandisingIcons.swf from the WAR module.Additionally the page is throwing error #404 for StoreMerchandisingIcons_en.swf & StoreMerchandisingIcons_en_US.swf (which is not available in the WAR)
    This URL is loading fine
    http://localhost:8180/store-merchandising/StoreMerchandisingIcons.swf
    404 for these URLs
    http://localhost:8180/store-merchandising/StoreMerchandisingIcons_en.swf
    http://localhost:8180/store-merchandising/StoreMerchandisingIcons_en_US.swf
    Configured the resource bundle & default locale in the StoreConfiguration but still I am getting this error.Am I missing anything?
    Debugged through FireBug , not getting any error in the page or Jboss console
    Thanks in advance!
    Mani

    Hi,
    Application.getResourceBundle(FacesContext, String) retrieves the named ResourceBundle from faces-config.xml and is indeed a good way to access a bundle from an application.
    Now, however, you're trying to access a Model layer bundle which is itself an aberration imho. I already mentioned that in numerous posts in the past, but I won't ever think that specifying localized information in the model layer is a good design. At best I could accept it for default value, but localized message it in no way a business logic concern, it's pretty much a pure presentation one. The model layer should return error code/keys and parameters and it should be the responsibility of the view layer to translate it in an understandable version for the target client (human or automated). Can't you use a view layer bundle?
    Regards,
    ~ Simon

  • Resource bundle in shared library?

    Is it possible to create a resource bundle in a shared library so you can use the same resource bundle in different application?
    We are creating different ADF application and each of them should use the same resource bundle.
    I tried creating a new project that only contains the resource bundle and then add this to my jspx page:
    <c:set var="res"
             value="#{adfBundle['general.resources.generalBundle]}"/>When i do this, he can't find any entries. When i change the project properties and configure to use a single bundle for the entire project, this works.
    How can i share a bundle so each application does not need to create or copy/paste the bundle?
    Is it possible to deploy the bundle as a shared library? Even if their is nothing else, not even a single java class?
    Edited by: Yannick.O on Jul 28, 2010 10:45 AM

    Try to create a JAR with the resource file in it (under /META-INF) and add it as a library in your project.
    If it does not work, try to create a faces-config.xml file inside that directory that declares the resource file.
    I think it gets merged at runtime with the config of your application and resource bundle should be available.

  • Error in Loading Resource Bundle in JSP

    Hi
    I have one Resource Bundle which working well in my JSP page
    i declared as below
    <f:loadBundle basename="com.ApplicationLabels" var="lblbundle"/>
    Ok then i want to add another new resource bundle and i put it below the first loadBundle tag
    <f:loadBundle basename="com.newLabels" var="newbundle"/>
    But when i access my JSP page it keeps giving me
    Exception Details: javax.faces.el.PropertyNotFoundException
    Error testing property 'test' in bean of type null
    Possible Source of Error:
    Class Name: com.sun.faces.el.PropertyResolverImpl
    File Name: PropertyResolverImpl.java
    Method Name: getType
    Line Number: 342
    What are the things i need to configure after i creatting properties file for my Application Messages in JSP page
    any idea about this exception?
    Thanks.

    Hi Voodi,
    in the record i have many columns that refered to date, i have: Valid-from, Valid-To H, created on, Valid From, Valid To- i don't know where is the specified column to check the required format, in PSA in the data package 19 i have 13755 Records posted and i have checked many records to control these columns but i don't find something that demonstrate me a difference between the format, i don't know why the error signalated is only 6701...but you think is only a problem of format it's not not somthing that i have to signalated to the person who works on R/3 if there is something to correct in the datasource?
    Thanks
    Bilal

  • Reloading external resource-bundle

    Hi,
    Version : Jdev 11.1.1.4.0 & 11.1.1.5.0
    I was wondering , if there is any possible way to reload faces-config.xml.
    My Scenario's :
    *1.*
    I have configured a bundle in faces-config.xml
         <resource-bundle>
          <base-name>test.backing.loadMyBundle</base-name>
          <var>rbMyBundle</var>
        </resource-bundle>and my bundle class loads data from an external propertyFile
    public class loadMyBundle extends ListResourceBundle {
      protected Object[][] getContents() {
          PropertyResourceBundle resource= null;
            try {
                File file = new File("C:\myBundle.properties");
                fileInputStream = new FileInputStream(file);
                resource = new PropertyResourceBundle(fileInputStream);
            if (resource != null) {          
                     filling data from loaded property file into contents
            } catch (IOException ioException) {
            } catch (Exception exception) {
            return contents;
    }This getContents method is just called once even if I have changed a label value, where as my scenario to call "getContents" method is called when the resource file is changed or once per session atleast.
    *2.*
    I tried using loadBundle
    <f:loadBundle basename="test.backing.loadMyBundle"
                                 var="rbMyBundle"/>but this refers & loads the property file again & again.
    <br>
    My requirment :
    Scenario 1. Is there any way, to reload faces-config.xml every time the session is created. So that new property file is loaded.
    or Scenario 2. Is there any way, I can cache the already loaded bundle & reuse it instead of making a IO call to load file.
    Thanx in advance.
    -Neha..

    Hi,
    maybe these links will help you
    http://technology.amis.nl/2012/07/11/adf-11g-label-modifications-and-persisting-resource-bundle-changes/
    http://technology.amis.nl/2012/08/14/refresh-resource-bundle-from-within-the-adf-application-to-absorb-changes-in-database-backed-bundles/

  • Resource Bundle being overwritten

    Hello,
    We are upgrading from jhs 9.03 to jhs 9.0.4.4. A new feature is resource bundles and that is were we are having problems with.
    We have two jhs subapplications and I want to use the same resource bundle class for both applications. The problem is that every time I start JAG the class is being overwritten and not append to the existing class.
    There is a other project that also uses jhs and has two subapplications. They don't have that problem. There the class is not overwritten every time.
    I first tried using JDeveloper 9.0.3.1, but also tried it with JDeveloper 9.0.3.3. Both had this problem.
    Does anyone have a idea what this could be? When does JAG decide that the file should be overwritten?
    Thanx,
    Dennis

    Dennis,
    The JAG loads the existing COMPILED resource bundle. So, make sure you compile your resource bundle before you run the JAG, and make sure it is on the classpath of your project.
    Lastly, make sure you set "Override NLS Resource Bundle Entries" to false in the Application Structure Editor.
    Steven Davelaar,
    JHeadstart Team.

  • Database resource bundles

    Hi, our ADF developers have proposed moving to database resource bundles and was wondering if this was something we could consider for our portal Java portlets as well? Is this technique unique to ADF or should it be applicable across all Java development?

    Interestingly, the guys that proposed using Database resource bundles were talking about their main issue being that they could not invalidate the cache in order to have the ADF pick up changes in the bundle unless they bounced the APP server.

Maybe you are looking for

  • 865PE Neo2(6728) D-Bracket hangs at Memory Detection Test

    This is terribly annoying... I just bought the mother board... Its a 865PE Neo2(6728)800mhzFSB the processor is P4 2.4ghz 800mhz, 512k l2-Cache.  I dont know who made it like i know nothing about northwood or whatever, it says Intel on the box...  I

  • My iPod 5th gen won't charge:'(

    As stated in the tittle my iPod won't charge. I have looked at a lot of the similar posts but none of them are helpful. I can NOT get into DFU mode, I HAVE read both iPod touch: Hardware troubleshooting and iPhone and iPod touch: Charging the battery

  • Virtual PC on Windows 7 (32 bit) and T4300 processor

    Hi, I bought my laptop specifically to run Virtual PC and deliberately got a 4Gb machine. I now find out that the T4300 processor doesn't support hardware assisted virtualisation and seemingly you then can't run VPC? I'm not interested in XP mode - I

  • Problems with user group

    Hi, i created a new user group with some administrative rights: Access Administration Advanced Document Submission Create Communities Create Community Infrastructure Create Folders Create Portlets Edit Own Profile Then, i created a user and added to

  • Ehancement Spot for Vendor Down Payment Request F-47

    Hi I am trying to post a DP Request to Vendor with reference to a PO Document, which consists of various taxes. PO Base amount is 150 and Tax value is 25. When I am trying to pass a DP Request for more than 150 system is giving the error message "Ord