- added hack to fix broken Collator for Czech Locale "cs"
git-svn-id: https://osmand.googlecode.com/svn/trunk@861 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
This commit is contained in:
parent
89730c9579
commit
661b6a98d5
1 changed files with 8 additions and 1 deletions
|
@ -8,6 +8,7 @@ import java.text.Collator;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
|
@ -36,7 +37,13 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository {
|
||||||
public RegionAddressRepositoryBinary(BinaryMapIndexReader file, String name) {
|
public RegionAddressRepositoryBinary(BinaryMapIndexReader file, String name) {
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.region = name;
|
this.region = name;
|
||||||
this.collator = Collator.getInstance();
|
//This is hack, as collator seems to be broken for "cs"-Czech country, things like Z-ž don't match, and "cz" fixes this
|
||||||
|
if ("cs".equals(Locale.getDefault().getLanguage())) {
|
||||||
|
this.collator = Collator.getInstance(new Locale("cz", Locale.getDefault().getCountry(),Locale.getDefault().getVariant()));
|
||||||
|
//hack end
|
||||||
|
} else {
|
||||||
|
this.collator = Collator.getInstance();
|
||||||
|
}
|
||||||
this.collator.setStrength(Collator.PRIMARY); //ignores also case
|
this.collator.setStrength(Collator.PRIMARY); //ignores also case
|
||||||
this.postCodes = new TreeMap<String, PostCode>(collator);
|
this.postCodes = new TreeMap<String, PostCode>(collator);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue