• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
cool components and locale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

cool components and locale


  • Subject: cool components and locale
  • From: Theodore Petrosky <email@hidden>
  • Date: Thu, 27 Sep 2018 19:39:24 -0400

CCDatePicker is set up to use the locale and if it is en_US the calendars it
creates start on Sunday!

in CCDatePicker I see:
String langScript = ERXLocalizer.currentLocalizer().languageCode() + ".js”;

when I stick in a log I see that ERXLocalizer is returning “en” when it should
be “en_US”

If I use the Java Locale class
Locale locale = Locale.getDefault();

in this case locale “en_US”

and the calendars that popup indeed have Sunday as the first day of the week!

I don’t understand why ERXLocalizer.currentLocalizer().languageCode() + ".js”;
does not return “en_US”

Is there anything bad that would happen if I use the Java Locale locale =
Locale.getDefault(); to get the locale?

Basically I am suggesting in CCDatePicker.java:

 @Override
    public void appendToResponse(WOResponse response, WOContext context)
    {
        if (booleanValueForBinding("injectStylesheet")) {
                String framework = stringValueForBinding("cssFramework",
FRAMEWORK_NAME);
                String cssFilename = stringValueForBinding("cssFile",
CSS_FILENAME);
                ERXResponseRewriter.addStylesheetResourceInHead(response,
context, framework, cssFilename);
        }
        String datepickerjsName = ERXApplication.isDevelopmentModeSafe() ?
"datepicker_lg.js" : "datepicker.js";
        ERXResponseRewriter.addScriptResourceInHead(response, context,
FRAMEWORK_NAME, datepickerjsName);
       // String langScript = ERXLocalizer.currentLocalizer().languageCode() +
".js";
        Locale locale = Locale.getDefault();
        String langScript = locale + ".js";

        ERXResponseRewriter.addScriptResourceInHead(response, context,
FRAMEWORK_NAME, "lang/" + langScript);

        super.appendToResponse(response, context);
    }
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Flattened one-side M:N fails wildly with SharedEC
  • Next by Date: Shared EC woes (was: Flattened one-side M:N fails wildly with SharedEC)
  • Previous by thread: handleQueryWithUnboundKey override for 3rd party objects?
  • Next by thread: Java compatibility
  • Index(es):
    • Date
    • Thread