Skip to content

feat(backup): back up the personal dictionary and separate the text expander - #829

Merged
LeanBitLab merged 1 commit into
mainfrom
feat/backup-personal-dictionary
Nov 15, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
feat/backup-personal-dictionary

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

What

A user asked whether the backup includes the text expander and the personal dictionary.

  • The text expander was already included, but inside "Dictionaries" without saying so.
  • The personal dictionary was not included: its words are in Android's user dictionary, and the backup only had the app's own files and preferences.

Changes

  • The backup dialog has separate options: Dictionaries, Personal Dictionary, Text Expander (all ticked by default).
  • The personal dictionary is saved as personal_dictionary.txt in 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.
  • Backups made before restore as before: the text expander data is now read under the Text Expander option.
  • The personal dictionary export/import and the backup share PersonalDictionaryTransfer.
  • Fix: the export wrote locales such as 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 like en-US are still converted.
  • FEATURES section 39 is updated. New strings are translated by the commit hook (spot checked).

Tests

  • PersonalDictionaryTransferTest (round trip, locale conversion, Gboard column order, skipped lines) and BackupPreferencesTest (updated for the new category, new tests that dictionaries do not restore the text expander).
  • assembleStandardDebug, compileOfflineRunTestsKotlin; installed on a device.
  • Reading and writing the real user dictionary through a backup and restore is not covered by unit tests.

…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.
@LeanBitLab
LeanBitLab merged commit 019bed1 into main Nov 15, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the feat/backup-personal-dictionary branch November 15, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant