1
0
Fork 0

Bulgarian update (#268)

* fixed Bulgarian layout: moved 'ь' to 8-key 

* added a migration for removing all Bulgarian words, since the digit sequences are no longer compatible with the new layout

* fixed incorrect text case of some words

* removed some nonsense words

* added new Bulgarian words
This commit is contained in:
Dimo Karaivanov 2023-07-13 14:33:54 +03:00 committed by GitHub
parent c4a78c1931
commit 0aa934cebd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 251186 additions and 230906 deletions

View file

@ -33,7 +33,8 @@ public class DB11 {
assert Dutch != null;
database.beginTransaction();
database.execSQL(getDeleteEnglishSwordsQuery(English));
database.execSQL(getTruncateBulgarianQuery());
database.execSQL(getDeleteEnglishSwordsQuery());
database.execSQL(getDeleteWordsQuery(English.getId(), enWords));
database.execSQL(getDeleteWordsQuery(Dutch.getId(), nlWords));
database.setTransactionSuccessful();
@ -45,11 +46,19 @@ public class DB11 {
}
};
private String getDeleteEnglishSwordsQuery(Language English) {
private String getDeleteEnglishSwordsQuery() {
Language English = LanguageCollection.getByLocale(ctx, Locale.ENGLISH.toString());
assert English != null;
return "DELETE FROM words WHERE lang=" + English.getId() + " AND word LIKE '%''s'";
}
private String getDeleteWordsQuery(int langId, String wordList) {
return "DELETE FROM words WHERE lang=" + langId + " AND word IN(" + wordList + ")";
}
private String getTruncateBulgarianQuery() {
Language Bulgarian = LanguageCollection.getByLocale(ctx, "bg_BG");
assert Bulgarian != null;
return "DELETE FROM words WHERE lang=" + Bulgarian.getId();
}
}