Commit graph

163 commits

Author SHA1 Message Date
Damien Elmes
e512199ace add restore media action 2020-03-10 13:35:09 +10:00
Damien Elmes
cac9ccfa0d add empty trash action in aqt 2020-03-10 12:49:40 +10:00
Damien Elmes
a6b1a32378 don't clean up the trash folder automatically
The media check now reports if any files are in the trash folder,
and a method has been exposed to clear the trash.
2020-03-10 12:02:38 +10:00
Damien Elmes
005a8831e1 add basic log rotation 2020-03-10 10:33:14 +10:00
Damien Elmes
387207cd86 log sync errors 2020-03-10 09:43:48 +10:00
Damien Elmes
80065f3ce2 tweak logging 2020-03-10 09:30:05 +10:00
Damien Elmes
6f9079a341 don't try to read file data when file marked as a deletion
If the user hadn't used the media check to clean up files with
invalid names on disk,  the long filename would break the 'automatically
rename long filenames when syncing' functionality, causing the original
long filename to be uploaded to AnkiWeb as an addition instead of
a deletion
2020-03-10 09:29:36 +10:00
Damien Elmes
2e4fb4401f fix incorrect mark_collection_modified()
- usn shouldn't be changed
- mtime is in milliseconds
2020-03-05 14:55:03 +10:00
Damien Elmes
c97b37b7ae make logging explicit, and support logging to a file 2020-02-29 20:44:01 +10:00
Damien Elmes
42781a696f remove some unused imports 2020-02-29 15:21:11 +10:00
Damien Elmes
e26860ad04 don't require a media scan after media deleted inside Anki 2020-02-29 14:45:16 +10:00
Damien Elmes
0810d9d5e0 fix display of years 2020-02-28 17:14:35 +10:00
Damien Elmes
5337ea457a extra newline in network details 2020-02-27 11:22:48 +10:00
Damien Elmes
f20a23b1a9 use debug description for untranslated errors; fix template error 2020-02-27 11:07:18 +10:00
Damien Elmes
b030f2b40b info is superfluous 2020-02-27 10:53:49 +10:00
Damien Elmes
83d894ac87 return a localized error for all error kinds
some errors are not yet localized, but now the Python code
doesn't need to think about which property to use
2020-02-27 10:46:24 +10:00
Damien Elmes
59328d9ade tweak rounding
- avoid rounding minutes
- round the seconds taken in the card info screen
- provide different precise and imprecise modes, since we need
to display seconds to multiple decimals in some areas
2020-02-25 17:29:06 +10:00
Damien Elmes
64851afa5e cap answer buttons to 1 decimal place
we can switch to NUMBER() instead in the future, but will need
to update all the translations at the same time
2020-02-25 13:24:29 +10:00
Damien Elmes
c2cfe70b9b use Fluent's number formatting; don't show trailing zeros
We can add NUMBER() in the future for more control, but this will
do for the time being.
2020-02-25 13:22:41 +10:00
Damien Elmes
ea22296d4c expand clozes before rendering LaTeX
https://anki.tenderapp.com/discussions/ankidesktop/39071-latex-media-windows-version-2121-0cd1ee92-fail-rendering-latex
2020-02-24 18:34:08 +10:00
Damien Elmes
c98247fa0f translations no longer require an open collection 2020-02-23 14:57:02 +10:00
Damien Elmes
0d1a30c6d8 rework Fluent handling
- all .ftl files for a language are concatenated into a single file
at build time
- all languages are included in the binary
- external ftl files placed in the ftl folder can override the
built-in definitions
- constants are automatically generated for each string key
- dropped the separate StringsGroup enum
2020-02-23 13:22:50 +10:00
Damien Elmes
fba8a6ffed fix message references 2020-02-22 21:48:14 +10:00
Damien Elmes
09e4e50751 add file prefix to fluent keys so we can merge the files at build 2020-02-22 20:26:15 +10:00
Damien Elmes
bff36141f0 make sure English takes priority if it's listed first 2020-02-21 22:01:35 +10:00
Damien Elmes
72528ee41c add deck config category 2020-02-21 20:53:20 +10:00
Damien Elmes
abc260b7c3 reviews 2020-02-21 20:36:22 +10:00
Damien Elmes
258a8a04f0 fix comment 2020-02-21 20:10:58 +10:00
Damien Elmes
e84fa7dee3 add next learning due time + remaining count to congrats screen
https://anki.tenderapp.com/discussions/ankidesktop/38000-v2-scheduler-learning-cards
2020-02-21 19:54:50 +10:00
Damien Elmes
3a83d9844a add studied_today(), move to statistics.ftl 2020-02-21 18:01:15 +10:00
Damien Elmes
e3e376036f add average-answer-time to Fluent
drop the 0.1 special case; we're using two decimals now
2020-02-21 17:42:55 +10:00
Damien Elmes
65f2131340 remove unused import 2020-02-21 15:29:38 +10:00
Damien Elmes
4e612cdd3b add 'studied-today' to Fluent
The string has been constructed in parts so the old translations
could be preserved
2020-02-21 15:29:38 +10:00
Damien Elmes
74bff450e2 add non-abbreviated timespan translation; update existing short=True calls
- drop the '5m3s' special casing done in the card stats screen, and
just use decimals
- change alignment of the review log so that the non-abbreviated
spans are easier to read
2020-02-21 15:29:38 +10:00
Damien Elmes
11647daec1 move answer_button_time to the backend, split sched into separate module 2020-02-21 15:29:38 +10:00
Damien Elmes
2633d6db4b move answer button labels into fluent 2020-02-21 15:29:38 +10:00
Damien Elmes
cf1824dac5 update to latest fluent-rs and add basic locale-aware decimals
- git version pinned at the moment until the concurrency fix
lands in 0.10.2
- currently float values are hard-coded at 2 decimal places;
we should switch to using NUMBER() in the future
2020-02-21 15:29:38 +10:00
Damien Elmes
5bb81a95c2 add 'new #' prefix to new cards in the due column 2020-02-18 11:16:15 +10:00
Damien Elmes
302fc2b24e fix deletion notices being sent unnecessarily 2020-02-17 17:21:58 +10:00
Damien Elmes
fd01cac4d7 split "Due" into three different contexts for translators 2020-02-17 14:41:01 +10:00
Damien Elmes
957a0fae75 media check required message is no longer required 2020-02-17 13:51:33 +10:00
Damien Elmes
b554ad8c1d match older string 2020-02-17 13:41:02 +10:00
Damien Elmes
e898bd82f1 add some more comments 2020-02-17 11:43:18 +10:00
Damien Elmes
f40a00f0cb localize some error messages 2020-02-17 11:38:22 +10:00
Damien Elmes
f6643eda53 use new i18n infrastructure for more media check / media sync strings 2020-02-17 10:18:20 +10:00
Damien Elmes
60fafd0457 add some comments to card-template-rendering.ftl 2020-02-17 09:06:54 +10:00
Damien Elmes
4b63a07c99 expose translations to Python 2020-02-17 08:40:17 +10:00
Damien Elmes
0260343c69 cache i18n categories 2020-02-17 08:40:17 +10:00
Damien Elmes
342c53a1e4 don't hard-code available ftl languages
Instead of trying to define which languages we support, just check
if an appropriate folder is available on disk. This allows users
to drop their own translations into the locale folder and have things
just work.
2020-02-17 08:40:17 +10:00
Damien Elmes
998b2c0f13 wrap i18n struct in a shared mutex so we can start caching 2020-02-17 08:40:17 +10:00