cool components and locale
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