Skip to content

Commit

Permalink
Fix #538, a classic Turkish "i" bug :-(
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisboyle committed Apr 30, 2022
1 parent bec1894 commit ff81aae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ project.extensions.findByName("android").applicationVariants.all { variant ->
def colours = []
if (match) {
colours = match.group(1).replaceAll(/(?s)\/\*.*?\*\//, "").replaceAll(/#[^\n]*\n/, "")
.trim().split(",")*.trim()*.replaceFirst(/^COL_/, "")*.toLowerCase()
.trim().split(",")*.trim()*.replaceFirst(/^COL_/, "")*.toLowerCase(Locale.ROOT)
.findAll { it =~ /^[^=]+$/ } - ["ncolours", "crossedline"]
if (colours.any { it =~ /[^a-z0-9_]/ }) {
throw new Exception("Couldn't parse colours for " + puz + ": " + match.group(1) + " -> " + colours)
Expand All @@ -122,7 +122,7 @@ project.extensions.findByName("android").applicationVariants.all { variant ->
|
|/** Names of all the backends. Automatically generated file, do not modify. */
|public enum BackendName {
| ${backends.collect {"${it[0].toUpperCase()}(\"${it[1]}\", R.drawable.day_${it[0]}, R.drawable.night_${it[0]}, ${it[2]})"}.join(",\n ")};
| ${backends.collect {"${it[0].toUpperCase(Locale.ROOT)}(\"${it[1]}\", R.drawable.day_${it[0]}, R.drawable.night_${it[0]}, ${it[2]})"}.join(",\n ")};
| private final String _displayName;
| private final String[] _colours;
| @DrawableRes private final int _dayIcon, _nightIcon;
Expand All @@ -131,7 +131,7 @@ project.extensions.findByName("android").applicationVariants.all { variant ->
| @DrawableRes public int getDayIcon() { return _dayIcon; }
| @DrawableRes public int getNightIcon() { return _nightIcon; }
| @NonNull public String[] getColours() { return _colours; }
| @NonNull public String toString() { return name().toLowerCase(); }
| @NonNull public String toString() { return name().toLowerCase(Locale.ROOT); }
| private static final Map<String, BackendName> BY_DISPLAY_NAME, BY_LOWERCASE;
| static {
| final Map<String, BackendName> byDisp = new LinkedHashMap<String, BackendName>(), byLower = new LinkedHashMap<String, BackendName>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -465,7 +466,7 @@ private Drawable trySpecificIcon(final Resources resources, final int orig) {
private void trySpecificCharacterIcon(final Resources resources, final Key key, final char c) {
final int icon;
if ((Character.isUpperCase(c) || Character.isDigit(c)) && !isInEditMode) {
final String specificName = backendForIcons + "_sym_key_" + Character.toLowerCase(c);
final String specificName = backendForIcons + "_sym_key_" + Character.toString(c).toLowerCase(Locale.ROOT);
final Integer sharedIcon = SHARED_ICONS.get(specificName);
icon = (sharedIcon != null) ? sharedIcon :
resources.getIdentifier(specificName, "drawable", context.getPackageName());
Expand Down

0 comments on commit ff81aae

Please sign in to comment.