Repository navigation
feat(backup): back up the personal dictionary and separate the text expander - #829
Merged
Merged
Conversation
…xpander The personal dictionary lives in Android's user dictionary, so the backup, which only contained files and preferences of the app, did not include it. It is saved as personal_dictionary.txt now, and restoring only adds the words that are not in the user dictionary yet. The backup dialog has separate options for Dictionaries, Personal Dictionary and Text Expander (the text expander was part of Dictionaries without saying so). Backups made before restore as before with the default selection. The export and import of the personal dictionary share the code with the backup. The import also keeps locales such as en_US, which were read as language tags before and came back empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A user asked whether the backup includes the text expander and the personal dictionary.
Changes
personal_dictionary.txtin the zip. Restoring only adds words that are not in the user dictionary yet, so existing words (also from other keyboards) are kept. No file is written if there are no words.PersonalDictionaryTransfer.en_US, but the import read them as language tags, so imported words came back without a language. They are kept as they are now, and tags likeen-USare still converted.Tests
PersonalDictionaryTransferTest(round trip, locale conversion, Gboard column order, skipped lines) andBackupPreferencesTest(updated for the new category, new tests that dictionaries do not restore the text expander).assembleStandardDebug,compileOfflineRunTestsKotlin; installed on a device.