Skip to content

refactor: translate related data migration#10725

Draft
EurFelux wants to merge 13 commits intov2from
refactor/translate
Draft

refactor: translate related data migration#10725
EurFelux wants to merge 13 commits intov2from
refactor/translate

Conversation

@EurFelux
Copy link
Collaborator

@EurFelux EurFelux commented Oct 14, 2025

What this PR does

  • Use preference from redux to preference/cache
  • Migrate settings in redux to preference
  • Use preference instead of settings in indexedDB
  • Migrate settings in indexedDB to preference
  • Migrate user data (translate history, custom languages)

Fixes #

Why we need it and why it was done in this way

The following tradeoffs were made:

The following alternatives were considered:

Links to places where the discussion took place:

Breaking changes

If this PR introduces breaking changes, please describe the changes and the impact on users.

Special notes for your reviewer

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note


- Replace Redux state management with cache system for translate functionality
- Add new CacheTranslating type to track translation state
- Update TranslatePage to use cache hooks for input, output and state
- Simplify translate function and improve error handling
…rence

Move auto copy setting from redux store to preference system for better consistency
The translate slice actions and types have been migrated elsewhere, so they are removed from this file. The file is marked as deprecated.
Move auto detection method configuration from local state to preference store
Remove unused auto detection types from renderer types
Add zod schema for auto detection method validation
…ageLabel

Move language label generation from individual TranslateLanguage objects to a centralized getLanguageLabel function in useTranslate hook. This improves maintainability by removing duplicate label logic and makes it easier to update language labels globally.

- Remove label() method from TranslateLanguage type and all language objects
- Add getLanguageLabel function in useTranslate that handles label generation
- Update all components to use getLanguageLabel instead of label()
- Add labelMap for common language codes to avoid unnecessary lookups
Refactor bidirectional translation logic to use cache for state management
Simplify language pair handling by using language codes directly
…e management

Move markdown toggle state to preferences system and remove direct database operations
Remove local state management for scroll sync and use preference system instead
Clean up unused imports and props in translate components
Move source and target language state management from database to cache for better performance and consistency
@EurFelux EurFelux added the v2 label Oct 14, 2025
…e handling

- Introduce TargetLangs type to manage target and alter languages
- Replace local state with preference-based language management
- Simplify language selection logic in ActionTranslate component
- Remove deprecated database storage for language pairs
@EurFelux EurFelux marked this pull request as ready for review October 14, 2025 17:44
@EurFelux EurFelux requested a review from 0xfullex as a code owner October 14, 2025 17:44
@0xfullex 0xfullex added this to the v2.0.0 milestone Oct 15, 2025
@0xfullex 0xfullex requested a review from a team January 29, 2026 16:12
@EurFelux EurFelux marked this pull request as draft March 6, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants