Custom formatting with resource bundles

This question was posted in response to the following article: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6119c-7ff4.html

Any pattern letter using by DateTimeFormatter.dateTimePattern has to be case-sensitive as defined here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/globalization/Dat eTimeFormatter.html#setDateTimePattern()
The example above won't be work using Flex 4.6 + FlashPlayer 11. For example: The DATE_FORMAT defined within the British locale property file has to be dd/MM/yy (not DD/MM/YY).
-Jens
http://www.websector.de

Similar Messages

  • How to work with Resource Bundle

    Hi
    I work with JDeveloper 1013 and making an application with ADF Faces and BC.
    I'd like to internationalize my own application. How can I do this with Resource Bundle(java). How to ask which language the browser wants, ...

    There is a chapter in the ADF Developer Guide that explains this.
    Read it and let us know if you still have questions.

  • ADF FACES: af:messages does'nt display label with resource bundles

    Hi,
    There is a problem with the af:messages component and error messages containing labels (such as Value is Required error message for required fields).
    If I have an af:inputText with it's label property refering to a resource bundle loaded using the f:loadBundle action, when the Value is Required message is displayed, I get "" for the field name.
    If I replace the label property with a constant value or with an expression refering to a managed bean property, then the label is properly displayed in the error message.
    I suspect this has to do as to when the action of getting the label is done. Maybe the bundle is not availlable at that time. Anyway, this is a bummer as it mean that we cannot use the f:loadBundle action to load resource bundles.
    This happen with AE11. I have not tested this with EA12.

    Thank's!
    I'll try EA12 when I have the time.
    I also found that in our JSPs, we've put the f:loadBundle ouside of the f:view tag. I'll fix that in our codebase.
    While researching a fix, I found out that using a managed bean (which implement Map interface) to load the bundle based on the name refered in the expression language is a lot more intuitive and allow for an easier management of the different resource bundle than the f:loadBundle tag.
    Basically, our EL expression are now #{bundles.bundleName.property} we replace any "_" in bundleName with "." and then lookup this name as a ResourceBundle with the locale of the view. We keep the managed bean in the request scope it remember each bundle it loaded.
    We could have done it with a custom VariableResolver. Maybe a future release of the JSF spec could provide a standard variable name that would implement the same behaviour. This way, one does not have to load each bundles before hand and only the bundles accessed by the JSP will be loaded.

  • How to deal with resource bundle in multiple applications system

    Hi all,
    I'm building new system depend on the method of
    one common model with multiple applications for the view objects
    my JDeveloper version 11.1.2.3
    my Question
    How can i merge the resource bundle for these applications
    as in the common model exists file for resouce bundle
    and each other applications contains resource bundle files how can i merge all these file in one Resource bundle file ?
    Edited by: 985756 on Apr 2, 2013 12:39 AM

    Hi,
    Please check anerjusb blog for your answer
    Hoping this will help you.
    http://andrejusb.blogspot.in/2009/12/reusing-resource-bundles-from-different.html
    Thanks & Regards,
    Vikas

  • Custom error messages - resource bundle

    Greetings everyone!
    My JDev version is:  11.1.2.3.0
    I've seen several threads in OTN and outside about this topic, but they seem confused (or may be it's me that is missing something).
    I have this current situation, when because of the presence of a FK in the database, when a try to delete a certain record, a popUp shows up ORA-02292 error code. I don't want to enable cascade deletion (i don't want anything to be deleted in that case at all), so i was trying to customize the error message. I've created a java class and declared it as a resource bundle in the Model project. The content is this:
    public class CustomErrorMessages extends ListResourceBundle {
        private static final Object[][] sMessageStrings = new String[][] {
    {"25014", "Another user has made a modification to this record meanwhile. Please cancel your changes!"},
        {"CREDITOR", "This party is assigned as a creditor/debtor in this contract. It cannot be deleted!"},
        {"DEBTOR", "This party is assigned as a creditor/debtor in this contract. It cannot be deleted!"}
        /**Return String Identifiers and corresponding Messages in a two-dimensional array.
        protected Object[][] getContents() {
            return sMessageStrings;
    25014 - refers to JBO-25014 and it works fine. Now CREDITOR/DEBTOR are the FK mentioned above. If i put 02292  or ORA-02292  instead of them it doesn't work at all. If i let them just like this, it works if i run the Application Module only, but not when i run the application. What does it mean?
    Also, i've noticed that the ViewController project has also a "Resource Bundle" section in the properties, but the content is disabled. Should i do any kind of configuration to make it work?
    Thank you in advance.

    Hi,
    this blog is as close as it gets to your requirement
    http://www.jobinesh.com/2011/03/customizing-business-components-error.html
    Frank

  • Problem with resource bundle messages written inside script of jsf included

    Hi,
    I have a main jsf page with the name Details.jsp.In this page I included Contacts jsf page.I am using resouce bundle for my application.I written all the output text tags with this resouce bundle keys.And I written the Details main page javascript alerts with this resource bundle correctly.But the problem is,I am having script alrts in my included jsf apge i.e. in Contacts page.When I write the script alerts with the resource bundle keys,it is not displaying properly.
    ---------------------------------------------------------------------Details.jsp--------------------------------------
    <f:loadBundle basename="Details_en" var="msg"/>
    <f:view>
    <head>
    <script>
    function saveFn()
    var d=document.getElementById('dform:dinputtext').value;
    if(d=='')
    alert('<h:outputText value="#{msg.requiredValidationMsgkey}"/>');
    return false;
    if(emailValidation()==false)
    return false;
    </script>
    </head>
    <body>
    <h:form id="dform">
    <h:outputText value="#{msg.nameHeader}"/>
    <h:inputText value="#{Bean.name}" id="dinputtext"/>
    <jsp:include page="/Contacts.jsp"/>
    <h:commandButton value="Save" onclick="if(saveFn()==false) return false;" action="#{Bean.saveAction}"/>
    </h:form>
    </body>
    </f:view>
    -------------------------------------------------Contacts.jsp----------------------------------------
    <script>
    function emailValidation()
    var em= document.getElementById('dform:cSubView:cemailtext').value;
    if(em=='')
    alert('<h:outputText value="#{msg.emailValidationMsgKey}"/>');
    return false;
    </script>
    <f:subview id="cSubView">
    <h:inputText value="#{CBean.email}" id="cemailtext" />
    </f:subview>
    The alert message in SaveFn is getting appeared coorectly.But in the function emailValidation is not geting dispalyed correctly.It is appearing as normat output text in the page,but not as an alert.

    Thanks for the reply.
    But I want to do some validations using javascript not only the required validation.
    In my application 5 text fields and one command button are there .Depending upon combination of 2 or 3 text field values, I have to get the values when I pressed command button.
    If I use the h:messages for validators,the conversion error is occurring when the text field takes wrong data.So it is going to give incorrect results when I press the command button.Thats why I am using javascript.
    When user enters wrong data,I want to do validation using javascript and I want to display the alert message using resource bundle.

  • Issue with resource bundle.

    Hi ,
    I have been facing a issue with getting properties from resource bundle.
    final ResourceBundle resourceBundle = ResourceBundle.getBundle("config/global");
    I had placed my global.properties file under "WEB-INF/classes/config" folder.It was working fine.I had resinstalled my sun one application server,.Now the server is throwing following exception -
    java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key record.length
    But the same war file is working fine when I deployed it in sun one app servers running other machines.
    when i changed the code to -
    final ResourceBundle resourceBundle = ResourceBundle.getBundle("config//global");
    it started working in machine as well.
    How can I resolve this?
    Thanks,.
    Vivek

    And also you can try like this,
    My locale file in backing bean is like this
    Locale bean
    public class LocaleBean {
    public String language = "en";
    * @return
    public void changeLocale(String language) {
    System.out.println("changeLocale " + language);
    this.language = language;
    this.setLanguage(language);
    Locale newLocale = new Locale(this.language);
    FacesContext context = FacesContext.getCurrentInstance();
    context.getViewRoot().setLocale(newLocale);
    JSFUtils.storeOnSession("LOCALE", language);
    System.out.println("end of change locale");
    public void setLanguage(String language) {
    this.language = language;
    public String getLanguage() {
    return language;
    public void changeLocaleAction(ActionEvent actionEvent) {
    changeLocale(this.language);
    // Add event code here...
    Faces-config.xml
    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
    <application>
    <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
    <resource-bundle>
    <base-name>Resorces.xx</base-name>
    <var>message</var>
    </resource-bundle>
    <locale-config>
    <default-locale>en</default-locale>
    <supported-locale>ar</supported-locale>
    <supported-locale>en</supported-locale>
    </locale-config>
    </application>
    <managed-bean>
    <managed-bean-name>localeBean</managed-bean-name>
    <managed-bean-class>LocaleBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    </faces-config>
    and my resource bundle as this :
    xx_ar_AR.properties
    xx.properties
    And Project properties>compiler property >character encoding > UTF-8
    select Tools-->Preferences-->Environment
    and then set the encoding to UTF-8.
    no need to change your trinidad-config.xml
    Regards
    PY

  • Af:setActionListener not working properly with resource bundle value

    Hi,
    I am making a ADF-BC JSF project in which I have a commit button a page. On click of this Commit button I am setting some value (Status) through setActionListener. But as this value(Status) is subject to change, so I have stored it in the resource properties file and I'm assigning it from the resource properties file.
    Now when I hardcode the value, it works properly but when I give it from the properties resource file it sets this value to NULL. Here is my code.
    <af:commandButton text="Commit" action="some action”}>
    <af:setActionListener to="#{bindings.SP11DeliveryWarrantView1WarrantStatus.inputValue}"
    from="#{res['warrantstatus.InProcess']}"/>
    </af:commandButton>
    If I write #{'Some hardcoded value'} instead of #{res['warrantstatus.InProcess']}. It works fine. May I know what is wrong here or is it a bug?
    Neeraj.

    Hi,
    I had the same problem and many thanks Frank - yes this does work. Just for clarity here is what I did with my implementation:
    In my session level managed bean (SystemState) I added the relevant values from the bundle:
    public class SystemState
      public static final String RESOURCE_BUNDLE = "gpl.viewcontroller.resources.UIResources" ;
      private HashMap<String,String> formTypeStatuses = new HashMap<String,String>() ;
      public SystemState()
        formTypeStatuses.put("live",JSFUtils.getResourceBundleValue("home.menu2.livestatus.value",RESOURCE_BUNDLE)) ;
        formTypeStatuses.put("archive",JSFUtils.getResourceBundleValue("home.menu2.archivestatus.value",RESOURCE_BUNDLE)) ;
        formTypeStatuses.put("all",JSFUtils.getResourceBundleValue("home.menu2.allstatuses.value",RESOURCE_BUNDLE)) ;
      public HashMap<String, String> getFormTypeStatuses()
        return formTypeStatuses;
    }I then referenced these values from my jspx page:
                <af:commandLink actionListener="#{bindings.ExecuteWithParams1.execute}"
                                action="ExecuteWithParams1"
                                text="#{res['home.menu2.livestatus.text']}"
                                disabled="#{!bindings.ExecuteWithParams1.enabled}">
                  <af:setActionListener from="#{session_system_state.formTypeStatuses.live}"
                                        to="#{requestScope.status}"/>
                </af:commandLink>
                <af:commandLink actionListener="#{bindings.ExecuteWithParams1.execute}"
                                action="ExecuteWithParams1"
                                text="#{res['home.menu2.archivestatus.text']}"
                                disabled="#{!bindings.ExecuteWithParams1.enabled}">
                  <af:setActionListener from="#{session_system_state.formTypeStatuses.archive}"
                                        to="#{requestScope.status}"/>
                </af:commandLink>
                <af:commandLink actionListener="#{bindings.ExecuteWithParams1.execute}"
                                action="ExecuteWithParams1"
                                text="#{res['home.menu2.allstatuses.text']}"
                                disabled="#{!bindings.ExecuteWithParams1.enabled}">
                  <af:setActionListener from="#{session_system_state.formTypeStatuses.all}"
                                        to="#{requestScope.status}"/>
                </af:commandLink>Dave

  • GTC Page Not loading - Error with Resource Bundles

    I am using following OIM Software:
    OIM 9.1.0.2
    Linux x86
    While accessing the GTC Manage Page, I am getting the Search button, Once I click the Search for all GTCs, It is throwing me error with "Contact Sysstem Administrator"
    During the investigation, I found that I am getting the following error when I access the xlWebApp through Web:
    ===============
    INFO,16 Aug 2010 11:58:35,171,[XELLERATE.WEBAPP],Property global.resultSet.Form~Information.Description.create~generic~connector not found in en locale bundle.
    INFO,16 Aug 2010 11:58:35,171,[XELLERATE.WEBAPP],Property global.resultSet.Form~Information.Description.manage~generic~connector not found in en locale bundle.
    INFO,16 Aug 2010 11:58:35,172,[XELLERATE.WEBAPP],Property global.resultSet.Form~Information.Description.Reset~self~password~menu~item not found in en locale bundle.
    INFO,16 Aug 2010 11:58:35,172,[XELLERATE.WEBAPP],retrieving object from cache key = xlCustomClienten
    INFO,16 Aug 2010 11:58:35,172,[XELLERATE.WEBAPP],Property global.resultSet.Form~Information.Description.Change~self~password~menu~item.Change~Self~Password~menu~item not found in en locale bundle.
    INFO,16 Aug 2010 11:58:35,172,[XELLERATE.WEBAPP],Property global.resultSet.Form~Information.Description.Create~generic~connector.Create~Generic~Technology~Connector~menu~item not found in en locale bundle.
    INFO,16 Aug 2010 11:58:35,172,[XELLERATE.WEBAPP],Property global.resultSet.Form~Information.Description.Manage~generic~connector.Manage~Generic~Technology~Connector~menu~item not found in en locale bundle.
    ===============
    I added the following in customResources_en.properties
    global.resultSet.Form~Information.Description.create~generic~connector=create generic connector
    global.resultSet.Form~Information.Description.manage~generic~connector=manage generic connector
    global.resultSet.Form~Information.Description.Reset~self~password~menu~item=Reset self password menu item
    global.resultSet.Form~Information.Description.Change~self~password~menu~item.Change~Self~Password~menu~item=Change Self Password menu item
    global.resultSet.Form~Information.Description.Create~generic~connector.Create~Generic~Technology~Connector~menu~item=Create Generic Technology Connector menu item
    global.resultSet.Form~Information.Description.Manage~generic~connector.Manage~Generic~Technology~Connector~menu~item=Manage Generic Technology Connector menu item
    I am trying so many options with these two files, however the error is not changing at all. Also, do I need to add this to customDefaultResources.properties?
    Any suggestions?
    Thanks in advance. I will assign Points.
    Regards
    Vijay Chinnasamy

    LCMan wrote:
    Carolyn Samit wrote:
    Did you read my response to you??
    Yes. However, I don't believe it's an enycryption issue. It's something to do with javascript.
    Regardless of what the issue is, the only (temporary) fix seems to be to use Firefox. However, I would have to agree with what Carolyn Samit said. Carolyn is a very active member here and knows a lot of things.

  • Using utf-8 in jsp with resource bundle files(Farsi Language) Help !

    Hi,
    I am using jdeveloper and struts and i have a resourcce bundle file that i am writing in Farsi in it.
    my jsp looks like this :
    <%@ page contentType="text/html;charset=UTF-8"%>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <html:form action="IndexAction.do" method="POST" enctype="UTF-8">
    <% request.setCharacterEncoding("UTF-8");%>
    <bean:message key="button.add" /><!-- i get the key from the bundle here-->
    i have saved the bundle file in utf-8 and i have tried native2ascii on it as well.
    i also have response.setContentType("text/html; charset=UTF-8"); in my action file.my browser setting is also utf-8.
    but still i get garbage chars in jsp.
    any idea ?
    thax
    reza

    hello
    i have problem whit write farsi in jsp.
    the charecter is destroy.
    please help me.
    thanks

  • Internationalization with resource bundle?

    i am trying to print the name scott in english and chinese. Below is the code i tried
    //inside main method
    //Line1
    System.out.println(" english name is "+ResourceBundle.getBundle("MyResources", english).getString("scott"));
    //Line2
    System.out.println(" chinese name is "+ResourceBundle.getBundle("MyResources", chinese).getString("scott"));
    import java.util.ListResourceBundle;
    public class MyResources extends ListResourceBundle {
         protected Object[][] getContents() {
         return new Object[][] {
         {"scott", "scott1"},
    Both Lin1 and 2printing scott1 .should not line 2 print the name in chinese?

    Steven,
    Can you explain me why you choose not to implement this feature in JHS 10.1.3? I need to enhance the original business exceptions, some of them are terrible (maybe you can imagine some of them translated to portuguese), I have two choices and I'm in doubt.
    The first is forget about ApplicationResources.properties for business exceptions and use the default feature of MessageBundles of JDeveloper. The second is to change the JHeadstart implementation (JhsStrutsUixLifecycle and ReportingUtils), seems to be easy to put them working.
    What do you think about it, and why do you choose not to override business exceptions descriptions in the web tier in JHS 10.1.3?
    Thanks,
    Eduardo

  • Resource Bundle Problem

    I have a funny problem with Resource Bundles:
    In the property editor for a Hyperlink object I replaced the text property with the following: #{messages1.MyKey}
    I have defined an action on the hyperlink as follows:
    public String MyHyperlinkId_action ()
    String HyperlinkText = (String)MyHyperlinkId.getText();
    String HyperlinkID = MyHyperlinkId.getId();
    return null;
    getText() returns null since I use the Bundle to set the text. getId() returns the correct Id. If I hardcode the text in the property editor getText() returns that text correctly.
    Any idea, what the problem could be??
    Many thanks
    Tom

    Did you modify the hyperlink text property manually or through the property binding wizard. It could be a spelling mistake. Also make sure MyKey is defined in your resource bundle.

  • Resource bundles, loading in beans or in jsp or share them?

    Hi,
    I have a question and hope it is not a stupid one.
    What is the best way to work with resource bundles/messages developing faces application?
    One way is to load and use it in jsp. It is convenient and easy. Another is to use it within a bean. It's a little bit more complicated and might take more memory. Taking into account that sometimes general messages are to be used in both is there a guideline or some usual practice on how do I can access a resourcebundle that been loaded in jsp from bean?
    Suppose I have couple beans that might use the same messages - logically it is better to load bundle in jsp and use it from beans.
    Of course it could be loaded via faces config file, but some messages are needed only by couple of pages (registration for example).
    Please let me know your thoughts or how it is done usually.
    Thanks in advance!!

    You can use as many f:loadBundle tags in the JSP page as you want. You can also use them simultaneously with any <message-bundle> and/or <resource-bundle> declaration in the faces-config.xml. Just choose the one which covers the scope of the bundle in question.

  • 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

  • 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.

Maybe you are looking for

  • Crystal report printing using epson dot matrix printer (continouos paper)

    Hi there, im tiff from the philippines. i have a  question on printing using a crystal report. How do i print using epson continuous printer(dot matrix)? im having a problem printing to that type of printer specially using continuous paper. the first

  • User created Filters on Webmail failed

    Hello, I installed CS2 on LINUX AS 2.1. Everything works fine but when a User wants to create a Filter in Webmail the following Error message is returned: Error: There was a problem when creating the filter It appears that the filter is created and a

  • How to install 10.4.1 on new hd

    my g5 new hd wont see 10.4.1 how do i install on new hard drive

  • Nokia E71 Mail for exchange "Connection Error. Try...

    Hi I have used /Nokia E71 with latest MfE, i got my details from my Employers Microsoft outlook 2007 like exchnage server, domain and user name. I just want to synchronise E-mails, whenever i try to synchronise i get "Connection Error. try Later". Pl

  • Help with a simple code snippet?

    Can someone tell me where I'm going wrong with this bit of code? Its more or less derrived from the Java tutorials, though its mid chapter so lets you make your own mind up about the surrounding code...I'm just trying to get a grip on how notifyAll()