LanguageSelector
Die Sprache läßt sich nun per URL-Get-Parameter "selLang" einstellen. Ebenso wird die eingestellte Sprache als Environment-Variable "selected-language" an den XSL-Interpreter übergeben. Diese Informationen müssen vom Theme entsprechend verarbeitet werden. Dieser LanguageSelector funktioniert zwar prinzipiell überall, scheint aber im ContentCenter keine vollständige Umschaltung zu erzeugen. Problematisch sind die Applikationen ContentItem und/oder Navigation (?) an zwei Stellen: 1. Beim Verfolgen eines Links aus Navigation auf ein ContentItem, wird die URL auf die konkrete Sprachvariante eingestellt, was eine weitere Umschaltung des Inhaltes verhindert. 2. Beim Umschalten eines ContentItems, dessen URL keine Sprachvariante enthält, funktioniert das nicht, wenn man sich bereits in der Applikation ContentItem befindet. Das funktioniert allerdings auch nicht mit dem QuickLocaleSwitcher. git-svn-id: https://svn.libreccm.org/ccm/trunk@1074 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f9b612b3db
commit
411dea3f39
|
|
@ -36,7 +36,8 @@ import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
|||
// This interface contains the XML element name of this class
|
||||
// in a constant which is used when generating XML
|
||||
import com.arsdigita.bebop.util.BebopConstants;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
|
||||
import com.arsdigita.xml.Element;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
|
@ -278,7 +279,7 @@ public class Date extends Widget implements BebopConstants {
|
|||
public void generateLocalizedWidget(PageState ps, Element date) {
|
||||
|
||||
Locale defaultLocale = Locale.getDefault();
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
|
||||
// Get the current Pattern
|
||||
// XXX This is really, really, really, really, really, really bad
|
||||
|
|
@ -376,7 +377,7 @@ public class Date extends Widget implements BebopConstants {
|
|||
|
||||
private void populateMonthOptions() {
|
||||
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
|
||||
if (m_locale == null || (locale != null && !m_locale.equals(locale))) {
|
||||
|
||||
|
|
@ -398,7 +399,7 @@ public class Date extends Widget implements BebopConstants {
|
|||
m_month.addOption(new Option(String.valueOf(i), months[i]));
|
||||
}
|
||||
}
|
||||
m_locale = DispatcherHelper.getNegotiatedLocale();
|
||||
m_locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import com.arsdigita.bebop.parameters.NumberInRangeValidationListener;
|
|||
import com.arsdigita.bebop.parameters.ParameterData;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.util.BebopConstants;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.util.Assert;
|
||||
import com.arsdigita.xml.Element;
|
||||
import java.text.DateFormat;
|
||||
|
|
@ -344,7 +344,7 @@ public class Time extends Widget implements BebopConstants {
|
|||
}
|
||||
|
||||
private boolean has12HourClock() {
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
DateFormat format_12Hour = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.US);
|
||||
DateFormat format_locale = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import com.arsdigita.web.Web;
|
|||
import com.arsdigita.xml.Document;
|
||||
import com.arsdigita.bebop.Bebop;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
|
@ -59,6 +60,7 @@ import javax.xml.transform.dom.DOMSource;
|
|||
import javax.xml.transform.stream.StreamResult;
|
||||
import com.arsdigita.templating.XSLParameterGenerator;
|
||||
|
||||
import java.util.Locale;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -88,6 +90,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("contextPath",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return request.getContextPath();
|
||||
}
|
||||
|
|
@ -96,6 +99,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("root-context-prefix",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return Web.getConfig().getDispatcherContextPath();
|
||||
}
|
||||
|
|
@ -104,6 +108,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("context-prefix",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return Web.getContext().getRequestURL().getContextPath();
|
||||
}
|
||||
|
|
@ -112,6 +117,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("static-prefix",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return Web.getContext().getRequestURL().getContextPath()
|
||||
+ com.arsdigita.web.URL.STATIC_DIR;
|
||||
|
|
@ -121,6 +127,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("dispatcher-prefix",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return com.arsdigita.web.URL.getDispatcherPath();
|
||||
}
|
||||
|
|
@ -129,6 +136,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("dcp-on-buttons",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
if (Bebop.getConfig().doubleClickProtectionOnButtons()) {
|
||||
return "true";
|
||||
|
|
@ -142,6 +150,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("dcp-on-links",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
if (Bebop.getConfig().doubleClickProtectionOnLinks()) {
|
||||
return "true";
|
||||
|
|
@ -156,6 +165,7 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("user-agent",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return request.getHeader("User-Agent");
|
||||
}
|
||||
|
|
@ -164,8 +174,19 @@ public class PageTransformer implements PresentationManager {
|
|||
registerXSLParameterGenerator("negotiated-language",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
return DispatcherHelper.getNegotiatedLocale().getLanguage();
|
||||
return GlobalizationHelper.getNegotiatedLocale().getLanguage();
|
||||
}
|
||||
});
|
||||
|
||||
registerXSLParameterGenerator("selected-language",
|
||||
new XSLParameterGenerator() {
|
||||
|
||||
@Override
|
||||
public String generateValue(HttpServletRequest request) {
|
||||
Locale selectedLocale = com.arsdigita.globalization.GlobalizationHelper.getSelectedLocale(request);
|
||||
return (selectedLocale != null) ? selectedLocale.toString() : "";
|
||||
}
|
||||
});
|
||||
s_log.debug("Static initalizer finished.");
|
||||
|
|
@ -247,6 +268,7 @@ public class PageTransformer implements PresentationManager {
|
|||
* HttpServletResponse, Map)} to implement the
|
||||
* <code>PresentationManager</code> interface.
|
||||
*/
|
||||
@Override
|
||||
public void servePage(final Document doc,
|
||||
final HttpServletRequest req,
|
||||
final HttpServletResponse resp) {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,10 @@
|
|||
package com.arsdigita.categorization;
|
||||
|
||||
import com.arsdigita.db.Sequences;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.domain.DomainServiceInterfaceExposer;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.kernel.ACSObject;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.permissions.PermissionDescriptor;
|
||||
|
|
@ -403,7 +404,7 @@ public class Category extends ACSObject {
|
|||
* @return the category name.
|
||||
*/
|
||||
public String getName() {
|
||||
return getName(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
return getName(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -585,7 +586,7 @@ public class Category extends ACSObject {
|
|||
*/
|
||||
public String getDescription() {
|
||||
return getDescription(
|
||||
DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -658,7 +659,7 @@ public class Category extends ACSObject {
|
|||
* @return URL component used when browsing categories
|
||||
*/
|
||||
public String getURL() {
|
||||
return getURL(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
return getURL(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -735,7 +736,7 @@ public class Category extends ACSObject {
|
|||
* otherwise.
|
||||
*/
|
||||
public boolean isEnabled() {
|
||||
return isEnabled(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
return isEnabled(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ public class DomainObjectXMLRenderer extends DomainObjectTraversal {
|
|||
|
||||
// Quasimodo: BEGIN
|
||||
// Add attributes for date and time
|
||||
Locale negLocale = com.arsdigita.dispatcher.DispatcherHelper.getNegotiatedLocale();
|
||||
Locale negLocale = com.arsdigita.globalization.GlobalizationHelper.getNegotiatedLocale();
|
||||
DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, negLocale);
|
||||
DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, negLocale);
|
||||
element.addAttribute("date", dateFormatter.format(date));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,166 @@
|
|||
package com.arsdigita.formbuilder;
|
||||
|
||||
|
||||
// This class is an ACSObject using BigDecimals for its ids
|
||||
import java.math.BigDecimal;
|
||||
|
||||
// This factory creates a Time
|
||||
import com.arsdigita.bebop.form.Time;
|
||||
|
||||
// Every PersistentComponentFactory can create a Bebop Component
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.form.Widget;
|
||||
|
||||
// Id class used by internal constructor
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.metadata.ObjectType;
|
||||
|
||||
// For instantiating the TimeParameter
|
||||
import com.arsdigita.bebop.parameters.TimeParameter;
|
||||
import com.arsdigita.formbuilder.util.FormBuilderUtil;
|
||||
|
||||
// Thrown if the underlying DataObject with given id cannot be found
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
|
||||
// ACS 5 uses Log4J for logging
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* This class is responsible for persisting Bebop Times. The Time
|
||||
* is saved with the save() method. To resurrect the Time, use the constructor
|
||||
* taking the id of the saved Time and then invoke createComponent().
|
||||
*
|
||||
* @author Peter Marklund
|
||||
* @version $Id: PersistentTime.java 287 2005-02-22 00:29:02Z sskracic $
|
||||
*
|
||||
*/
|
||||
public class PersistentTime extends PersistentWidget {
|
||||
|
||||
public static final String versionId = "$Id: PersistentTime.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $TimeTime: 2004/08/16 18:10:38 $";
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(PersistentTime.class.getName());
|
||||
|
||||
private Class VALUE_CLASS = new java.util.Date().getClass();
|
||||
|
||||
/**
|
||||
* The fully qualified name of the underlying DataObject of this class.
|
||||
*/
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.formbuilder.Widget";
|
||||
|
||||
// *** Constructors -------------
|
||||
|
||||
/**
|
||||
* Constructor that creates a new Time domain object that
|
||||
* can be saved to the database later on. This class was only
|
||||
* included to make it possible to use this DomainObject with the
|
||||
* FormGenerator (to make the class JavaBean compliant). Use the constructor
|
||||
* taking a parameter name instead if possible.
|
||||
*/
|
||||
public PersistentTime() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that creates a new Time domain object that
|
||||
* can be saved to the database later on.
|
||||
*/
|
||||
public PersistentTime(String typeName) {
|
||||
super(typeName);
|
||||
}
|
||||
|
||||
public PersistentTime(ObjectType type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public PersistentTime(DataObject obj) {
|
||||
super(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor that retrieves an existing Time domain object
|
||||
* from the database.
|
||||
*
|
||||
* @param id The object id of the Time domain object to retrieve
|
||||
*/
|
||||
public PersistentTime(BigDecimal id)
|
||||
throws DataObjectNotFoundException {
|
||||
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Extending classes can use this constructor to set the sub class
|
||||
* id and object type.
|
||||
*/
|
||||
public PersistentTime(OID oID)
|
||||
throws DataObjectNotFoundException {
|
||||
|
||||
super(oID);
|
||||
}
|
||||
|
||||
public static PersistentTime create(String parameterName) {
|
||||
PersistentTime d = new PersistentTime();
|
||||
d.setup(parameterName);
|
||||
return d;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Time whose persistence is managed
|
||||
* by this domain object.
|
||||
*/
|
||||
public Component createComponent() {
|
||||
|
||||
Time time = null;
|
||||
|
||||
// If there is a speical TimeParameterClass - instantiate that
|
||||
if (getTimeParameter() != null) {
|
||||
|
||||
TimeParameter timeParameter = (TimeParameter)
|
||||
FormBuilderUtil.instantiateObject(getTimeParameter(),
|
||||
new Class [] {getParameterName().getClass()},
|
||||
new Object [] {getParameterName()});
|
||||
|
||||
time = new Time(timeParameter);
|
||||
|
||||
} else {
|
||||
time = new Time(getParameterName());
|
||||
}
|
||||
|
||||
copyValuesToWidget(time);
|
||||
|
||||
return time;
|
||||
}
|
||||
|
||||
protected void copyValuesToWidget(Widget widget) {
|
||||
super.copyValuesToWidget(widget);
|
||||
|
||||
Time time = (Time)widget;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a java.util.Date Class
|
||||
*/
|
||||
protected Class getValueClass() {
|
||||
|
||||
return VALUE_CLASS;
|
||||
}
|
||||
|
||||
//*** Attribute Methods
|
||||
public void setTimeParameter(String timeParameterClass) {
|
||||
|
||||
setComponentAttribute("timeParameter", timeParameterClass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return null if no value has been set.
|
||||
*/
|
||||
public String getTimeParameter() {
|
||||
return getComponentAttribute("timeParameter");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.globalization;
|
||||
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.kernel.Kernel;
|
||||
import com.arsdigita.kernel.KernelConfig;
|
||||
import java.util.Enumeration;
|
||||
import javax.servlet.ServletRequest;
|
||||
import java.util.Locale;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Sören Bernstein
|
||||
*/
|
||||
public class GlobalizationHelper {
|
||||
|
||||
// Don't instantiate
|
||||
private GlobalizationHelper() {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the best matching locate for the request. In contrast to
|
||||
* the other methods available this one will also respect the supported_languages
|
||||
* config entry.
|
||||
*
|
||||
* @return The negotiated locale
|
||||
*/
|
||||
public static java.util.Locale getNegotiatedLocale() {
|
||||
KernelConfig kernelConfig = Kernel.getConfig();
|
||||
|
||||
// Set the preferedLocale to the default locale (first entry in the config parameter list)
|
||||
java.util.Locale preferedLocale = getPrefferedLocale();
|
||||
|
||||
// The ACCEPTED_LANGUAGES from the client
|
||||
Enumeration locales = null;
|
||||
|
||||
// Try to get the RequestContext
|
||||
try {
|
||||
|
||||
// Get the SerrvletRequest
|
||||
ServletRequest request = ((ServletRequest) DispatcherHelper.getRequest());
|
||||
|
||||
// Get the selected locale from the request, if any
|
||||
java.util.Locale selectedLocale = getSelectedLocale(request);
|
||||
if (selectedLocale != null && kernelConfig.hasLanguage(selectedLocale.getLanguage())) {
|
||||
preferedLocale = selectedLocale;
|
||||
} else {
|
||||
|
||||
//
|
||||
String lang = request.getParameter("lang");
|
||||
|
||||
if (lang != null && kernelConfig.hasLanguage(lang)) {
|
||||
|
||||
preferedLocale = new Locale(lang);
|
||||
} else {
|
||||
|
||||
locales = request.getLocales();
|
||||
|
||||
// For everey element in the enumerator
|
||||
while (locales.hasMoreElements()) {
|
||||
|
||||
// Test if the current locale is listed in the supported locales list
|
||||
java.util.Locale curLocale = (Locale) locales.nextElement();
|
||||
if (kernelConfig.hasLanguage(curLocale.getLanguage())) {
|
||||
preferedLocale = curLocale;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
// Don't have to do anything because I want to fall back to default language anyway
|
||||
// This case should only appear during setup
|
||||
} finally {
|
||||
|
||||
return preferedLocale;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// public static java.util.Locale getSystemLocale() {
|
||||
//
|
||||
// }
|
||||
private static Locale getPrefferedLocale() {
|
||||
KernelConfig kernelConfig = Kernel.getConfig();
|
||||
java.util.Locale preferedLocale = new java.util.Locale(kernelConfig.getDefaultLanguage(), "", "");
|
||||
return preferedLocale;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the selected (as in fixed) locale from the ServletRequest
|
||||
*
|
||||
* @return the selected locale as java.util.Locale or null if not defined
|
||||
*/
|
||||
public static Locale getSelectedLocale(ServletRequest request) {
|
||||
// ServletRequest request = ((ServletRequest) DispatcherHelper.getRequest());
|
||||
String paramValue = request.getParameter("selLang");
|
||||
java.util.Locale selectedLocale = null;
|
||||
|
||||
if (paramValue != null) {
|
||||
StringTokenizer paramValues = new StringTokenizer(paramValue, "_");
|
||||
if (paramValues.countTokens() > 1) {
|
||||
selectedLocale = new java.util.Locale(paramValues.nextToken(), paramValues.nextToken());
|
||||
} else {
|
||||
selectedLocale = new java.util.Locale(paramValues.nextToken());
|
||||
}
|
||||
}
|
||||
|
||||
return selectedLocale;
|
||||
}
|
||||
}
|
||||
|
|
@ -46,8 +46,7 @@ import org.apache.log4j.Logger;
|
|||
public class GlobalizedMessage {
|
||||
|
||||
private static final Logger s_cat =
|
||||
Logger.getLogger(GlobalizedMessage.class.getName());
|
||||
|
||||
Logger.getLogger(GlobalizedMessage.class.getName());
|
||||
private String m_key = "";
|
||||
private String m_bundleName = "";
|
||||
private Object[] m_args = null;
|
||||
|
|
@ -179,7 +178,8 @@ public class GlobalizedMessage {
|
|||
* GlobalizedObject?
|
||||
*/
|
||||
public Object localize() {
|
||||
return localize(Kernel.getContext().getLocale());
|
||||
// return localize(Kernel.getContext().getLocale());
|
||||
return localize(com.arsdigita.globalization.GlobalizationHelper.getNegotiatedLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -204,7 +204,8 @@ public class GlobalizedMessage {
|
|||
* GlobalizedObject?
|
||||
*/
|
||||
public Object localize(HttpServletRequest request) {
|
||||
return localize(Kernel.getContext().getLocale());
|
||||
// return localize(Kernel.getContext().getLocale());
|
||||
return localize(com.arsdigita.globalization.GlobalizationHelper.getNegotiatedLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -241,8 +242,7 @@ public class GlobalizedMessage {
|
|||
} catch (MissingResourceException e) {
|
||||
if (s_cat.isDebugEnabled()) {
|
||||
s_cat.debug(
|
||||
"ResourceBundle " + getBundleName() + " was not found."
|
||||
);
|
||||
"ResourceBundle " + getBundleName() + " was not found.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import com.arsdigita.search.FilterSpecification;
|
|||
import com.arsdigita.search.FilterType;
|
||||
import com.arsdigita.xml.Element;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.search.filters.DateRangeFilterSpecification;
|
||||
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ public class DateRangeFilterWidget extends FilterWidget {
|
|||
String x = "";
|
||||
|
||||
Locale defaultLocale = Locale.getDefault();
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
|
||||
// Get the current Pattern
|
||||
// XXX This is really, really, really, really, really, really bad
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
ui.admin.access_denied=Access Denied
|
||||
ui.admin.nusers=nUsers
|
||||
ui.admin.help=Help
|
||||
ui.admin.signout=Sign out
|
||||
ui.admin.portal=My Portal
|
||||
ui.admin.greeting=Welcome
|
||||
ui.sitemap.site_node=Site Node:
|
||||
ui.sitemap.mounted_instance=Mounted Instance:
|
||||
ui.sitemap.enter_new_node_name_in_text_field=Enter new Node name in text field.
|
||||
ui.sitemap.are_you_sure_you_want_to_remove_this_node=Are you sure you want to remove this node?
|
||||
ui.sitemap.are_you_sure_you_want_to_umount_this_instance=Are you sure you want to umount this instance?
|
||||
ui.sitemap.enter_name_for_new_package_instance_in_text_field_then_select_a_package_to_mount_from_list=Enter name for new package instance in text field, then select a package to mount from list.
|
||||
ui.sitemap.h4sitemap_treeh4=<h4>SiteMap Tree</h4>
|
||||
ui.sitemap.configure_sitemap_admin_page=Configure SiteMap Admin Page
|
||||
ui.sitemap.h4emselect_sitenode_to_view_detailsemh4=<h4><em>Select SiteNode to View Details</em></h4>
|
||||
ui.sitemap.configuration_menu_placeholder=Configuration Menu Placeholder
|
||||
ui.sitemap.access_denied_to_sitemap=Access Denied to SiteMap
|
||||
ui.debug.transform.on=Display transformation
|
||||
ui.debug.transform.off=Hide transformation
|
||||
ui.debug.xml=View document XML
|
||||
ui.debug.xsl=Download XSL files
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package com.arsdigita.xml.formatters;
|
||||
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.xml.Formatter;
|
||||
import java.util.Locale;
|
||||
import java.util.Date;
|
||||
|
|
@ -48,7 +48,7 @@ public class DateFormatter implements Formatter {
|
|||
public String format(Object value) {
|
||||
Date date = (Date)value;
|
||||
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
|
||||
DateFormat format = DateFormat.getDateInstance
|
||||
(DateFormat.MEDIUM, locale);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package com.arsdigita.xml.formatters;
|
||||
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.xml.Formatter;
|
||||
import java.util.Locale;
|
||||
import java.util.Date;
|
||||
|
|
@ -36,7 +36,7 @@ public class DateTimeFormatter implements Formatter {
|
|||
@Override
|
||||
public String format(Object value) {
|
||||
Date date = (Date) value;
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
|
||||
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
|
||||
DateFormat.SHORT, locale);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
package com.arsdigita.xml.formatters;
|
||||
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.globalization.GlobalizationHelper;
|
||||
import com.arsdigita.xml.Formatter;
|
||||
import java.util.Locale;
|
||||
import java.util.Date;
|
||||
|
|
@ -38,7 +38,7 @@ public class TimeFormatter implements Formatter {
|
|||
public String format(Object value) {
|
||||
Date date = (Date) value;
|
||||
|
||||
Locale locale = DispatcherHelper.getNegotiatedLocale();
|
||||
Locale locale = GlobalizationHelper.getNegotiatedLocale();
|
||||
|
||||
DateFormat format = DateFormat.getTimeInstance(DateFormat.SHORT, locale);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue