Author: [email protected]
Date: Fri May 29 12:24:16 2009
New Revision: 5477

Modified:
    branches/snapshot-2009.05.12-r5406/branch-info.txt
     
branches/snapshot-2009.05.12-r5406/user/src/com/google/gwt/i18n/client/NumberFormat.java
     
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
     
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java

Log:
Merge trunk r5476 into canary branch.

Fix typo in r5450 (period rather than comma in LOCLAIZED_COMMA_EQUIVALENTS)
and added tests that would have caught it.

Patch by: jat
Review by: andreasst (TBR)



Modified: branches/snapshot-2009.05.12-r5406/branch-info.txt
==============================================================================
--- branches/snapshot-2009.05.12-r5406/branch-info.txt  (original)
+++ branches/snapshot-2009.05.12-r5406/branch-info.txt  Fri May 29 12:24:16  
2009
@@ -14,3 +14,5 @@
    svn merge -c5466,5467 http://google-web-toolkit.googlecode.com/svn/trunk/
  /trunk c5393 was ROLLED BACK in this branch (IFRAME XHR change)
  /trunk c5472 was merged into this branch (ClassCircularityError on  
SingleJsoImpl)
+/trunk c5476 was merged into this branch (bug fix for r5450 and associated  
tests)
+  svn merge -c5476 https://google-web-toolkit.googlecode.com/svn/trunk .

Modified:  
branches/snapshot-2009.05.12-r5406/user/src/com/google/gwt/i18n/client/NumberFormat.java
==============================================================================
---  
branches/snapshot-2009.05.12-r5406/user/src/com/google/gwt/i18n/client/NumberFormat.java
         
(original)
+++  
branches/snapshot-2009.05.12-r5406/user/src/com/google/gwt/i18n/client/NumberFormat.java
         
Fri May 29 12:24:16 2009
@@ -327,7 +327,7 @@
    // Localized characters for dot and comma in number patterns, used to  
produce
    // the latin mapping for arbitrary locales.  Any separator not in either  
of
    // these strings will be mapped to non-breaking space (U+00A0).
-  private static final String LOCALIZED_COMMA_EQUIVALENTS  
= ".\u060C\u066B\u3001\uFE10\uFE11\uFE50\uFE51\uFF0C\uFF64";
+  private static final String LOCALIZED_COMMA_EQUIVALENTS  
= ",\u060C\u066B\u3001\uFE10\uFE11\uFE50\uFE51\uFF0C\uFF64";
    private static final String LOCALIZED_DOT_EQUIVALENTS  
= ".\u2024\u3002\uFE12\uFE52\uFF0E\uFF61";

    // Constants for characters used in programmatic (unlocalized) patterns.

Modified:  
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
==============================================================================
---  
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
        
(original)
+++  
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_en_Test.java
        
Fri May 29 12:24:16 2009
@@ -245,6 +245,20 @@
      assertEquals("1234567890", str);
    }

+  public void testForceLatin() {
+    assertFalse(NumberFormat.forcedLatinDigits());
+    NumberFormat.setForcedLatinDigits(true);
+    assertTrue(NumberFormat.forcedLatinDigits());
+    NumberFormat decLatin = NumberFormat.getDecimalFormat();
+    assertEquals("1,003.14", decLatin.format(1003.14));
+    assertEquals("-1,003.14", decLatin.format(-1003.14));
+    NumberFormat.setForcedLatinDigits(false);
+    assertFalse(NumberFormat.forcedLatinDigits());
+    assertEquals("3.14", decLatin.format(3.14));
+    NumberFormat unforced = NumberFormat.getDecimalFormat();
+    assertEquals("3.14", unforced.format(3.14));
+  }
+
    public void testNegative() {
      String str;


Modified:  
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java
==============================================================================
---  
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java
        
(original)
+++  
branches/snapshot-2009.05.12-r5406/user/test/com/google/gwt/i18n/client/NumberFormat_fr_Test.java
        
Fri May 29 12:24:16 2009
@@ -201,6 +201,20 @@
      assertEquals("1234567890", str);
    }

+  public void testForceLatin() {
+    assertFalse(NumberFormat.forcedLatinDigits());
+    NumberFormat.setForcedLatinDigits(true);
+    assertTrue(NumberFormat.forcedLatinDigits());
+    NumberFormat decLatin = NumberFormat.getDecimalFormat();
+    assertEquals("1\u00A0003,14", decLatin.format(1003.14));
+    assertEquals("-1\u00A0003,14", decLatin.format(-1003.14));
+    NumberFormat.setForcedLatinDigits(false);
+    assertFalse(NumberFormat.forcedLatinDigits());
+    assertEquals("3,14", decLatin.format(3.14));
+    NumberFormat unforced = NumberFormat.getDecimalFormat();
+    assertEquals("3,14", unforced.format(3.14));
+  }
+
    public void testPerMill() {
      String str;


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to