JDK-4262590 : RFE: Would like per-functionality default locales
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 1.2.2
  • Priority: P5
  • Status: Resolved
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-08-15
  • Updated: 2013-05-15
  • Resolved: 2013-05-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Description

Name: dbT83986			Date: 08/15/99


The locale classes needs support for setting and getting various
variables.
Third party packages only use Locale as input to determine how
different stuff is going to be renedered. Example is KL Group's
JCField. Since the locale info is stored in static classes 
(Resources) it is not possible to change desired properties.
For instance I am right now working on a bank application. 
Displaying most stuff in localized ways are ok but the amounts
should look  the same all over the world. This is easily understandable
since the traders work with many different applications and those
use the same way of displaying the amount. Then it is not good
if one application all of a sudden starts showing stuff in a
completely new format. Such a behaviour would force us to hard
code the locale to US and then the whole idea about localization
is lost.
We need more freedom if we are ever going to be able to use
localization.

========================================
REVIEW NOTE 8/22/99 - User responded with additional information

My thought is something like that I want to for instance use the German
locale but specify that it in this application it should format the dates
according
to the ISO standard.
The code would be something like:

Locale germanLocale = Locale.GERMAN;
Locale isoLocale = Locale.ISO;
germanLocale .setDateFormat(isoLocale.getDateFormat());

This way I don't have to think about which locale to use
for which field, I simply use my customized all the way.

A good thing would be to provide a locale containg the ISO standards
(as you can see above).

Another thing I would like to see is a way to easily extract locale data.
Example code:

Locale locale = Locale.getDefault();
String decimalSign = locale.getDecimalSign();

It is quite common that you as a programmer has to mainpulate
the strings and if it is localized then some characters are going to
differ so you need to be able to extract those characters.

The examples are (I think) possible to handle in the current situation,
they are just provided to give a rough idea about what I'm thinking.
The exapmle versions is at least a lot easier to use than the current
implementation.
Hopefully I've managed to convince you to include this in the future:-)
(Review ID: 93599) 
======================================================================

Comments
Locale.Category has been introduced for this purpose. As of JDK7, there are two categories, i.e., FORMAT and DISPLAY which would effectively solve the customer's concern.
15-05-2013

WORK AROUND Name: dbT83986 Date: 08/15/99 None ======================================================================
15-08-2004

EVALUATION Can you provide more specific examples of what functionality you'd like to see in the Java 2 Platform? It seems to me that our current APIs already provide a lot of flexibility. For example, you can run an entire application in the user's preferred locale as a default, and still specify that you want to use a US number formatter for number display (just call NumberFormat.getInstance(Locale.US), or create a DecimalFormat instance with your own specialized format. I'm not sure whether third party products, such as KL Group's, make all this flexibility available to their clients, but if not, that needs to be addressed with these third parties. norbert.lindenberg@Eng 1999-08-17 [See REVIEW NOTE 8/22/99 for additional input from requestor] Adding information about functionality-specific default locales to the Locale class doesn't fit into the Java locale architecture. The Locale class is only intended as an identifier, not as a collection of functionality. However, the need described by the requestor might also be addressed by adding per-functionality default locales, e.g., DateFormat.setDefaultLocale(). This should be considered as a possible part of a more flexible locale architecture. norbert.lindenberg@Eng 1999-08-25 The requestor's need might also be addressed by per functionality customizations as described in RFE 4262590. This is a common feature found on other platforms and is probably more widely useful than per functionality defaults locales. I think this RFE could be closed as a duplicate of 4262590 at this time. However, since the original submitter might not agree, I will leave this RFE open until the submitter has a chance to respond. brian.beck@Eng 2001-03-16 This *is* 4262590. Which RFE did you mean? ###@###.### 2001-11-27
16-03-2001