Hello list,

I commited the attached patch to cp-tools to add support for currency
formats in CLDR 1.3 that dont mention the format for negative currency
values explicitely.


Cheers,
Michael


2006-03-25  Michael Koch  <[EMAIL PROTECTED]>

        * src/gnu/localegen/PropertiesGenerator.java:
        Implemented handling of currencyFormats that don't explicitely contain
        format for negative values.

Index: src/gnu/localegen/PropertiesGenerator.java
===================================================================
RCS file: 
/sources/classpath/cp-tools/src/gnu/localegen/PropertiesGenerator.java,v
retrieving revision 1.3
diff -u -r1.3 PropertiesGenerator.java
--- src/gnu/localegen/PropertiesGenerator.java  21 May 2005 21:26:43 -0000      
1.3
+++ src/gnu/localegen/PropertiesGenerator.java  25 Mar 2006 23:05:57 -0000
@@ -1,5 +1,5 @@
 /*
- * gnu.localegen.PropertiesGenerator Copyright (C) 2005
+ * gnu.localegen.PropertiesGenerator Copyright (C) 2006
  * Free Software Foundation, Inc.
  *
  * This file is part of GNU Classpath.
@@ -437,6 +437,22 @@
     this.locale = locale;
   }
 
+  public void addCurrencyFormatContent(Hashtable tree)
+  {
+    DataElement data_elt =
+      (DataElement) 
tree.get("ldml.numbers.currencyFormats.currencyFormatLength.currencyFormat.pattern");
+
+    if (data_elt == null)
+      return;
+    
+    String data = data_elt.data;
+
+    if (data.indexOf(";") == -1)
+      data += ";-" + data;
+    
+    localeContents.add(new StringContent("currencyFormat", data));
+  }
+
   public void addStringContent(Hashtable tree, String ref, String name)
   {
     DataElement data_elt = (DataElement) tree.get(ref);
@@ -652,10 +668,7 @@
                          flattree,
                          
"ldml.numbers.percentFormats.percentFormatLength.percentFormat.pattern",
                          "percentFormat");
-        addStringContent(
-                         flattree,
-                         
"ldml.numbers.currencyFormats.currencyFormatLength.currencyFormat.pattern",
-                         "currencyFormat");
+        addCurrencyFormatContent(flattree);
         addStringContent(flattree, "ldml.dates.localizedPatternChars",
                          "localPatternChars");
         computeCurrencies(flattree);

Reply via email to