1
0
Fork 0

New languages screen (#595)

* added a dictionary size property

* new language selection screen

* added a language search field

* SettingsStore now return a copy of the enabled languages to prevent accidental overwriting of the original settings object
This commit is contained in:
Dimo Karaivanov 2024-08-08 14:59:50 +03:00 committed by GitHub
parent 76099862e5
commit 2eea62b26f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 540 additions and 160 deletions

View file

@ -2,8 +2,9 @@ ext.getDictionaryProperties = { dictionariesDir, sizesDir ->
fileTree(dir: dictionariesDir).getFiles().parallelStream().forEach {dictionary ->
def hash = dictionary.exists() ? dictionary.text.digest("SHA-1") : ""
def revision = dictionary.exists() ? exec("git log --pretty=tformat:%H -n 1 ${dictionary}") : ""
def size = dictionary.exists() ? dictionary.length() : 0
def words = dictionary.exists() ? dictionary.text.split("\n").length : 0
new File(sizesDir, "${dictionary.getName()}.props.yml").text = "hash: ${hash}\nrevision: ${revision}\nwords: ${words}"
new File(sizesDir, "${dictionary.getName()}.props.yml").text = "hash: ${hash}\nrevision: ${revision}\nsize: ${size}\nwords: ${words}"
}
}