Open GoogleCodeExporter opened 9 years ago
Lo acabo de mirar, y por lo que veo, no existe ninguna interfaz SPI que permita
hacer
eso. Sólo se me ocurre que en alguna clase con utilidades incluyas un método
estático
que te devuelva el calendario para el locale ("es", "ES") si el locale es
("eu", "EU").
public static Calendar getCalendar(Locale locale)
{
if (locale.equals(new Locale("eu")))
{
return Calendar.getInstance(new Locale("es","ES");
}
return Calendar.getInstance(locale);
}
Siento no haberlo podido solucionar en la extensión
Original comment by fiestasp...@gmail.com
on 5 Feb 2009 at 6:47
Original comment by fiestasp...@gmail.com
on 5 Feb 2009 at 6:48
Muy buenas,
Bueno, en nuestro caso la solución que propones no nos sirve, puesto que el
Calendar
no lo pedimos nosotros sino que un componente JSF, pero aún así te
agradecemos tu
trabajo.
Un saludo
Joseba
Original comment by urk...@gmail.com
on 6 Feb 2009 at 8:30
Confirmado, desde el grupo de Internacionalización (i18n) de OpenJDK me
responden que
no se puede resolver:
"Unfortunately, you cannot provide Calendar instances for your locale through
the
SPI. The caller could set the firstDayOfWeek on the instantiated calendar
object,
though.
Thanks,
Naoto
Fiestas .Net wrote:
Hello,
I made a SPI extension that implements Basque (eu_ES) locale at:
http://java-basque-locale.googlecode.com
One of the users of the extension has reported an issue about
Calendar.getCalendarInstance(basqueLocale) method. It happens that for
the Basque Locale I developed the calendar it returns has as the
firstDayOfTheWeek the Sunday, when it should be the Monday.
But I haven't found any abstract method to resolve the issue.
Is there any way to do it?
Thank you.
--
Naoto Sato"
En cualquier caso dejo abierto el problema, por si en algún momento lo
resuelven en
el JDK.
Original comment by fiestasp...@gmail.com
on 7 Feb 2009 at 11:38
Han aceptado en Sun la solicitud de Funcionalidad (Feature Request or
Enhancement),
se puede votar por ella en su sistema de registro de Bugs:
Thank you for taking the time to suggest this enhancement to the Java Standard
Edition.
We have determined that this report is an RFE and has been entered into our
internal RFE tracking system under Bug Id: 6804652
You can monitor this RFE on the Java Bug Database at:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6804652
It may take a day or two before the RFE shows up in this external database. As
you
are a member of the Sun Developer Network (SDN), there are two additional
options
once the bug is visible.
1. Voting for the RFE
Click http://bugs.sun.com/bugdatabase/addVote.do?bug_id=6804652
2. Adding the report to your Bug Watch list.
You will receive an email notification when this RFE is updated.
Click http://bugs.sun.com/bugdatabase/addBugWatch.do?bug_id=6804652
SDN members can obtain fully licensed Java IDEs for web and enterprise
development.
More information is at http://developers.sun.com/prodtech/javatools/free/.
We greatly appreciate your efforts in identifying areas in the Java Standard
Edition
where we can improve upon and I would request you to continue doing so.
Regards,
Nelson
NOTICE: This message, including any attachments, is for the intended recipient(s) only. If you are not the intended recipient(s), please reply to the sender, delete this message, and refrain from disclosing, copying, or distributing this message.
--------------- Previous Messages ----------------
--------------------- Report ---------------------
category : java
subcategory : classes_util_i18n
release : 6u10
type : rfe
synopsis : Add getCalendarInstance to Locale Sensitive Services (SPI)
customer name : Emilio Perez
customer mail : xxxx@xxxxx.xxx
sdn id : emiperez
language : en
company : Freelance
hardware : x64
os : linux
bug id : 6804652
date created : Sat Feb 07 05:37:18 MST 2009
date evaluated : Thu Feb 12 04:17:51 MST 2009
description :
A DESCRIPTION OF THE REQUEST :
As it exists a Calendar.getInstance(Locale) method that depends of the Locale
there
should be a getCalendarInstance() to return the appropriate calendar for the
custom
locale.
JUSTIFICATION :
There are JSF Calendar Components that Render HTML Calendars from the locale,
there
is no way to pass a Calendar as a parameter.
Original comment by fiestasp...@gmail.com
on 12 Feb 2009 at 12:57
Hola, hay una solución para esto y es agregar una clase CalendarData_(locale)
en el
paquete sun.util.resources, la misma debe heredar de LocaleNamesBundle y
aportar el
método Object[][] getContents(), p.e:
package sun.util.resources;
public class CalendarData_eu extends LocaleNamesBundle {
public CalendarData_eu() {
}
/* (non-Javadoc)
* @see sun.util.resources.OpenListResourceBundle#getContents()
*/
@Override
protected Object[][] getContents() {
return new Object[][] {
new Object[] {
"firstDayOfWeek", "2"
}, new Object[] {
"minimalDaysInFirstWeek", "1"
}
};
}
}
Al agregar esta clase y empaquetarla en un jar e incluirla en la carpeta ext
del jre
el classloader podrá encontrarla y se podrá aportar el primer día de la
semana para
este locale en particular.
Por otra parte, agradecerte el proyecto ya que me ha valido para crear un locale
específico para gallego que sufre el mismo problema que el euskera.
Saludos
Original comment by pcarra...@gmail.com
on 26 Jun 2009 at 6:30
Buenas!
Ya veo que el último comentario es bastante antiguo, pero ha conseguido
alguien lo que comenta #6?
Lo hemos probado repetidas veces y la única forma de sobreescribir el
firstDayOfWeek ha sido desde la clase CalendarData dentro del "rt.jar"
Dado que es uno de los paquetes del core de Java estamos buscando otra
solución y tener un "extended-basque-locale.jar" en el
${JAVA_HOME}/jre/lib/ext lo vemos como una alternativa bastante más factible.
Saludos.
Original comment by IrunePrado
on 6 Jun 2012 at 3:51
Original issue reported on code.google.com by
urk...@gmail.com
on 26 Jan 2009 at 4:40