Last change
on this file since 12936 was 12931, checked in by Don-vip, 6 years ago |
see #14602 - Override digit group separator to be consistent across languages with ISO 80000-1 + checkstyle fixes
|
-
Property svn:eol-style
set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.tools;
|
---|
3 |
|
---|
4 | import java.text.DecimalFormatSymbols;
|
---|
5 | import java.text.spi.DecimalFormatSymbolsProvider;
|
---|
6 | import java.util.Locale;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * JOSM implementation of the {@link java.text.DecimalFormatSymbols DecimalFormatSymbols} class,
|
---|
10 | * consistent with ISO 80000-1.
|
---|
11 | * This class will only be used with Java 9 and later runtimes, as Java 8 implementation relies
|
---|
12 | * on Java Extension Mechanism only, while Java 9 supports application classpath.
|
---|
13 | * See {@link java.util.spi.LocaleServiceProvider LocaleServiceProvider} javadoc for more details.
|
---|
14 | * @since 12931
|
---|
15 | */
|
---|
16 | public class JosmDecimalFormatSymbolsProvider extends DecimalFormatSymbolsProvider {
|
---|
17 |
|
---|
18 | @Override
|
---|
19 | public DecimalFormatSymbols getInstance(Locale locale) {
|
---|
20 | DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);
|
---|
21 | // Override digit group separator to be consistent across languages with ISO 80000-1, chapter 7.3.1
|
---|
22 | symbols.setGroupingSeparator('\u202F'); // U+202F: NARROW NO-BREAK SPACE
|
---|
23 | return symbols;
|
---|
24 | }
|
---|
25 |
|
---|
26 | @Override
|
---|
27 | public Locale[] getAvailableLocales() {
|
---|
28 | return I18n.getAvailableTranslations();
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.