Changeset 17820 in josm


Ignore:
Timestamp:
2021-04-25T07:02:39+02:00 (4 years ago)
Author:
GerdP
Message:

fix #20785: Improve Status Report when locale "Arabic(Saudi Arabia)" is used

  • use Locale.ROOT for String.format
  • report locate details and digits 0..9 with Locale.getDefault()
Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r17793 r17820  
    9696            text.format("OS Build number: %s%n", buildNumber);
    9797        }
    98         text.format("Memory Usage: %d MB / %d MB (%d MB allocated, but free)%n",
     98        text.format(Locale.ROOT, "Memory Usage: %d MB / %d MB (%d MB allocated, but free)%n",
    9999                Runtime.getRuntime().totalMemory() / 1024 / 1024,
    100100                Runtime.getRuntime().maxMemory() / 1024 / 1024,
     
    114114                    AffineTransform transform = gd.getDefaultConfiguration().getDefaultTransform();
    115115                    // Java 11: use DisplayMode#toString
    116                     text.format(" %d\u00D7%d (scaling %.2f\u00D7%.2f)",
     116                    text.format(Locale.ROOT, " %d\u00D7%d (scaling %.2f\u00D7%.2f)",
    117117                            dm.getWidth(), dm.getHeight(), transform.getScaleX(), transform.getScaleY());
    118118                }
     
    141141            }
    142142        }
     143        text.format("Locale info: %s%n", Locale.getDefault().toString());
     144        text.format("Numbers with default locale: %s -> %d%n", Integer.toString(1_234_567_890), 1_234_567_890);
    143145
    144146        if (PlatformManager.isPlatformUnixoid()) {
  • trunk/src/org/openstreetmap/josm/tools/Logging.java

    r17660 r17820  
    1212import java.util.Arrays;
    1313import java.util.List;
     14import java.util.Locale;
    1415import java.util.function.Supplier;
    1516import java.util.logging.ConsoleHandler;
     
    496497            }
    497498
    498             String msg = String.format("%09.3f %s%s", startup.elapsed() / 1000., getPrefix(record), record.getMessage());
     499            String msg = String.format(Locale.ROOT, "%09.3f %s%s", startup.elapsed() / 1000., getPrefix(record), record.getMessage());
    499500
    500501            // Only remember first line of message
Note: See TracChangeset for help on using the changeset viewer.